Closed translunar closed 7 years ago
Thanks for reporting this issue. Can you provide a test case that I can use to debug?
Yes, I think so. Upon further examination, looks like it's happening with rank deficient matrices. Try this one:
{{267.21359999999999, -267.21359999999999, -230.9624}, {-4383.1704, 4383.1704, -4383.1704}, {0, 0, 0}}
I also notice you have some divisions by 2 instead of 2.0, which will cause truncation (separate issue).
I don't believe dividing a float or double by an integer will cause truncation.
30759297f670fcdec61b3404b8b6e8f762a6a979 fixes this issue.
@dmalhotra Huh, wow. You're totally right! I've been believing something that was totally wrong for the greater part of fifteen years.
I'm not sure how to fix it, but your SVD algorithm isn't incrementing k0 in some cases — it then enters an infinite loop.
First found it here: http://stackoverflow.com/questions/3856072/single-value-decomposition-implementation-c/25291714#25291714