Package cern.colt.matrix.impl

Examples of cern.colt.matrix.impl.DenseDoubleMatrix2D


 
  int m = rows;
  int n = columns;
  int p = B.columns;

  if (C==null) C = new DenseDoubleMatrix2D(m,p);
  if (B.rows != n)
    throw new IllegalArgumentException("Matrix2D inner dimensions must agree:"+toStringShort()+", "+B.toStringShort());
  if (C.rows != m || C.columns != p)
    throw new IllegalArgumentException("Incompatibel result matrix: "+toStringShort()+", "+B.toStringShort()+", "+C.toStringShort());
  if (this == C || B == C)
View Full Code Here


* @param values The values to be filled into the new matrix.
* @throws IllegalArgumentException if <tt>for any 1 &lt;= row &lt; values.length: values[row].length != values[row-1].length</tt>.
*/
public DoubleMatrix2D make(double[][] values) {
  if (this==sparse) return new SparseDoubleMatrix2D(values);
  else return new DenseDoubleMatrix2D(values);
}
View Full Code Here

*/
public DoubleMatrix2D make(int rows, int columns) {
  if (this==sparse) return new SparseDoubleMatrix2D(rows,columns);
  if (this==rowCompressed) return new RCDoubleMatrix2D(rows,columns);
  //if (this==rowCompressedModified) return new RCMDoubleMatrix2D(rows,columns);
  else return new DenseDoubleMatrix2D(rows,columns);
}
View Full Code Here

        for (int i = offset; i < values.length; ++i) {
            for (int j = 0; j < featureIndecis.length; ++j) {
                result[0] += values[i][featureIndecis[j][0]][featureIndecis[j][1]];
            }
        }
        terms = new DenseDoubleMatrix2D(xDim * yDim, windowLength * featureLength);
        z = new DenseDoubleMatrix2D(1, featureLength);
        calcTerms(terms);
        result = ((new Algebra()).solve(terms, z)).viewRow(0).toArray();
    }
View Full Code Here

* @param values The values to be filled into the new matrix.
* @throws IllegalArgumentException if <tt>for any 1 &lt;= row &lt; values.length: values[row].length != values[row-1].length</tt>.
*/
public DoubleMatrix2D make(double[][] values) {
  if (this==sparse) return new SparseDoubleMatrix2D(values);
  else return new DenseDoubleMatrix2D(values);
}
View Full Code Here

*/
public DoubleMatrix2D make(int rows, int columns) {
  if (this==sparse) return new SparseDoubleMatrix2D(rows,columns);
  if (this==rowCompressed) return new RCDoubleMatrix2D(rows,columns);
  //if (this==rowCompressedModified) return new RCMDoubleMatrix2D(rows,columns);
  else return new DenseDoubleMatrix2D(rows,columns);
}
View Full Code Here

 
  int m = rows;
  int n = columns;
  int p = B.columns;

  if (C==null) C = new DenseDoubleMatrix2D(m,p);
  if (B.rows != n)
    throw new IllegalArgumentException("Matrix2D inner dimensions must agree:"+toStringShort()+", "+B.toStringShort());
  if (C.rows != m || C.columns != p)
    throw new IllegalArgumentException("Incompatibel result matrix: "+toStringShort()+", "+B.toStringShort()+", "+C.toStringShort());
  if (this == C || B == C)
View Full Code Here

    *
    *
    */
   public static void CholeskyDecompose (double[][] M, double[][] L)  {
      int d = M.length;
      DoubleMatrix2D MM = new DenseDoubleMatrix2D (M);
      DoubleMatrix2D LL = new DenseDoubleMatrix2D (d, d);
      CholeskyDecomposition decomp = new CholeskyDecomposition (MM);
      LL = decomp.getL();
      for(int i = 0; i < L.length; i++)
         for(int j = 0; j <= i; j++)
            L[i][j] = LL.get(i,j);
      for(int i = 0; i < L.length; i++)
         for(int j = i + 1; j < L.length; j++)
            L[i][j] = 0.0;
    }
View Full Code Here

    *
    */
   public static void PCADecompose (double[][] M, double[][] A,
                                    double[] lambda) {
      int d = M.length;
      DoubleMatrix2D MM = new DenseDoubleMatrix2D (M);
      DoubleMatrix2D AA = new DenseDoubleMatrix2D (d, d);
      AA = PCADecompose(MM, lambda);

      for(int i = 0; i < d; i++)
         for(int j = 0; j < d; j++)
            A[i][j] = AA.get(i,j);
    }
View Full Code Here

    *
    *   @return the exponential of <SPAN CLASS="MATH"><I>A</I></SPAN>
    *
    */
   public static double[][] exp (double[][] A)  {
      DoubleMatrix2D V = new DenseDoubleMatrix2D(A);
      DoubleMatrix2D R = exp(V);
      return R.toArray();
   }
View Full Code Here

TOP

Related Classes of cern.colt.matrix.impl.DenseDoubleMatrix2D

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.