Examples of DenseDoubleMatrix1D


Examples of org.apache.mahout.math.matrix.impl.DenseDoubleMatrix1D

   * not reflected in the matrix, and vice-versa.
   *
   * @param values The values to be filled into the new matrix.
   */
  public DoubleMatrix1D make(double[] values) {
    return this == sparse ? new SparseDoubleMatrix1D(values) : new DenseDoubleMatrix1D(values);
  }
View Full Code Here

Examples of org.apache.mahout.math.matrix.impl.DenseDoubleMatrix1D

  /** Constructs a matrix with the given shape, each cell initialized with zero. */
  public DoubleMatrix1D make(int size) {
    if (this == sparse) {
      return new SparseDoubleMatrix1D(size);
    }
    return new DenseDoubleMatrix1D(size);
  }
View Full Code Here

Examples of org.apache.mahout.math.matrix.impl.DenseDoubleMatrix1D

    if (transposeA) {
      return viewDice().zMult(y, z, alpha, beta, false);
    }
    //boolean ignore = (z==null);
    if (z == null) {
      z = new DenseDoubleMatrix1D(this.rows);
    }
    if (columns != y.size() || rows > z.size()) {
      throw new IllegalArgumentException("Incompatible args");
    }
View Full Code Here

Examples of org.apache.mahout.math.matrix.impl.DenseDoubleMatrix1D

    if (transposeA) {
      return viewDice().zMult(y, z, alpha, beta, false);
    }
    //boolean ignore = (z==null);
    if (z == null) {
      z = new DenseDoubleMatrix1D(this.rows);
    }
    if (columns != y.size() || rows > z.size()) {
      throw new IllegalArgumentException("Incompatible args");
    }
View Full Code Here

Examples of org.apache.mahout.math.matrix.impl.DenseDoubleMatrix1D

   * Returns the imaginary parts of the eigenvalues.
   *
   * @return imag(diag(D))
   */
  public DoubleMatrix1D getImagEigenvalues() {
    return new DenseDoubleMatrix1D(e);
  }
View Full Code Here

Examples of org.apache.mahout.math.matrix.impl.DenseDoubleMatrix1D

   * Returns the real parts of the eigenvalues.
   *
   * @return real(diag(D))
   */
  public DoubleMatrix1D getRealEigenvalues() {
    return new DenseDoubleMatrix1D(d);
  }
View Full Code Here

Examples of org.apache.mahout.math.matrix.impl.DenseDoubleMatrix1D

    {
        // Prepare a centroid. If dimensionality reduction was used,
        // the centroid from k-means will not be based on real terms,
        // so we need to calculate the centroid here once again based
        // on the cluster's documents.
        final DoubleMatrix1D centroid = new DenseDoubleMatrix1D(termDocumentMatrix.rows());
        for (IntCursor d : documents)
        {
            centroid.assign(termDocumentMatrix.viewColumn(d.value), Functions.PLUS);
        }

        final List<String> labels = Lists.newArrayListWithCapacity(labelCount);

        final int [] order = IndirectSort.mergesort(0, centroid.size(),
            new IndirectComparator()
            {
                @Override
                public int compare(int a, int b)
                {
                    final double valueA = centroid.get(a);
                    final double valueB = centroid.get(b);
                    return valueA < valueB ? -1 : valueA > valueB ? 1 : 0;
                }
            });
        final double minValueForLabel = centroid.get(order[order.length
            - Math.min(labelCount, order.length)]);

        for (int i = 0; i < centroid.size(); i++)
        {
            if (centroid.getQuick(i) >= minValueForLabel)
            {
                labels.add(LabelFormatter.format(new char [] []
                {
                    wordImage[mostFrequentOriginalWordIndex[rowToStemIndex.get(i)]]
                }, new boolean []
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.