From aaca9e5856d2f143ae2edf971108c2613ceca068 Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen <4643818-rmlarsen1@users.noreply.gitlab.com> Date: Thu, 26 Feb 2026 11:23:53 -0800 Subject: [PATCH] Add missing const qualifiers in Eigen/src/Core/ libeigen/eigen!2220 Co-authored-by: Rasmus Munk Larsen --- Eigen/src/Core/CoreIterators.h | 2 +- Eigen/src/Core/FindCoeff.h | 8 ++++---- Eigen/src/Core/Map.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Eigen/src/Core/CoreIterators.h b/Eigen/src/Core/CoreIterators.h index f62cf238e..314372686 100644 --- a/Eigen/src/Core/CoreIterators.h +++ b/Eigen/src/Core/CoreIterators.h @@ -57,7 +57,7 @@ class InnerIterator { m_iter.operator+=(i); return *this; } - EIGEN_STRONG_INLINE InnerIterator operator+(Index i) { + EIGEN_STRONG_INLINE InnerIterator operator+(Index i) const { InnerIterator result(*this); result += i; return result; diff --git a/Eigen/src/Core/FindCoeff.h b/Eigen/src/Core/FindCoeff.h index 0102e8af3..1c07260ba 100644 --- a/Eigen/src/Core/FindCoeff.h +++ b/Eigen/src/Core/FindCoeff.h @@ -34,11 +34,11 @@ struct max_coeff_functor { template struct max_coeff_functor { - EIGEN_DEVICE_FUNC inline Scalar compareCoeff(const Scalar& incumbent, const Scalar& candidate) { + EIGEN_DEVICE_FUNC inline Scalar compareCoeff(const Scalar& incumbent, const Scalar& candidate) const { return (candidate > incumbent) || ((candidate != candidate) && (incumbent == incumbent)); } template - EIGEN_DEVICE_FUNC inline Packet comparePacket(const Packet& incumbent, const Packet& candidate) { + EIGEN_DEVICE_FUNC inline Packet comparePacket(const Packet& incumbent, const Packet& candidate) const { return pandnot(pcmp_lt_or_nan(incumbent, candidate), pisnan(incumbent)); } template @@ -79,11 +79,11 @@ struct min_coeff_functor { template struct min_coeff_functor { - EIGEN_DEVICE_FUNC inline Scalar compareCoeff(const Scalar& incumbent, const Scalar& candidate) { + EIGEN_DEVICE_FUNC inline Scalar compareCoeff(const Scalar& incumbent, const Scalar& candidate) const { return (candidate < incumbent) || ((candidate != candidate) && (incumbent == incumbent)); } template - EIGEN_DEVICE_FUNC inline Packet comparePacket(const Packet& incumbent, const Packet& candidate) { + EIGEN_DEVICE_FUNC inline Packet comparePacket(const Packet& incumbent, const Packet& candidate) const { return pandnot(pcmp_lt_or_nan(candidate, incumbent), pisnan(incumbent)); } template diff --git a/Eigen/src/Core/Map.h b/Eigen/src/Core/Map.h index 52a8eca53..33b62c202 100644 --- a/Eigen/src/Core/Map.h +++ b/Eigen/src/Core/Map.h @@ -100,7 +100,7 @@ class Map : public MapBase > { typedef typename Base::PointerType PointerType; typedef PointerType PointerArgType; - EIGEN_DEVICE_FUNC constexpr inline PointerType cast_to_pointer_type(PointerArgType ptr) { return ptr; } + EIGEN_DEVICE_FUNC constexpr inline PointerType cast_to_pointer_type(PointerArgType ptr) const { return ptr; } EIGEN_DEVICE_FUNC constexpr Index innerStride() const { return StrideType::InnerStrideAtCompileTime != 0 ? m_stride.inner() : 1;