aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/test
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2011-08-19 14:18:05 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2011-08-19 14:18:05 +0200
commit42e2578ef9fcbb62ad6e07933ccf531f6f7cd1b3 (patch)
tree90cef174284cad35f0d13d4b991db83335554caf /unsupported/test
parent5734ee6df42991e59609ffd26aaeb3c7aacd61e2 (diff)
the min/max macros to detect unprotected min/max were undefined by some std header,
so let's declare them after and do the respective fixes ;)
Diffstat (limited to 'unsupported/test')
-rw-r--r--unsupported/test/BVH.cpp10
-rw-r--r--unsupported/test/cg.cpp2
-rw-r--r--unsupported/test/matrix_exponential.cpp2
-rw-r--r--unsupported/test/sparse_extra.cpp2
-rw-r--r--unsupported/test/sparse_ldlt.cpp2
-rw-r--r--unsupported/test/sparse_llt.cpp2
-rw-r--r--unsupported/test/sparse_lu.cpp2
7 files changed, 11 insertions, 11 deletions
diff --git a/unsupported/test/BVH.cpp b/unsupported/test/BVH.cpp
index d773afb77..e77e84b6d 100644
--- a/unsupported/test/BVH.cpp
+++ b/unsupported/test/BVH.cpp
@@ -90,13 +90,13 @@ struct BallPointStuff //this class provides functions to be both an intersector
}
double minimumOnVolume(const BoxType &r) { ++calls; return r.squaredExteriorDistance(p); }
- double minimumOnObject(const BallType &b) { ++calls; return std::max(0., (b.center - p).squaredNorm() - SQR(b.radius)); }
+ double minimumOnObject(const BallType &b) { ++calls; return (std::max)(0., (b.center - p).squaredNorm() - SQR(b.radius)); }
double minimumOnVolumeVolume(const BoxType &r1, const BoxType &r2) { ++calls; return r1.squaredExteriorDistance(r2); }
- double minimumOnVolumeObject(const BoxType &r, const BallType &b) { ++calls; return SQR(std::max(0., r.exteriorDistance(b.center) - b.radius)); }
- double minimumOnObjectVolume(const BallType &b, const BoxType &r) { ++calls; return SQR(std::max(0., r.exteriorDistance(b.center) - b.radius)); }
- double minimumOnObjectObject(const BallType &b1, const BallType &b2){ ++calls; return SQR(std::max(0., (b1.center - b2.center).norm() - b1.radius - b2.radius)); }
+ double minimumOnVolumeObject(const BoxType &r, const BallType &b) { ++calls; return SQR((std::max)(0., r.exteriorDistance(b.center) - b.radius)); }
+ double minimumOnObjectVolume(const BallType &b, const BoxType &r) { ++calls; return SQR((std::max)(0., r.exteriorDistance(b.center) - b.radius)); }
+ double minimumOnObjectObject(const BallType &b1, const BallType &b2){ ++calls; return SQR((std::max)(0., (b1.center - b2.center).norm() - b1.radius - b2.radius)); }
double minimumOnVolumeObject(const BoxType &r, const VectorType &v) { ++calls; return r.squaredExteriorDistance(v); }
- double minimumOnObjectObject(const BallType &b, const VectorType &v){ ++calls; return SQR(std::max(0., (b.center - v).norm() - b.radius)); }
+ double minimumOnObjectObject(const BallType &b, const VectorType &v){ ++calls; return SQR((std::max)(0., (b.center - v).norm() - b.radius)); }
VectorType p;
int calls;
diff --git a/unsupported/test/cg.cpp b/unsupported/test/cg.cpp
index a9ac81960..ba14275d3 100644
--- a/unsupported/test/cg.cpp
+++ b/unsupported/test/cg.cpp
@@ -27,7 +27,7 @@
template<typename Scalar,typename Index> void cg(int size)
{
- double density = std::max(8./(size*size), 0.01);
+ double density = (std::max)(8./(size*size), 0.01);
typedef Matrix<Scalar,Dynamic,Dynamic> DenseMatrix;
typedef Matrix<Scalar,Dynamic,1> DenseVector;
typedef SparseMatrix<Scalar,ColMajor,Index> SparseMatrixType;
diff --git a/unsupported/test/matrix_exponential.cpp b/unsupported/test/matrix_exponential.cpp
index 5ea438c2a..996b42a7f 100644
--- a/unsupported/test/matrix_exponential.cpp
+++ b/unsupported/test/matrix_exponential.cpp
@@ -36,7 +36,7 @@ double binom(int n, int k)
template <typename Derived, typename OtherDerived>
double relerr(const MatrixBase<Derived>& A, const MatrixBase<OtherDerived>& B)
{
- return std::sqrt((A - B).cwiseAbs2().sum() / std::min(A.cwiseAbs2().sum(), B.cwiseAbs2().sum()));
+ return std::sqrt((A - B).cwiseAbs2().sum() / (std::min)(A.cwiseAbs2().sum(), B.cwiseAbs2().sum()));
}
template <typename T>
diff --git a/unsupported/test/sparse_extra.cpp b/unsupported/test/sparse_extra.cpp
index a004995f6..b1fd481e8 100644
--- a/unsupported/test/sparse_extra.cpp
+++ b/unsupported/test/sparse_extra.cpp
@@ -67,7 +67,7 @@ template<typename SparseMatrixType> void sparse_extra(const SparseMatrixType& re
typedef typename SparseMatrixType::Scalar Scalar;
enum { Flags = SparseMatrixType::Flags };
- double density = std::max(8./(rows*cols), 0.01);
+ double density = (std::max)(8./(rows*cols), 0.01);
typedef Matrix<Scalar,Dynamic,Dynamic> DenseMatrix;
typedef Matrix<Scalar,Dynamic,1> DenseVector;
Scalar eps = 1e-6;
diff --git a/unsupported/test/sparse_ldlt.cpp b/unsupported/test/sparse_ldlt.cpp
index 43ff2682f..c387f78ac 100644
--- a/unsupported/test/sparse_ldlt.cpp
+++ b/unsupported/test/sparse_ldlt.cpp
@@ -33,7 +33,7 @@ template<typename Scalar,typename Index> void sparse_ldlt(int rows, int cols)
{
static bool odd = true;
odd = !odd;
- double density = std::max(8./(rows*cols), 0.01);
+ double density = (std::max)(8./(rows*cols), 0.01);
typedef Matrix<Scalar,Dynamic,Dynamic> DenseMatrix;
typedef Matrix<Scalar,Dynamic,1> DenseVector;
typedef SparseMatrix<Scalar,ColMajor,Index> SparseMatrixType;
diff --git a/unsupported/test/sparse_llt.cpp b/unsupported/test/sparse_llt.cpp
index a997deb82..1b3b3bb9b 100644
--- a/unsupported/test/sparse_llt.cpp
+++ b/unsupported/test/sparse_llt.cpp
@@ -31,7 +31,7 @@
template<typename Scalar,typename Index> void sparse_llt(int rows, int cols)
{
- double density = std::max(8./(rows*cols), 0.01);
+ double density = (std::max)(8./(rows*cols), 0.01);
typedef Matrix<Scalar,Dynamic,Dynamic> DenseMatrix;
typedef Matrix<Scalar,Dynamic,1> DenseVector;
typedef SparseMatrix<Scalar,ColMajor,Index> SparseMatrixType;
diff --git a/unsupported/test/sparse_lu.cpp b/unsupported/test/sparse_lu.cpp
index bb0dccdb5..8c115eebf 100644
--- a/unsupported/test/sparse_lu.cpp
+++ b/unsupported/test/sparse_lu.cpp
@@ -35,7 +35,7 @@
template<typename Scalar> void sparse_lu(int rows, int cols)
{
- double density = std::max(8./(rows*cols), 0.01);
+ double density = (std::max)(8./(rows*cols), 0.01);
typedef Matrix<Scalar,Dynamic,Dynamic> DenseMatrix;
typedef Matrix<Scalar,Dynamic,1> DenseVector;