Skip to content

Commit 9a59840

Browse files
committed
Generalize determinant test.
Changed the determinant test to check that the condition hold for any random matrix (and not jus the sample matrix used initially).
1 parent 1e5d3da commit 9a59840

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/gov/nasa/worldwind/geom/MatrixTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,12 @@ public void testInverseOfNearSingular()
140140
@Test
141141
public void testDeterminantEqualToDeterminantOfTranspose()
142142
{
143-
// Create sample matrix.
143+
// Create random matrix.
144144
Matrix matrix = new Matrix(
145-
1, 0, 0, 1,
146-
1, 1, 0, 0,
147-
0, 0, 1, 0,
148-
0, 0, 0, 1);
145+
random.nextDouble(), random.nextDouble(), random.nextDouble(), random.nextDouble(),
146+
random.nextDouble(), random.nextDouble(), random.nextDouble(), random.nextDouble(),
147+
random.nextDouble(), random.nextDouble(), random.nextDouble(), random.nextDouble(),
148+
random.nextDouble(), random.nextDouble(), random.nextDouble(), random.nextDouble());
149149

150150
// Calculate the determinant.
151151
double determinant = matrix.getDeterminant();

0 commit comments

Comments
 (0)