Skip to content

Commit

Permalink
Ensured that norms are actually positive because they are used for pr…
Browse files Browse the repository at this point in the history
…obabilities.
  • Loading branch information
adolfomunoz committed Feb 23, 2024
1 parent 2fdecea commit 608b266
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
namespace viltrum {

struct NormDefault {
float operator()(float v) const { return v; }
double operator()(double v) const { return v; }
float operator()(float v) const { return std::abs(v); }
double operator()(double v) const { return std::abs(v); }
template<typename V>
auto operator()(const V& v, typename std::enable_if_t<std::is_arithmetic_v<typename V::value_type>, int> = 0) const {
auto i = v.begin();
Expand Down

0 comments on commit 608b266

Please sign in to comment.