Package cern.colt.matrix

Examples of cern.colt.matrix.DoubleFactory2D.make()


  { 2, 4, 6 },
  { 3, 6, 9 },
  { 4, -8, -10 }
};
DoubleFactory2D factory = DoubleFactory2D.dense;
DoubleMatrix2D A = factory.make(values);
System.out.println("\n\nmatrix="+A);
System.out.println("\ncovar1="+covariance(A));
//System.out.println(correlation(covariance(A)));
//System.out.println(distance(A,EUCLID));
View Full Code Here


 
double value = 2;
double omega = 1.25;
final double alpha = omega * 0.25;
final double beta = 1-omega;
A = factory.make(size,size,value);

cern.colt.function.Double9Function function = new cern.colt.function.Double9Function() {
  public final double apply(double a00, double a01, double a02, double a10, double a11, double a12, double a20, double a21, double a22) {
    return alpha*a11 + beta*(a01+a10+a12+a21);
  }
 
View Full Code Here

//A.zSum4Neighbors(A,alpha,beta,runs);
timer.stop().display();
//System.out.println("A="+A);
A=null;

double[][] B =  factory.make(size,size,value).toArray();
timer.reset().start();

System.out.println("benchmarking stencil scimark...");
for (int i=0; i<runs; i++) {
//  jnt.scimark2.SOR.execute(omega, B, runs);
View Full Code Here

  factory = Factory2D.dense;
else
  factory = Factory2D.sparse;
 
double value = 0.5;
A = factory.make(size,size,value);
Property.generateNonSingular(A);
cern.colt.Timer timer = new cern.colt.Timer().start();

System.out.println(A);
System.out.println(Algebra.ZERO.inverse(A));
View Full Code Here

  factory = Factory2D.dense;
else
  factory = Factory2D.sparse;
 
double value = 0.5;
A = factory.make(size,size,value);
Property.generateNonSingular(A);
cern.colt.Timer timer = new cern.colt.Timer().start();

DoubleMatrix2DComparator fun = new DoubleMatrix2DComparator() {
  public int compare(DoubleMatrix2D a, DoubleMatrix2D b) {
View Full Code Here

    { 1, 2, 3, 4, 5, 6},
    { 2, 3, 4, 5, 6, 7}
  };
  DoubleFactory2D f = DoubleFactory2D.dense;
  DoubleMatrix1D vector = new DenseDoubleMatrix1D(data);
  DoubleMatrix2D matrix = f.make(arrMatrix);
  DoubleMatrix1D res = vector.like(matrix.rows());
 
  matrix.zMult(vector,res);

  System.out.println(res);
View Full Code Here


  public static double fun_MDETERM( double[] _squareMatrix, int _sideLength )
  {
    final DoubleFactory2D factory2D = DoubleFactory2D.dense;
    final DoubleMatrix2D matrix2D = factory2D.make( _squareMatrix, _sideLength );
    return Algebra.DEFAULT.det( matrix2D );
  }


  /**
 
View Full Code Here

      if (v <= 0)
         throw new IllegalArgumentException("   v <= 0");
      DMatrix.multBand(B, 1, v); // B <-- B/2^s

      DoubleFactory2D fac = DoubleFactory2D.dense;
      DoubleMatrix2D T = fac.make(n, n);
      DoubleMatrix2D B4 = fac.make(n, n);
      DMatrix.multBand(B, 1, B, 1, T); // B^2
      DMatrix.multBand(T, 2, T, 2, B4); // B^4

      DoubleMatrix2D W = B4.copy(); // W = work matrix
View Full Code Here

         throw new IllegalArgumentException("   v <= 0");
      DMatrix.multBand(B, 1, v); // B <-- B/2^s

      DoubleFactory2D fac = DoubleFactory2D.dense;
      DoubleMatrix2D T = fac.make(n, n);
      DoubleMatrix2D B4 = fac.make(n, n);
      DMatrix.multBand(B, 1, B, 1, T); // B^2
      DMatrix.multBand(T, 2, T, 2, B4); // B^4

      DoubleMatrix2D W = B4.copy(); // W = work matrix
      DMatrix.addMultBand(cPade[9], W, 4, cPade[7], T, 2); // W <-- W*cPade[9] + T*cPade[7]
 
View Full Code Here

      DMatrix.multBand(B, 1, B, 1, T); // B^2
      DMatrix.multBand(T, 2, T, 2, B4); // B^4

      DoubleMatrix2D W = B4.copy(); // W = work matrix
      DMatrix.addMultBand(cPade[9], W, 4, cPade[7], T, 2); // W <-- W*cPade[9] + T*cPade[7]
      DoubleMatrix2D U = fac.make(n, n);
      DMatrix.multBand(W, 4, B4, 4, U); // U <-- B4*W

      W = B4.copy();
      DMatrix.addMultBand(cPade[5], W, 4, cPade[3], T, 2); // W <-- W*cPade[5] + T*cPade[3]
      for (int i = 0; i < n; ++i) {   // W <-- W + I*cPade[1]
 
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.