flyspray/FS#1147: Compute norm of vectors with NaN entries properly
This is an attempt to solve the issue outlined in flyspray/FS#1147 (closed). I've yet to fix DenseMatrix::infinity_norm
the same way.
Merge request reports
Activity
Title changed from [WIP] flyspray/FS#1147 (closed): Computer norm of vectors with NaN entries properly to [WIP] flyspray/FS#1147 (closed): Compute norm of vectors with NaN entries properly
Added 34 commits:
-
fff2581e...627fc0b0 - 31 commits from branch
core:master
- f28ab282 - Clean up NaN norm test
- 2535cbc1 - Extend NaN vector test
- b3a810e3 - Fix vector norm computation with NaN values
Toggle commit list-
fff2581e...627fc0b0 - 31 commits from branch
Now that !11 (merged) has been merged, I've rebased and force-pushed the branch(*), so that only the three relevant commits remain.
(*) I felt at liberty to do so because nobody had replied here yet, but I'm not sure I'll do it again because the message above (@pipping added 34 commits) is so misleading
Also I'd suggest to introduce our own trait
Dune::has_nan<T>::value
, because it allows to specialize the trait for other types, if they have nan. The default can just forward tostd::is_floating_point
.Edited by Christian EngwerAdded 1 commit:
- f965455b - Introduce has_nan and use SFINAE
@christi That's a great idea. I lack experience with traits and it took me a bit to piece it together this way but now I've got what I believe is what you must've had in mind. The
has_nan
struct is certainly not in the right place yet. Should I move it to typetraits.hh?@pipping: IMHO SFINAE is much more readable this way:
template<class T, typename std::enable_if<condition, int>::type =0> ...
but that's just a matter of taste. The traits should definitively go to typetraits.hh. Furthermore I very much like the fancy new traits pattern to derive from
integral_constant<bool, result>
.Added 1 commit:
- b2edc8fe - Move has_nan and infinity_norm from fvmeta
@carsten.graeser
integral_constant
is nice indeed. I've used it now.Edited by Elias PippingTitle changed from [WIP] flyspray/FS#1147 (closed): Compute norm of vectors with NaN entries properly to flyspray/FS#1147 (closed): Compute norm of vectors with NaN entries properly
Added 1 commit:
- 9983691c - Undo inadvertent whitespace changes
@pipping PS: thanks for all your effort on this topic.
Added 1 commit:
- 8520c610 - Do not use auto&& in loops
@christi Likewise! Thanks a lot for doing the benchmark and all the helpful comments :)