Skip to content

Conversation

@rakki-18
Copy link
Contributor

@rakki-18 rakki-18 commented Oct 7, 2021

Issue

Fixes #207
A precedence error in the binary block of #inject:into was causing Cholesky decomposition to fail for matrices of size more than 3.

Code before

[ sum+ (upperTriangular at: k at: i) * (upperTriangular at: k at: j) ]

where sum + (upperTriangular at: k at: i) was being calculated first

Why did tests pass before

In the tests, the matrix size was 3.
So, the value of sum was always zero, hence the precedence did not matter.

Change introduced

  • Parenthesis has been added to take care of the precedence order
  • New tests with a matrix size of more than 3 have been added

A precedence error in the binary block of #inject:into was causing cholesky decomposition to fail for matrices of size more than 3.
It has been corrected by adding parenthesis in the block.
New tests with matrix size more than 3 has also been added.
@rakki-18
Copy link
Contributor Author

rakki-18 commented Oct 7, 2021

@olekscode Can you please review this when you are free?

Copy link
Member

@olekscode olekscode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!
If the tests pass, we can merge it

@SergeStinckwich SergeStinckwich merged commit aaf2770 into PolyMathOrg:master Oct 18, 2021
@SergeStinckwich SergeStinckwich added this to the v1.0.4 milestone Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cholesky decomposition fails for certain cases

4 participants