We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
From the source code, we can see that implemented method to calculate the determinant for dimension n>2 is
for (col = 0; col < numCol; col++) { diagLeft = m[0][col]; diagRight = m[0][col]; for (row = 1; row < numRow; row++) { diagRight *= m[row][(((col + row) % numCol) + numCol) % numCol]; diagLeft *= m[row][(((col - row) % numCol) + numCol) % numCol]; } det += diagRight - diagLeft; }
It is pretty clear that this code represents Leibniz formula for a 3x3 matrix (according to wikipedia).
So it means that this piece of code cannot compute determinant of matrix n > 3.
For exemple:
let m4x4 = [[2,3,4,6],[1,3,-2,4],[5,2,1,3],[1,5,2,-3]]; numbers.matrix.determinant(m4x4) // expected 825, gives 534 let m5x5 = [[2,2,3,4,6],[1,3,3,-2,4],[5,4,2,1,3],[1,4,2,0,3],[9,4,8,9,10]]; numbers.matrix.determinant(m5x5); // expected 793, gives 2187
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
From the source code, we can see that implemented method to calculate the determinant for dimension n>2 is
It is pretty clear that this code represents Leibniz formula for a 3x3 matrix (according to wikipedia).
So it means that this piece of code cannot compute determinant of matrix n > 3.
For exemple:
The text was updated successfully, but these errors were encountered: