From 4de870b6ebeaff3dd15dd7a68ae38c29b248282b Mon Sep 17 00:00:00 2001 From: Charles Schlosser Date: Mon, 22 Apr 2024 18:14:20 +0000 Subject: [PATCH] fix autodiff enum comparison warnings --- unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h | 9 ++------- 1 file 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 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; static type pad(const DerivativeType& x, const OtherDerivativeType& y) { // CoherentPadOp uses variable_if_dynamic. In this case, `SizeAtCompileTime` might