Open yzobus opened 12 months ago
While this is definitely a bug, I do not necessarily agree that the first result should give -3
, but instead NaN
to indicate that the result is not well-defined.
@yzobus: can you please indicate the version of nalgebra
you're using? Is it the latest one?
@Andlon You are right with your comment. However, I thought maybe this was intended, similar to the methods min_skipnan
or max_skipnan
of the ndarray crate.
I tested this with version "0.32.3" and "0.30"
Both the min()
and max()
methods use simba
crate's SimdPartialOrd
methods, which I believe to be the source of the issue. I created the following: https://github.com/dimforge/simba/issues/51.
There seems to be a bug for the
min()
andmax()
methods ofnalgebra::base::min_max::Matrix
when anf64::NAN
is included in the matrix. Specifically, the entries before theNAN
-entry are discarded when using these functions, which results in a wrong output.For example in this simplified function:
The first
println!
statement prints -2., instead of -3. and the secondprintln!
statement prints out 2. instead of 3.