DenseMatrix implements Serializable { public double det() { assert (this.isSquare()); return BreezeUtils.det(this); } DenseMatrix();  DenseMatrix(int m, int n);  DenseMatrix(int m, int n, double[] data);  DenseMatrix(int m, int n, double[] data, boolean inRowMajor);  DenseMatrix(double[][] data); static DenseMatrix eye(int n); static DenseMatrix eye(int m, int n); static DenseMatrix zeros(int m, int n); static DenseMatrix ones(int m, int n); static DenseMatrix rand(int m, int n); static DenseMatrix randSymmetric(int n); double get(int i, int j); double[] getData(); double[][] getArrayCopy2D(); double[] getArrayCopy1D(boolean inRowMajor); double[] getRow(int row); double[] getColumn(int col); @Override DenseMatrix clone(); @Override boolean equals(Object o); DenseMatrix selectRows(int[] rows); DenseMatrix getSubMatrix(int m0, int m1, int n0, int n1); void setSubMatrix(DenseMatrix sub, int m0, int m1, int n0, int n1); void set(int i, int j, double s); void add(int i, int j, double s); boolean isSquare(); boolean isSymmetric(); int numRows(); int numCols(); double sum(); DenseMatrix scale(double v); void scaleEqual(double v); DenseMatrix plus(DenseMatrix mat); DenseMatrix plus(double alpha); void plusEquals(DenseMatrix mat); void plusEquals(double alpha); DenseMatrix minus(DenseMatrix mat); void minusEquals(DenseMatrix mat); DenseMatrix multiplies(DenseMatrix mat); DenseVector multiplies(DenseVector x); DenseVector multiplies(SparseVector x); DenseMatrix transpose(); @Override String toString(); double norm2(); double cond(); double det(); int rank(); DenseMatrix solve(DenseMatrix matB); DenseVector solve(DenseVector b); DenseMatrix solveLS(DenseMatrix matB); DenseVector solveLS(DenseVector b); DenseMatrix inverse();  }
@Test public void testDet() throws Exception { double[][] data1 = { {-2, 2, -3}, {-1, 1, 3}, {2, 0, -1}, }; DenseMatrix matA = new DenseMatrix(data1); Assert.assertEquals(matA.det(), 18.0, TOL); }