Java Code Examples for cern.colt.matrix.DoubleMatrix2D#equals()

The following examples show how to use cern.colt.matrix.DoubleMatrix2D#equals() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestMatrix2D.java    From database with GNU General Public License v2.0 6 votes vote down vote up
/**
 */
public static void doubleTest34() {
	double[][] data = 
	{ 
		{ 3, 0, 0, 0 },
		{ 0, 4, 2, 0 },
		{ 0, 0, 0, 0 },
		{ 0, 0, 0, 0 },
	};
	
	DoubleMatrix2D A = new DenseDoubleMatrix2D(data);
	Property.DEFAULT.generateNonSingular(A);
	DoubleMatrix2D inv = Algebra.DEFAULT.inverse(A);


	System.out.println("\n\n\n"+A);
	System.out.println("\n"+inv);
	DoubleMatrix2D B = A.zMult(inv,null);
	System.out.println(B);
	if (!(B.equals(DoubleFactory2D.dense.identity(A.rows)))) {
		throw new InternalError();
	}
}
 
Example 2
Source File: TestMatrix2D.java    From jAudioGIT with GNU Lesser General Public License v2.1 6 votes vote down vote up
/**
 */
public static void doubleTest34() {
	double[][] data = 
	{ 
		{ 3, 0, 0, 0 },
		{ 0, 4, 2, 0 },
		{ 0, 0, 0, 0 },
		{ 0, 0, 0, 0 },
	};
	
	DoubleMatrix2D A = new DenseDoubleMatrix2D(data);
	Property.DEFAULT.generateNonSingular(A);
	DoubleMatrix2D inv = Algebra.DEFAULT.inverse(A);


	System.out.println("\n\n\n"+A);
	System.out.println("\n"+inv);
	DoubleMatrix2D B = A.zMult(inv,null);
	System.out.println(B);
	if (!(B.equals(DoubleFactory2D.dense.identity(A.rows)))) {
		throw new InternalError();
	}
}