diff options
Diffstat (limited to 'src/jtutil/norm.cc')
-rw-r--r-- | src/jtutil/norm.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/jtutil/norm.cc b/src/jtutil/norm.cc index 1e6c1b5..bce9ee2 100644 --- a/src/jtutil/norm.cc +++ b/src/jtutil/norm.cc @@ -5,8 +5,7 @@ // *** class jtutil::norm:: // -#include <cmath> -#include <algorithm> +#include <math.h> #include <assert.h> #include "util.hh" @@ -22,7 +21,7 @@ template <typename fp> ++N_; sum_ += x; sum2_ += x*x; -infinity_norm_ = std::max(infinity_norm_, jtutil::abs<fp>(x)); +infinity_norm_ = jtutil::max(infinity_norm_, jtutil::abs<fp>(x)); } } // namespace jtutil:: @@ -34,10 +33,10 @@ namespace jtutil template<typename fp> fp norm<fp>::mean() const { return sum_/fp(N_); } template<typename fp> - fp norm<fp>::two_norm() const { return std::sqrt(sum2_); } + fp norm<fp>::two_norm() const { return sqrt(sum2_); } template<typename fp> fp norm<fp>::rms_norm() const - { assert(is_nonempty()); return std::sqrt(sum2_/fp(N_)); } + { assert(is_nonempty()); return sqrt(sum2_/fp(N_)); } template<typename fp> fp norm<fp>::infinity_norm() const { return infinity_norm_; } } // namespace jtutil:: |