Skip to content

Commit 51a2aff

Browse files
committed
Formatted the tests
1 parent ff24a2e commit 51a2aff

File tree

1 file changed

+32
-31
lines changed

1 file changed

+32
-31
lines changed

src/Math-Tests-Numerical/PMLeastSquaresTest.class.st

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ Class {
1212

1313
{ #category : #running }
1414
PMLeastSquaresTest >> setUp [
15+
1516
super setUp.
16-
leastSquares := PMLeastSquares new.
17+
leastSquares := PMLeastSquares new
1718
]
1819

1920
{ #category : #tests }
@@ -22,16 +23,16 @@ PMLeastSquaresTest >> testPseudoinverseOfDiagonalSquareMatrix [
2223
| matrix expectedInverse inverse |
2324

2425
matrix := PMMatrix rows: #(
25-
(2 0 0 0)
26-
(0 1 0 0)
27-
(0 0 -3 0)
28-
(0 0 0 -1)).
26+
(2 0 0 0)
27+
(0 1 0 0)
28+
(0 0 -3 0)
29+
(0 0 0 -1) ).
2930

3031
expectedInverse := PMMatrix rows: {
31-
{ 1/2 . 0 . 0 . 0 } .
32-
{ 0 . 1 . 0 . 0 } .
33-
{0 . 0 . -1/3 . 0} .
34-
{0 . 0 . 0 . -1 }}.
32+
{ 1/2 . 0 . 0 . 0 } .
33+
{ 0 . 1 . 0 . 0 } .
34+
{ 0 . 0 . -1/3 . 0} .
35+
{ 0 . 0 . 0 . -1 } }.
3536

3637
inverse := leastSquares pseudoinverseOfDiagonal: matrix.
3738
self assert: inverse closeTo: expectedInverse.
@@ -46,13 +47,13 @@ PMLeastSquaresTest >> testPseudoinverseOfDiagonalSquareMatrixWithZeros [
4647
(2 0 0 0)
4748
(0 1 0 0)
4849
(0 0 0 0)
49-
(0 0 0 0)).
50+
(0 0 0 0) ).
5051

5152
expectedInverse := PMMatrix rows: #(
52-
(0.5 0 0 0)
53-
(0 1 0 0)
54-
(0 0 0 0)
55-
(0 0 0 0)).
53+
(0.5 0 0 0)
54+
( 0 1 0 0)
55+
( 0 0 0 0)
56+
( 0 0 0 0) ).
5657

5758
inverse := leastSquares pseudoinverseOfDiagonal: matrix.
5859
self assert: inverse closeTo: expectedInverse.
@@ -64,18 +65,18 @@ PMLeastSquaresTest >> testPseudoinverseOfDiagonalTallMatrix [
6465
| matrix expectedInverse inverse |
6566

6667
matrix := PMMatrix rows: #(
67-
(2 0 0 0)
68-
(0 1 0 0)
69-
(0 0 -3 0)
70-
(0 0 0 -1)
71-
(0 0 0 0)
72-
(0 0 0 0)).
68+
(2 0 0 0)
69+
(0 1 0 0)
70+
(0 0 -3 0)
71+
(0 0 0 -1)
72+
(0 0 0 0)
73+
(0 0 0 0) ).
7374

7475
expectedInverse := PMMatrix rows: {
75-
{ 1/2 . 0 . 0 . 0 . 0 . 0 } .
76-
{ 0 . 1 . 0 . 0 . 0 . 0 } .
77-
{0 . 0 . -1/3 . 0 . 0 . 0 } .
78-
{0 . 0 . 0 . -1 . 0 . 0 }}.
76+
{ 1/2 . 0 . 0 . 0 . 0 . 0 } .
77+
{ 0 . 1 . 0 . 0 . 0 . 0 } .
78+
{ 0 . 0 . -1/3 . 0 . 0 . 0 } .
79+
{ 0 . 0 . 0 . -1 . 0 . 0 }}.
7980

8081
inverse := leastSquares pseudoinverseOfDiagonal: matrix.
8182
self assert: inverse closeTo: expectedInverse.
@@ -87,10 +88,10 @@ PMLeastSquaresTest >> testPseudoinverseOfDiagonalWideMatrix [
8788
| matrix expectedInverse inverse |
8889

8990
matrix := PMMatrix rows: #(
90-
(2 0 0 0 0 0)
91-
(0 1 0 0 0 0)
92-
(0 0 -3 0 0 0)
93-
(0 0 0 -1 0 0)).
91+
(2 0 0 0 0 0)
92+
(0 1 0 0 0 0)
93+
(0 0 -3 0 0 0)
94+
(0 0 0 -1 0 0)).
9495

9596
expectedInverse := PMMatrix rows: {
9697
{ 1/2 . 0 . 0 . 0 } .
@@ -110,9 +111,9 @@ PMLeastSquaresTest >> testSolveSmallOneSolution [
110111
| matrixA vectorB expectedSolution solution |
111112

112113
matrixA := PMMatrix rows: #(
113-
(0 1.1)
114-
(1 0)
115-
(0 -0.2)).
114+
(0 1.1)
115+
(1 0 )
116+
(0 -0.2) ).
116117

117118
vectorB := #(1.1 -1.1 -0.2) asPMVector.
118119
expectedSolution := #(-1.1 1) asPMVector.

0 commit comments

Comments
 (0)