Package org.apache.mahout.math.map

Examples of org.apache.mahout.math.map.OpenIntDoubleHashMap


    } else {
      setName(className); // we have already read the class name in VectorWritable
    }
    size = dataInput.readInt();
    int cardinality = dataInput.readInt();
    OpenIntDoubleHashMap values = new OpenIntDoubleHashMap(cardinality);
    int i = 0;
    while (i < cardinality) {
      int index = dataInput.readInt();
      double value = dataInput.readDouble();
      values.put(index, value);
      i++;
    }
    assert (i == cardinality);
    this.values = values;
  }
View Full Code Here


    // 'sparseness'
  }

  public RandomAccessSparseVector(String name, int cardinality, int size) {
    super(name, cardinality);
    values = new OpenIntDoubleHashMap(size);
  }
View Full Code Here

   *                                  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

   *                                  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>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

   *                                  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

   *                                  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

   *                                  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

   *                                  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

    this(cardinality, Math.min(cardinality, INITIAL_SIZE)); // arbitrary estimate of 'sparseness'
  }

  public RandomAccessSparseVector(int cardinality, int size) {
    super(cardinality);
    values = new OpenIntDoubleHashMap(size);
  }
View Full Code Here

TOP

Related Classes of org.apache.mahout.math.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.