You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After issue #358, SVD was improved so that it does no longer panic but instead returns a Result. However, since then the public function sort_by_singular_values() was added to svd.rs which still panics when the singular values are NaN: expect("Singular value was NaN"). This function is used twice in svd.rs: by new() and try_new(), and once in tests/linalg/svd.rs.
This panic is making it more difficult to use nalgebra SVD in "production" code.
I can think of two possible solutions:
Let sort_by_singular_values() return a boolean whether the sorting was successful or not, so that the callers of this function can return a Result if needed . However, since this function is public, this would imply a breaking change.
In try_new_unordered(), right after the SVD decomposition, explicitly verify that none of singular values are NaN so that the sorting never leads to a panic.
The text was updated successfully, but these errors were encountered:
After issue #358, SVD was improved so that it does no longer panic but instead returns a
Result
. However, since then the public functionsort_by_singular_values()
was added tosvd.rs
which still panics when the singular values are NaN:expect("Singular value was NaN")
. This function is used twice insvd.rs
: bynew()
andtry_new()
, and once intests/linalg/svd.rs
.This panic is making it more difficult to use nalgebra SVD in "production" code.
I can think of two possible solutions:
sort_by_singular_values()
return a boolean whether the sorting was successful or not, so that the callers of this function can return aResult
if needed . However, since this function is public, this would imply a breaking change.try_new_unordered()
, right after the SVD decomposition, explicitly verify that none of singular values are NaN so that the sorting never leads to a panic.The text was updated successfully, but these errors were encountered: