Search in sources :

Example 1 with DoubleMatrix2DComparator

use of cern.colt.matrix.doublealgo.DoubleMatrix2DComparator in project tdq-studio-se by Talend.

the class TestMatrix2D method doubleTest26.

/**
 */
public static void doubleTest26(int size) {
    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;
    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) {
            return a.zSum() == b.zSum() ? 1 : 0;
        }
    };
    System.out.println(A);
    System.out.println(Algebra.ZERO.inverse(A));
    timer.stop().display();
    System.out.println("done.");
}
Also used : DoubleMatrix2D(cern.colt.matrix.DoubleMatrix2D) DoubleMatrix2DComparator(cern.colt.matrix.doublealgo.DoubleMatrix2DComparator) DoubleFactory2D(cern.colt.matrix.DoubleFactory2D)

Aggregations

DoubleFactory2D (cern.colt.matrix.DoubleFactory2D)1 DoubleMatrix2D (cern.colt.matrix.DoubleMatrix2D)1 DoubleMatrix2DComparator (cern.colt.matrix.doublealgo.DoubleMatrix2DComparator)1