Skip to content

Commit

Permalink
Fixes #69
Browse files Browse the repository at this point in the history
  • Loading branch information
hisohito committed Jul 23, 2013
1 parent 4518f8a commit 4f30b75
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/la4j/linear/GaussianSolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private Matrix createExtendTriangleMatrix(Matrix matrix) {

private Vector retraceGaus(Matrix matrix, Factory factory) {

if (Math.abs(matrix.product()) < Matrices.EPS) {
if (Math.abs(matrix.diagonalProduct()) < Matrices.EPS) {
throw new IllegalArgumentException("This system hasn't solution.");
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/la4j/matrix/AbstractMatrix.java
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public double determinant() {
get(0, 0) * get(1, 2) * get(2, 1);
}

return decompose(Matrices.CROUT_DECOMPOSITOR)[0].product();
return decompose(Matrices.CROUT_DECOMPOSITOR)[0].diagonalProduct();
}

@Override
Expand Down Expand Up @@ -544,7 +544,7 @@ public double trace() {
}

@Override
public double product() {
public double diagonalProduct() {

double result = 1;

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/la4j/matrix/AbstractSafeMatrix.java
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ public double trace() {
}

@Override
public double product() {
return self.product();
public double diagonalProduct() {
return self.diagonalProduct();
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/la4j/matrix/Matrix.java
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ public interface Matrix extends Externalizable {
*
* @return the product of diagonal elements of this matrix
*/
double product();
double diagonalProduct();

/**
* Returns the "determinant" of this matrix.
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/la4j/matrix/AbstractMatrixTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ public void testProduct_3x3() {
{ 0.0, 0.0, 9.0 }
});

assertTrue(Math.abs(a.product() - 45.0) < Matrices.EPS);
assertTrue(Math.abs(a.diagonalProduct() - 45.0) < Matrices.EPS);
}

public void testDeterminant_3x3() {
Expand Down

0 comments on commit 4f30b75

Please sign in to comment.