#1147 Norm of NaN-matrix

Metadata

Property Value
Reported by Elias Pipping (elias.pipping@fu-berlin.de)
Reported at Jul 6, 2012 09:42
Type Bug Report
Version Git (pre2.4) [autotools]
Operating System Unspecified / All
Last edited by Elias Pipping (elias.pipping@fu-berlin.de)
Last edited at Oct 20, 2012 12:05

Description

Apparently, the code snippet

double mynan = 0.0/0.0; double ret = std::max(0.0, mynan);

is equivalent to

double ret = 0.0.

Now take a FieldMatrix A filled with NaNs and call A.infinity_norm(). That method will loop over A's rows, and for each row r, compare the current maximum (initialised as 0) to r.one_norm(). Since r.one_norm() is NaN for all rows, it will first take std::max(0.0, NaN), which -- as stated above -- is 0.0, then proceed in this manner and eventually return 0.0.

So the inf-Norm of a matrix, which consists solely of NaNs is zero. Is that expected and desirable?