Skip to content

Commit f615aa3

Browse files
jajoemaasencioh
authored andcommitted
fix: bug with SVD
1 parent 9c67730 commit f615aa3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/decompositions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import SingularValueDecomposition from './dc/svd';
1313
export function inverse(matrix, useSVD = false) {
1414
matrix = WrapperMatrix2D.checkMatrix(matrix);
1515
if (useSVD) {
16-
return SingularValueDecomposition(matrix).inverse();
16+
return new SingularValueDecomposition(matrix).inverse();
1717
} else {
1818
return solve(matrix, Matrix.eye(matrix.rows));
1919
}
@@ -30,7 +30,7 @@ export function solve(leftHandSide, rightHandSide, useSVD = false) {
3030
leftHandSide = WrapperMatrix2D.checkMatrix(leftHandSide);
3131
rightHandSide = WrapperMatrix2D.checkMatrix(rightHandSide);
3232
if (useSVD) {
33-
return SingularValueDecomposition(leftHandSide).solve(rightHandSide);
33+
return new SingularValueDecomposition(leftHandSide).solve(rightHandSide);
3434
} else {
3535
return leftHandSide.isSquare() ? new LuDecomposition(leftHandSide).solve(rightHandSide) : new QrDecomposition(leftHandSide).solve(rightHandSide);
3636
}

0 commit comments

Comments
 (0)