diff options
author | Gael Guennebaud <g.gael@free.fr> | 2011-08-19 14:18:05 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2011-08-19 14:18:05 +0200 |
commit | 42e2578ef9fcbb62ad6e07933ccf531f6f7cd1b3 (patch) | |
tree | 90cef174284cad35f0d13d4b991db83335554caf /unsupported | |
parent | 5734ee6df42991e59609ffd26aaeb3c7aacd61e2 (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')
-rw-r--r-- | unsupported/Eigen/FFT | 2 | ||||
-rw-r--r-- | unsupported/Eigen/src/BVH/BVAlgorithms.h | 4 | ||||
-rw-r--r-- | unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h | 4 | ||||
-rw-r--r-- | unsupported/test/BVH.cpp | 10 | ||||
-rw-r--r-- | unsupported/test/cg.cpp | 2 | ||||
-rw-r--r-- | unsupported/test/matrix_exponential.cpp | 2 | ||||
-rw-r--r-- | unsupported/test/sparse_extra.cpp | 2 | ||||
-rw-r--r-- | unsupported/test/sparse_ldlt.cpp | 2 | ||||
-rw-r--r-- | unsupported/test/sparse_llt.cpp | 2 | ||||
-rw-r--r-- | unsupported/test/sparse_lu.cpp | 2 |
10 files changed, 16 insertions, 16 deletions
diff --git a/unsupported/Eigen/FFT b/unsupported/Eigen/FFT index 0b2823058..c56bd63d6 100644 --- a/unsupported/Eigen/FFT +++ b/unsupported/Eigen/FFT @@ -331,7 +331,7 @@ class FFT // if the vector is strided, then we need to copy it to a packed temporary Matrix<src_type,1,Dynamic> tmp; if ( resize_input ) { - size_t ncopy = std::min(src.size(),src.size() + resize_input); + size_t ncopy = (std::min)(src.size(),src.size() + resize_input); tmp.setZero(src.size() + resize_input); if ( realfft && HasFlag(HalfSpectrum) ) { // pad at the Nyquist bin diff --git a/unsupported/Eigen/src/BVH/BVAlgorithms.h b/unsupported/Eigen/src/BVH/BVAlgorithms.h index e6fdf4737..d65a97740 100644 --- a/unsupported/Eigen/src/BVH/BVAlgorithms.h +++ b/unsupported/Eigen/src/BVH/BVAlgorithms.h @@ -231,7 +231,7 @@ private: template<typename BVH, typename Minimizer> typename Minimizer::Scalar BVMinimize(const BVH &tree, Minimizer &minimizer) { - return internal::minimize_helper(tree, minimizer, tree.getRootIndex(), std::numeric_limits<typename Minimizer::Scalar>::max()); + return internal::minimize_helper(tree, minimizer, tree.getRootIndex(), (std::numeric_limits<typename Minimizer::Scalar>::max)()); } /** Given two BVH's, runs the query on their cartesian product encapsulated by \a minimizer. @@ -264,7 +264,7 @@ typename Minimizer::Scalar BVMinimize(const BVH1 &tree1, const BVH2 &tree2, Mini ObjIter2 oBegin2 = ObjIter2(), oEnd2 = ObjIter2(), oCur2 = ObjIter2(); std::priority_queue<QueueElement, std::vector<QueueElement>, std::greater<QueueElement> > todo; //smallest is at the top - Scalar minimum = std::numeric_limits<Scalar>::max(); + Scalar minimum = (std::numeric_limits<Scalar>::max)(); todo.push(std::make_pair(Scalar(), std::make_pair(tree1.getRootIndex(), tree2.getRootIndex()))); while(!todo.empty()) { diff --git a/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h b/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h index cedb1d551..50c0ca84e 100644 --- a/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h +++ b/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h @@ -259,7 +259,7 @@ void MatrixExponential<MatrixType>::computeUV(float) pade5(m_M); } else { const float maxnorm = 3.925724783138660f; - m_squarings = max(0, (int)ceil(log2(m_l1norm / maxnorm))); + m_squarings = (max)(0, (int)ceil(log2(m_l1norm / maxnorm))); MatrixType A = m_M / pow(Scalar(2), Scalar(static_cast<RealScalar>(m_squarings))); pade7(A); } @@ -281,7 +281,7 @@ void MatrixExponential<MatrixType>::computeUV(double) pade9(m_M); } else { const double maxnorm = 5.371920351148152; - m_squarings = max(0, (int)ceil(log2(m_l1norm / maxnorm))); + m_squarings = (max)(0, (int)ceil(log2(m_l1norm / maxnorm))); MatrixType A = m_M / pow(Scalar(2), Scalar(m_squarings)); pade13(A); } 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; |