diff --git a/src/madness/tensor/tensor.h b/src/madness/tensor/tensor.h index f160e097c17..73b3967ddba 100644 --- a/src/madness/tensor/tensor.h +++ b/src/madness/tensor/tensor.h @@ -257,11 +257,11 @@ namespace madness { } namespace detail { - template T mynorm(T t) { - return t*t; + template double mynorm(T t) { + return double(t)*t; } - template T mynorm(std::complex t) { + template double mynorm(std::complex t) { return std::norm(t); } } diff --git a/src/madness/tensor/test_tensor.cc b/src/madness/tensor/test_tensor.cc index 59790ab7e70..3c6a70552a7 100644 --- a/src/madness/tensor/test_tensor.cc +++ b/src/madness/tensor/test_tensor.cc @@ -53,13 +53,13 @@ namespace { return ((double) x)*x; } -// template <> double mynorm(float_complex x) { -// return (double) std::norm(x); -// } -// -// template <> double mynorm(double_complex x) { -// return (double) std::norm(x); -// } + template <> double mynorm(float_complex x) { + return (double) std::norm(x); + } + + template <> double mynorm(double_complex x) { + return (double) std::norm(x); + } template inline