Examples of DenseDoubleMatrix1D


Examples of cern.colt.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 cern.colt.matrix.impl.DenseDoubleMatrix1D

* @throws IllegalArgumentException if <tt>A.columns() != y.size() || A.rows() > z.size())</tt>.
*/
public DoubleMatrix1D zMult(DoubleMatrix1D y, DoubleMatrix1D z, double alpha, double beta, boolean transposeA) {
  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: "+toStringShort()+", "+y.toStringShort()+", "+z.toStringShort());

  for (int i = rows; --i >= 0; ) {
    double s = 0;
View Full Code Here

Examples of cern.colt.matrix.impl.DenseDoubleMatrix1D

     * or calculates it if not.
     *
     * @return DoubleMatrix1D
     */
    private DoubleMatrix1D getStationaryDistribution() {
        DoubleMatrix1D piVector = new DenseDoubleMatrix1D(getVertexCount());
        PageRank<V,E> pageRank = new PageRank<V,E>(getGraph(),
                MapTransformer.getInstance(getEdgeWeights()), 0);
        pageRank.evaluate();
       
        for (V v : getGraph().getVertices())
            piVector.set(mIndexer.get(v), pageRank.getVertexScore(v));
        return piVector;
    }
View Full Code Here

Examples of cern.colt.matrix.impl.DenseDoubleMatrix1D

     * implementation that provides such an ordering ({@code SortedMap, LinkedHashMap}, etc.).
     */
    public static <V> DoubleMatrix1D mapTo1DMatrix(Map<V,Number> map)
    {
        int numVertices = map.size();
        DoubleMatrix1D vector = new DenseDoubleMatrix1D(numVertices);
        int i = 0;
        for (V v : map.keySet())
        {
            vector.set(i, map.get(v).doubleValue());
            i++;
        }
        return vector;
    }
View Full Code Here

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

   */
  public DoubleMatrix1D make(double[] values) {
    if (this == sparse) {
      return new SparseDoubleMatrix1D(values);
    } else {
      return 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: " + toStringShort() + ", " + y.toStringShort() + ", " + z.toStringShort());
    }
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
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.