@@ -22,23 +22,23 @@ public function testNonSquare()
2222 {
2323 static ::setExpectedException (MatrixException::class);
2424
25- new LUDecomposition (new Matrix ( [[1 , 2 , 3 ]]) );
25+ new LUDecomposition ([[1 , 2 , 3 ]]);
2626 }
2727
2828 public function testSingularByZeroes ()
2929 {
3030 static ::setExpectedException (MatrixException::class);
3131
32- new LUDecomposition (new Matrix ( [
32+ new LUDecomposition ([
3333 [0 , 0 ],
3434 [0 , 0 ],
35- ])) ;
35+ ]);
3636 }
3737
3838 public function testWrongSizeKnowns ()
3939 {
4040 $ matrix = $ this ->buildMatrix ();
41- $ decomp = new LUDecomposition ($ matrix );
41+ $ decomp = new LUDecomposition ($ matrix-> toArray () );
4242
4343 static ::setExpectedException (MatrixException::class);
4444
@@ -49,18 +49,18 @@ public function testSingularByDiagonal()
4949 {
5050 static ::setExpectedException (MatrixException::class);
5151
52- new LUDecomposition (new Matrix ( [
52+ new LUDecomposition ([
5353 [1 , -1 , 2 ],
5454 [1 , 0 , 1 ],
5555 [2 , 3 , -1 ],
56- ])) ;
56+ ]);
5757 }
5858
5959 public function testLUDecompConstructor ()
6060 {
6161 $ matrix = $ this ->buildMatrix ();
6262
63- $ LU = new LUDecomposition ($ matrix );
63+ $ LU = new LUDecomposition ($ matrix-> toArray () );
6464
6565 $ this ->assertEquals (1 , $ LU ->get (0 , 0 ));
6666 $ this ->assertEquals (-1 , $ LU ->get (0 , 1 ));
@@ -77,7 +77,7 @@ public function testDeterminant()
7777 {
7878 $ matrix = $ this ->buildMatrix ();
7979
80- $ LU = new LUDecomposition ($ matrix );
80+ $ LU = new LUDecomposition ($ matrix-> toArray () );
8181
8282 $ this ->assertEquals (5 , $ LU ->determinant ());
8383 }
@@ -90,7 +90,7 @@ public function testSolve()
9090 [1 , -1 , 4 ],
9191 ]);
9292
93- $ LU = new LUDecomposition ($ matrix );
93+ $ LU = new LUDecomposition ($ matrix-> toArray () );
9494
9595 $ b = [1 , 9 , 8 ];
9696
@@ -107,7 +107,7 @@ public function testSolve()
107107 [-2 , -3 , 4 , 4 ],
108108 ]);
109109
110- $ LU = new LUDecomposition ($ matrix );
110+ $ LU = new LUDecomposition ($ matrix-> toArray () );
111111
112112 $ b = [-1 , 7 , -24 , 3 ];
113113
@@ -125,7 +125,7 @@ public function testInverse()
125125 {
126126 $ matrix = $ this ->buildMatrix ();
127127
128- $ LU = new LUDecomposition ($ matrix );
128+ $ LU = new LUDecomposition ($ matrix-> toArray () );
129129
130130 $ inverse = $ LU ->inverse ();
131131
0 commit comments