Package org.apache.mahout.math.matrix

Examples of org.apache.mahout.math.matrix.DoubleMatrix2D.viewRow()


   *
   * @param matrix the matrix to convert.
   */
  public String toString(DoubleMatrix1D matrix) {
    DoubleMatrix2D easy = matrix.like2D(1, matrix.size());
    easy.viewRow(0).assign(matrix);
    return toString(easy);
  }

  /**
   * Returns a string representation of the given matrix.
View Full Code Here


    for (int r = rowIndexes.length; --r >= 0;) {
      int row = rowIndexes[r];
      if (row < 0 || row >= rows) {
        throw new IndexOutOfBoundsException("Illegal Index");
      }
      sub.viewRow(r).assign(A.viewRow(row));
    }
    return sub;
  }

  /**
 
View Full Code Here

    //int nx = B.columns();

    // precompute and cache some views to avoid regenerating them time and again
    DoubleMatrix1D[] Xrows = new DoubleMatrix1D[n];
    for (int k = 0; k < n; k++) {
      Xrows[k] = X.viewRow(k);
    }

    // Solve L*Y = B;
    for (int k = 0; k < n; k++) {
      for (int i = k + 1; i < n; i++) {
View Full Code Here

        DoubleMatrix2D VT = V.viewDice();
        aggregates = new double [VT.rows()];

        for (int i = 0; i < aggregates.length; i++)
        {
            aggregates[i] = VT.viewRow(i).aggregate(Functions.PLUS, Functions.SQUARE);
        }

        final IndirectComparator.DescendingDoubleComparator comparator = new IndirectComparator.DescendingDoubleComparator(
            aggregates);
        V = MatrixUtils.sortedRowsView(VT, comparator).viewDice();
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.