Skip to content

Commit fb38f57

Browse files
committed
Fixed the failing tests
1 parent cbd6279 commit fb38f57

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Math-Matrix/PMMatrix.class.st

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,15 +350,15 @@ PMMatrix >> choleskyDecomposition [
350350
1 to: i do: [ :j |
351351
i = j
352352
ifTrue: [
353-
rowSum := (1 to: j - 1) sum: [ :k |
354-
(upperTriangular at: k at: j) squared ].
353+
rowSum := (1 to: j - 1) inject: 0 into: [ :sum :k |
354+
sum + (upperTriangular at: k at: j) squared ].
355355

356356
diagonalValue := ((self at: j at: j) - rowSum) sqrt.
357357

358358
upperTriangular at: j at: j put: diagonalValue ]
359359
ifFalse: [
360-
partialSum := (1 to: j - 1) sum: [ :k |
361-
(upperTriangular at: k at: i) * (upperTriangular at: k at: j) ].
360+
partialSum := (1 to: j - 1) inject: 0 into: [ :sum :k |
361+
sum + (upperTriangular at: k at: i) * (upperTriangular at: k at: j) ].
362362

363363
factor := upperTriangular at: j at: j.
364364
nonDiagonalValue := ((self at: j at: i) - partialSum) / factor.

0 commit comments

Comments
 (0)