mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-30 09:00:37 +08:00
Fix MSVC compilation errors
Disable the definition of `min`/`max` macros by defining `NOMINMAX` and prevent macro substitution in the public interface. Also, quiet floating-point comparisons are defined as template functions by the MSVC STL which causes compilation errors due to ambiguities in resolving the template parameter types. Fixes #668 Fixes #716 Fixes #718 Change-Id: I5fe7832a6a3a7ad0421a2557527528c34b88e9c7
This commit is contained in:
@@ -250,7 +250,7 @@ class TinySolver {
|
||||
const Scalar max_diagonal = 1e32;
|
||||
for (int i = 0; i < lm_diagonal_.rows(); ++i) {
|
||||
lm_diagonal_[i] = std::sqrt(
|
||||
u * std::min(std::max(jtj_(i, i), min_diagonal), max_diagonal));
|
||||
u * (std::min)((std::max)(jtj_(i, i), min_diagonal), max_diagonal));
|
||||
jtj_regularized_(i, i) += lm_diagonal_[i] * lm_diagonal_[i];
|
||||
}
|
||||
|
||||
@@ -306,7 +306,7 @@ class TinySolver {
|
||||
}
|
||||
|
||||
Scalar tmp = Scalar(2 * rho - 1);
|
||||
u = u * std::max(Scalar(1 / 3.), 1 - tmp * tmp * tmp);
|
||||
u = u * (std::max)(Scalar(1 / 3.), Scalar(1) - tmp * tmp * tmp);
|
||||
v = 2;
|
||||
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user