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 ;)
This commit is contained in:
Gael Guennebaud
2011-08-19 14:18:05 +02:00
parent 5734ee6df4
commit 42e2578ef9
29 changed files with 74 additions and 59 deletions

View File

@@ -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()) {

View File

@@ -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);
}