Skip to content

Commit

Permalink
Only some versions of MSVC are standard compliant
Browse files Browse the repository at this point in the history
Fixes #98
  • Loading branch information
ddemidov committed Dec 17, 2018
1 parent 91348b0 commit 2c80b9d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion amgcl/detail/qr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,8 @@ class QR {

if (math::is_zero(xnorm2)) return tau;

scalar_type beta = -std::copysign(sqrt(sqr(math::norm(alpha)) + xnorm2), amgcl::detail::real(alpha));
scalar_type beta = -std::abs(sqrt(sqr(math::norm(alpha)) + xnorm2));
if (amgcl::detail::real(alpha) < 0) beta = -beta;

tau = math::identity<value_type>() - math::inverse(beta) * alpha;
alpha = math::inverse(alpha - beta * math::identity<value_type>());
Expand Down

0 comments on commit 2c80b9d

Please sign in to comment.