|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r80600 - trunk/libs/numeric/ublas/test
From: guwi17_at_[hidden]
Date: 2012-09-19 15:25:51
Author: guwi17
Date: 2012-09-19 15:25:51 EDT (Wed, 19 Sep 2012)
New Revision: 80600
URL: http://svn.boost.org/trac/boost/changeset/80600
Log:
* libs/numeric/ublas/test/utils.hpp: use 'using ::std' instead of full qualified names because MSVC complains, reopen #7296
Text files modified:
trunk/libs/numeric/ublas/test/utils.hpp | 27 +++++++++++++++++----------
1 files changed, 17 insertions(+), 10 deletions(-)
Modified: trunk/libs/numeric/ublas/test/utils.hpp
==============================================================================
--- trunk/libs/numeric/ublas/test/utils.hpp (original)
+++ trunk/libs/numeric/ublas/test/utils.hpp 2012-09-19 15:25:51 EDT (Wed, 19 Sep 2012)
@@ -66,10 +66,11 @@
/// Check if the given complex number is a NaN.
template <typename T>
BOOST_UBLAS_INLINE
-bool isnan(::std::complex<T> const& z)
+bool complex_isnan(::std::complex<T> const& z)
{
+ using namespace ::std;
// According to IEEE, NaN is different even by itself
- return (z != z) || ::std::isnan(z.real()) || ::std::isnan(z.imag());
+ return (z != z) || isnan(z.real()) || isnan(z.imag());
}
/// Check if two (real) numbers are close each other (wrt a given tolerance).
@@ -80,12 +81,13 @@
typedef typename promote_traits<typename promote_traits<T1,T2>::promote_type,
T3>::promote_type real_type;
- if (::std::isnan(x) || ::std::isnan(y))
+ using namespace ::std;
+ if (isnan(x) || isnan(y))
{
// According to IEEE, NaN is different even by itself
return false;
}
- return ::std::abs(x-y) <= (::std::max(static_cast<real_type>(::std::abs(x)), static_cast<real_type>(::std::abs(y)))*tol);
+ return abs(x-y) <= (max(static_cast<real_type>(abs(x)), static_cast<real_type>(abs(y)))*tol);
}
/// Check if two complex numbers are close each other (wrt a given tolerance).
@@ -96,14 +98,16 @@
typedef typename promote_traits<typename promote_traits<T1,T2>::promote_type,
T3>::promote_type real_type;
- if (isnan(x) || isnan(y))
+ if (complex_isnan(x) || complex_isnan(y))
{
// According to IEEE, NaN is different even by itself
return false;
}
::std::complex<real_type> xx(x);
::std::complex<real_type> yy(y);
- return ::std::abs(xx-yy) <= (::std::max(::std::abs(xx), ::std::abs(yy))*tol);
+
+ using namespace ::std;
+ return abs(xx-yy) <= (max(abs(xx), abs(yy))*tol);
}
/// Check if two (real) numbers are close each other (wrt a given tolerance).
@@ -114,12 +118,13 @@
typedef typename promote_traits<typename promote_traits<T1,T2>::promote_type,
T3>::promote_type real_type;
- if (::std::isnan(x) || ::std::isnan(y))
+ using namespace ::std;
+ if (isnan(x) || isnan(y))
{
// According to IEEE, NaN is different even by itself
return false;
}
- return ::std::abs(x-y)/::std::abs(y) <= tol;
+ return abs(x-y)/abs(y) <= tol;
}
/// Check if two complex numbers are close each other (wrt a given tolerance).
@@ -130,14 +135,16 @@
typedef typename promote_traits<typename promote_traits<T1,T2>::promote_type,
T3>::promote_type real_type;
- if (isnan(x) || isnan(y))
+ if (complex_isnan(x) || complex_isnan(y))
{
// According to IEEE, NaN is different even by itself
return false;
}
::std::complex<real_type> xx(x);
::std::complex<real_type> yy(y);
- return ::std::abs(xx-yy)/::std::abs(yy) <= tol;
+
+ using namespace ::std;
+ return abs(xx-yy)/abs(yy) <= tol;
}
}}}}}} // Namespace boost::numeric::ublas::test::detail::<unnamed>
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk