Package cern.colt.map

Examples of cern.colt.map.OpenIntDoubleHashMap


* @throws  IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
* @throws  IllegalArgumentException if <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt>.
*/
public SparseDoubleMatrix2D(int rows, int columns, int initialCapacity, double minLoadFactor, double maxLoadFactor) {
  setUp(rows,columns);
  this.elements = new OpenIntDoubleHashMap(initialCapacity, minLoadFactor, maxLoadFactor);
}
View Full Code Here


* @throws  IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
* @throws IllegalArgumentException if <tt>size<0</tt>.
*/
public SparseDoubleMatrix1D(int size, int initialCapacity, double minLoadFactor, double maxLoadFactor) {
  setUp(size);
  this.elements = new OpenIntDoubleHashMap(initialCapacity, minLoadFactor, maxLoadFactor);
}
View Full Code Here

* @throws  IllegalArgumentException if <tt>(double)columns*rows > Integer.MAX_VALUE</tt>.
* @throws  IllegalArgumentException if <tt>slices<0 || rows<0 || columns<0</tt>.
*/
public SparseDoubleMatrix3D(int slices, int rows, int columns, int initialCapacity, double minLoadFactor, double maxLoadFactor) {
  setUp(slices,rows,columns);
  this.elements = new OpenIntDoubleHashMap(initialCapacity, minLoadFactor, maxLoadFactor);
}
View Full Code Here

// using a map
int[]    keys   = {0    , 3     , 100000, 9   };
double[] values = {100.0, 1000.0, 70.0  , 71.0};

int size = keys.length;
AbstractIntDoubleMap map = new OpenIntDoubleHashMap(size*2, 0.2, 0.5);

for (int i=0; i<keys.length; i++) {
   map.put(keys[i], (int)values[i]);
}

System.out.println(map.containsKey(3));
System.out.println(map.get(3));

System.out.println(map.containsKey(4));
System.out.println(map.get(4));

System.out.println(map.containsValue((int)71.0));
System.out.println(map.keyOf((int)71.0));

System.out.println(map);
}
View Full Code Here

* @throws  IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
* @throws  IllegalArgumentException if <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt>.
*/
public SparseDoubleMatrix2D(int rows, int columns, int initialCapacity, double minLoadFactor, double maxLoadFactor) {
  setUp(rows,columns);
  this.elements = new OpenIntDoubleHashMap(initialCapacity, minLoadFactor, maxLoadFactor);
}
View Full Code Here

* @throws  IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
* @throws IllegalArgumentException if <tt>size<0</tt>.
*/
public SparseDoubleMatrix1D(int size, int initialCapacity, double minLoadFactor, double maxLoadFactor) {
  setUp(size);
  this.elements = new OpenIntDoubleHashMap(initialCapacity, minLoadFactor, maxLoadFactor);
}
View Full Code Here

* @throws  IllegalArgumentException if <tt>(double)columns*rows > Integer.MAX_VALUE</tt>.
* @throws  IllegalArgumentException if <tt>slices<0 || rows<0 || columns<0</tt>.
*/
public SparseDoubleMatrix3D(int slices, int rows, int columns, int initialCapacity, double minLoadFactor, double maxLoadFactor) {
  setUp(slices,rows,columns);
  this.elements = new OpenIntDoubleHashMap(initialCapacity, minLoadFactor, maxLoadFactor);
}
View Full Code Here

// using a map
int[]    keys   = {0    , 3     , 100000, 9   };
double[] values = {100.0, 1000.0, 70.0  , 71.0};

int size = keys.length;
AbstractIntDoubleMap map = new OpenIntDoubleHashMap(size*2, 0.2, 0.5);

for (int i=0; i<keys.length; i++) {
   map.put(keys[i], (int)values[i]);
}

System.out.println(map.containsKey(3));
System.out.println(map.get(3));

System.out.println(map.containsKey(4));
System.out.println(map.get(4));

System.out.println(map.containsValue((int)71.0));
System.out.println(map.keyOf((int)71.0));

System.out.println(map);
}
View Full Code Here

   * @param bins
   *            number of bins
   */
  CernPrimativeMapLinearVector(int bins) {
    super(bins);
    feats = new OpenIntDoubleHashMap();
  }
View Full Code Here

  }

  @Override
  public void initW(double param) {
    feats = new OpenIntDoubleHashMap();
    if (!VectorUtils.floatingPointEquals(param, 0))
      for (int i = 0; i < numRows; i++)
        updateValue(i, param);
  }
View Full Code Here

TOP

Related Classes of cern.colt.map.OpenIntDoubleHashMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.