Examples of viewRow()


Examples of cern.colt.matrix.DoubleMatrix2D.viewRow()

  DoubleMatrix2D X = B.copy();
  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++) {
      // X[i,j] -= X[k,j]*L[i,k]
 
View Full Code Here

Examples of cern.colt.matrix.DoubleMatrix2D.viewRow()

  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;
}
/**
* Copies the rows of the indicated columns into a new sub matrix.
View Full Code Here

Examples of cern.colt.matrix.ObjectMatrix2D.viewRow()

* Returns a string representation of the given matrix.
* @param matrix the matrix to convert.
*/
public String toString(ObjectMatrix1D matrix) {
  ObjectMatrix2D easy = matrix.like2D(1,matrix.size());
  easy.viewRow(0).assign(matrix);
  return toString(easy);
}
/**
* Returns a string representation of the given matrix.
* @param matrix the matrix to convert.
View Full Code Here

Examples of cern.colt.matrix.ObjectMatrix2D.viewRow()

* Returns a string representation of the given matrix.
* @param matrix the matrix to convert.
*/
public String toString(ObjectMatrix1D matrix) {
  ObjectMatrix2D easy = matrix.like2D(1,matrix.size());
  easy.viewRow(0).assign(matrix);
  return toString(easy);
}
/**
* Returns a string representation of the given matrix.
* @param matrix the matrix to convert.
View Full Code Here

Examples of org.apache.mahout.math.DenseMatrix.viewRow()

      }
    };

    SSVDPrototype mapperSimulation = new SSVDPrototype(rndSeed, kp, r);
    for (int i = 0; i < m; i++) {
      mapperSimulation.firstPass(mx.viewRow(i));
    }

    mapperSimulation.finishFirstPass();

    for (int i = 0; i < m; i++) {
View Full Code Here

Examples of org.apache.mahout.math.DenseMatrix.viewRow()

    }

    mapperSimulation.finishFirstPass();

    for (int i = 0; i < m; i++) {
      mapperSimulation.secondPass(mx.viewRow(i), btEmitter);
    }

    // LocalSSVDTest.assertOrthonormality(mapperSimulation.m_qt.transpose(),
    // false,1e-10);
View Full Code Here

Examples of org.apache.mahout.math.DenseMatrix.viewRow()

    Matrix topicTermCounts = new DenseMatrix(numTopics, numTerms);
    Vector topicSums = new DenseVector(numTopics);
    if(random != null) {
      for(int x = 0; x < numTopics; x++) {
        for(int term = 0; term < numTerms; term++) {
          topicTermCounts.viewRow(x).set(term, random.nextDouble());
        }
      }
    }
    for(int x = 0; x < numTopics; x++) {
      topicSums.set(x, random == null ? 1.0 : topicTermCounts.viewRow(x).norm(1));
View Full Code Here

Examples of org.apache.mahout.math.DenseMatrix.viewRow()

          topicTermCounts.viewRow(x).set(term, random.nextDouble());
        }
      }
    }
    for(int x = 0; x < numTopics; x++) {
      topicSums.set(x, random == null ? 1.0 : topicTermCounts.viewRow(x).norm(1));
    }
    return Pair.of(topicTermCounts, topicSums);
  }

  public static Pair<Matrix, Vector> loadModel(Configuration conf, Path... modelPaths)
View Full Code Here

Examples of org.apache.mahout.math.DenseMatrix.viewRow()

    }
    numTopics++;
    Matrix model = new DenseMatrix(numTopics, numTerms);
    Vector topicSums = new DenseVector(numTopics);
    for(Pair<Integer, Vector> pair : rows) {
      model.viewRow(pair.getFirst()).assign(pair.getSecond());
      topicSums.set(pair.getFirst(), pair.getSecond().norm(1));
    }
    return Pair.of(model, topicSums);
  }
View Full Code Here

Examples of org.apache.mahout.math.DenseMatrix.viewRow()

      Vector oldEigen = eigenVectors.viewRow(row);
      if(oldEigen == null) {
        break;
      }
      for(int newRow = 0; newRow < eigenVectors2.numRows(); newRow++) {
        Vector newEigen = eigenVectors2.viewRow(newRow);
        if(newEigen != null) {
          if(oldEigen.dot(newEigen) > 0.9) {
            oldEigensFound.add(row);
            break;
          }
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.