Examples of DoubleMatrix2D


Examples of cern.colt.matrix.DoubleMatrix2D

}
/**
*/
public static void doubleTest21() {
System.out.println("\n\n");
DoubleMatrix2D A;
int k;
int uk;
int lk;

double[][] values1 =
View Full Code Here

Examples of cern.colt.matrix.DoubleMatrix2D

}
/**
*/
public static void doubleTest22() {
System.out.println("\n\n");
DoubleMatrix2D A;
int k;
int uk;
int lk;

double[][] values1 =
View Full Code Here

Examples of cern.colt.matrix.DoubleMatrix2D

/**
*/
public static void doubleTest23(int runs, int size, double nonZeroFraction, boolean dense) {
System.out.println("\n\n");
System.out.println("initializing...");
DoubleMatrix2D A, LU, I, Inv;
DoubleMatrix1D b, solved;

double mean = 5.0;
double stdDev = 3.0;
cern.jet.random.Normal random = new cern.jet.random.Normal(mean, stdDev, new cern.jet.random.engine.MersenneTwister());

System.out.println("sampling...");
double value = 2;
if (dense)
  A = Factory2D.dense.sample(size,size, value, nonZeroFraction);
else
  A = Factory2D.sparse.sample(size,size, value, nonZeroFraction);
b = A.like1D(size).assign(1);

//A.assign(random);
//A.assign(F.rint); // round
System.out.println("generating invertible matrix...");
Property.generateNonSingular(A);

//I = Factory2D.identity(size);

LU = A.like();
solved = b.like();
//Inv = Factory2D.make(size,size);

LUDecompositionQuick lu = new LUDecompositionQuick();

View Full Code Here

Examples of cern.colt.matrix.DoubleMatrix2D

/**
*/
public static void doubleTest24(int runs, int size, boolean dense) {
System.out.println("\n\n");
System.out.println("initializing...");
DoubleMatrix2D A;
DoubleFactory2D factory;
if (dense)
  factory = Factory2D.dense;
else
  factory = Factory2D.sparse;
 
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);
  }
};
cern.colt.Timer timer = new cern.colt.Timer().start();

System.out.println("benchmarking stencil...");
for (int i=0; i<runs; i++) {
  A.zAssign8Neighbors(A,function);
}
//A.zSum4Neighbors(A,alpha,beta,runs);
timer.stop().display();
//System.out.println("A="+A);
A=null;
View Full Code Here

Examples of cern.colt.matrix.DoubleMatrix2D

 
System.out.println("\n\n");
System.out.println("initializing...");
boolean dense = true;
DoubleMatrix2D A;
DoubleFactory2D factory;
if (dense)
  factory = Factory2D.dense;
else
  factory = Factory2D.sparse;
View Full Code Here

Examples of cern.colt.matrix.DoubleMatrix2D

 
System.out.println("\n\n");
System.out.println("initializing...");
boolean dense = true;
DoubleMatrix2D A;
DoubleFactory2D factory;
if (dense)
  factory = Factory2D.dense;
else
  factory = Factory2D.sparse;
View Full Code Here

Examples of cern.colt.matrix.DoubleMatrix2D

for (int i=columns; --i >= 0; ) trainingSet[i][i]=2.0;

int patternIndex        = 0;
int unitIndex           = 0;

DoubleMatrix2D patternMatrix       = null;
DoubleMatrix2D transposeMatrix     = null;
DoubleMatrix2D QMatrix             = null;
DoubleMatrix2D inverseQMatrix      = null;
DoubleMatrix2D pseudoInverseMatrix = null;
DoubleMatrix2D weightMatrix        = null;

// form a matrix with the columns as training vectors
patternMatrix = DoubleFactory2D.dense.make (rows, columns);

// copy the patterns into the matrix
View Full Code Here

Examples of cern.colt.matrix.DoubleMatrix2D

    { 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

Examples of com.opengamma.analytics.math.matrix.DoubleMatrix2D

        Validate.notNull(data, "data");
        final double[][] temp = paramBarSet(func, data);

        //now transpose
        //TODO a transpose that works on double[][]?
        return MA.getTranspose(new DoubleMatrix2D(temp)).getData();
      }
    };
  }
View Full Code Here

Examples of org.apache.mahout.math.matrix.DoubleMatrix2D

    double[] aggregates = new double[aggregatesRaw.length];
    for (int i = 0; i < aggregatesRaw.length; i++) {
      aggregates[i] = Double.longBitsToDouble(aggregatesRaw[i]);
    }

    DoubleMatrix2D VT = new DenseDoubleMatrix2D(convert(new long[][]{
        {4540286548932058396L, 4577864022762482570L, 4577700324701750780L, 4518480992251412349L, 4556435725689022825L,
            4488720014619835766L, 4335660689431780693L, 4502946434618942000L, 4531841594141675072L,
            4445484354574431038L, 4494181495103148132L, 4238500868784003636L, 4410983210480467520L,
            4378527886946299824L, 4535843255558462101L, 4533033844134633147L, 4588065853673790470L,
            4529714837625705005L, 4545016130375436933L, 4534987086323522839L, 4499740291369705403L,
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.