aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Schlosser <cs.schlosser@gmail.com>2024-04-22 18:14:20 +0000
committerRasmus Munk Larsen <rmlarsen@google.com>2024-04-22 18:14:20 +0000
commit4de870b6ebeaff3dd15dd7a68ae38c29b248282b (patch)
treef159d64aa9e72cda44273f57eaf69c30e435467e
parent2265242aa121742dd7e80a0167228b43e95bec62 (diff)
downloadeigen-4de870b6ebeaff3dd15dd7a68ae38c29b248282b.tar.gz
fix autodiff enum comparison warnings
-rw-r--r--unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h9
1 files changed, 2 insertions, 7 deletions
diff --git a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h
index c6ffa0d5d..74f2e6f66 100644
--- a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h
+++ b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h
@@ -22,13 +22,8 @@ struct auto_diff_special_op;
template <typename DerivativeType, typename OtherDerivativeType, typename EnableIf = void>
struct maybe_coherent_pad_helper {
- static constexpr int SizeAtCompileTime = DerivativeType::SizeAtCompileTime == Dynamic ||
- OtherDerivativeType::SizeAtCompileTime == Dynamic
- ? Dynamic
- : int(DerivativeType::SizeAtCompileTime) >
- int(OtherDerivativeType::SizeAtCompileTime)
- ? DerivativeType::SizeAtCompileTime
- : OtherDerivativeType::SizeAtCompileTime;
+ static constexpr int SizeAtCompileTime =
+ max_size_prefer_dynamic(DerivativeType::SizeAtCompileTime, OtherDerivativeType::SizeAtCompileTime);
using type = CoherentPadOp<DerivativeType, SizeAtCompileTime>;
static type pad(const DerivativeType& x, const OtherDerivativeType& y) {
// CoherentPadOp uses variable_if_dynamic<SizeAtCompileTime>. In this case, `SizeAtCompileTime` might