Selectively add constexpr to Core expression template scaffolding

libeigen/eigen!2184

Closes #3041

Co-authored-by: Rasmus Munk Larsen <rmlarsen@gmail.com>
This commit is contained in:
Rasmus Munk Larsen
2026-02-24 19:59:10 -08:00
parent 34092d2788
commit 61895c5978
70 changed files with 986 additions and 841 deletions

View File

@@ -4,8 +4,8 @@
* \sa MatrixBase::cwiseProduct
*/
template <typename OtherDerived>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const EIGEN_CWISE_BINARY_RETURN_TYPE(Derived, OtherDerived, product) operator*(
const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const EIGEN_CWISE_BINARY_RETURN_TYPE(Derived, OtherDerived, product)
operator*(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const {
return EIGEN_CWISE_BINARY_RETURN_TYPE(Derived, OtherDerived, product)(derived(), other.derived());
}
@@ -14,7 +14,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const EIGEN_CWISE_BINARY_RETURN_TYPE(Deriv
* \sa MatrixBase::cwiseQuotient
*/
template <typename OtherDerived>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseBinaryOp<
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseBinaryOp<
internal::scalar_quotient_op<Scalar, typename OtherDerived::Scalar>, const Derived, const OtherDerived>
operator/(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const {
return CwiseBinaryOp<internal::scalar_quotient_op<Scalar, typename OtherDerived::Scalar>, const Derived,
@@ -29,7 +29,7 @@ operator/(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const {
* \sa max()
*/
template <int NaNPropagation = PropagateFast, typename OtherDerived>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const
CwiseBinaryOp<internal::scalar_min_op<Scalar, Scalar, NaNPropagation>, const Derived, const OtherDerived>
#ifdef EIGEN_PARSED_BY_DOXYGEN
min
@@ -46,7 +46,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
* \sa max()
*/
template <int NaNPropagation = PropagateFast>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const
CwiseBinaryOp<internal::scalar_min_op<Scalar, Scalar, NaNPropagation>, const Derived,
const CwiseNullaryOp<internal::scalar_constant_op<Scalar>, PlainObject> >
#ifdef EIGEN_PARSED_BY_DOXYGEN
@@ -66,7 +66,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
* \sa min()
*/
template <int NaNPropagation = PropagateFast, typename OtherDerived>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const
CwiseBinaryOp<internal::scalar_max_op<Scalar, Scalar, NaNPropagation>, const Derived, const OtherDerived>
#ifdef EIGEN_PARSED_BY_DOXYGEN
max
@@ -83,7 +83,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
* \sa min()
*/
template <int NaNPropagation = PropagateFast>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const
CwiseBinaryOp<internal::scalar_max_op<Scalar, Scalar, NaNPropagation>, const Derived,
const CwiseNullaryOp<internal::scalar_constant_op<Scalar>, PlainObject> >
#ifdef EIGEN_PARSED_BY_DOXYGEN
@@ -105,7 +105,7 @@ EIGEN_MAKE_CWISE_BINARY_OP(absolute_difference, absolute_difference)
*
* \sa absolute_difference()
*/
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const
CwiseBinaryOp<internal::scalar_absolute_difference_op<Scalar, Scalar>, const Derived,
const CwiseNullaryOp<internal::scalar_constant_op<Scalar>, PlainObject> >
#ifdef EIGEN_PARSED_BY_DOXYGEN
@@ -136,7 +136,7 @@ EIGEN_MAKE_CWISE_BINARY_OP(atan2, atan2)
// TODO: code generating macros could be moved to Macros.h and could include generation of documentation
#define EIGEN_MAKE_CWISE_COMP_OP(OP, COMPARATOR) \
template <typename OtherDerived> \
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const \
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const \
CwiseBinaryOp<internal::scalar_cmp_op<Scalar, typename OtherDerived::Scalar, internal::cmp_##COMPARATOR>, \
const Derived, const OtherDerived> \
OP(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const { \
@@ -149,24 +149,24 @@ EIGEN_MAKE_CWISE_BINARY_OP(atan2, atan2)
typedef CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_##COMPARATOR>, \
const CwiseNullaryOp<internal::scalar_constant_op<Scalar>, PlainObject>, const Derived> \
RCmp##COMPARATOR##ReturnType; \
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Cmp##COMPARATOR##ReturnType OP(const Scalar &s) const { \
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const Cmp##COMPARATOR##ReturnType OP(const Scalar &s) const { \
return this->OP(Derived::PlainObject::Constant(rows(), cols(), s)); \
} \
EIGEN_DEVICE_FUNC friend EIGEN_STRONG_INLINE const RCmp##COMPARATOR##ReturnType OP( \
EIGEN_DEVICE_FUNC constexpr friend EIGEN_STRONG_INLINE const RCmp##COMPARATOR##ReturnType OP( \
const Scalar &s, const EIGEN_CURRENT_STORAGE_BASE_CLASS<Derived> &d) { \
return Derived::PlainObject::Constant(d.rows(), d.cols(), s).OP(d); \
}
#define EIGEN_MAKE_CWISE_COMP_R_OP(OP, R_OP, RCOMPARATOR) \
template <typename OtherDerived> \
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const \
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const \
CwiseBinaryOp<internal::scalar_cmp_op<typename OtherDerived::Scalar, Scalar, internal::cmp_##RCOMPARATOR>, \
const OtherDerived, const Derived> \
OP(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const { \
return CwiseBinaryOp<internal::scalar_cmp_op<typename OtherDerived::Scalar, Scalar, internal::cmp_##RCOMPARATOR>, \
const OtherDerived, const Derived>(other.derived(), derived()); \
} \
EIGEN_DEVICE_FUNC inline const RCmp##RCOMPARATOR##ReturnType OP(const Scalar &s) const { \
EIGEN_DEVICE_FUNC constexpr inline const RCmp##RCOMPARATOR##ReturnType OP(const Scalar &s) const { \
return Derived::PlainObject::Constant(rows(), cols(), s).R_OP(*this); \
} \
friend inline const Cmp##RCOMPARATOR##ReturnType OP(const Scalar &s, const Derived &d) { \

View File

@@ -49,7 +49,7 @@ typedef CwiseUnaryOp<internal::scalar_isfinite_op<Scalar, true>, const Derived>
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_abs">Math functions</a>, abs2()
*/
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const AbsReturnType abs() const { return AbsReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const AbsReturnType abs() const { return AbsReturnType(derived()); }
/** \returns an expression of the coefficient-wise phase angle of \c *this
*
@@ -58,9 +58,9 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const AbsReturnType abs() const { return A
*
* \sa abs()
*/
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ArgReturnType arg() const { return ArgReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const ArgReturnType arg() const { return ArgReturnType(derived()); }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CArgReturnType carg() const { return CArgReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CArgReturnType carg() const { return CArgReturnType(derived()); }
/** \returns an expression of the coefficient-wise squared absolute value of \c *this
*
@@ -69,7 +69,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CArgReturnType carg() const { return
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_abs2">Math functions</a>, abs(), square()
*/
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Abs2ReturnType abs2() const { return Abs2ReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const Abs2ReturnType abs2() const { return Abs2ReturnType(derived()); }
/** \returns an expression of the coefficient-wise exponential of *this.
*
@@ -82,7 +82,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Abs2ReturnType abs2() const { return
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_exp">Math functions</a>, exp2(), pow(), log(), sin(),
* cos()
*/
EIGEN_DEVICE_FUNC inline const ExpReturnType exp() const { return ExpReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const ExpReturnType exp() const { return ExpReturnType(derived()); }
/** \returns an expression of the coefficient-wise exponential of *this.
*
@@ -91,7 +91,7 @@ EIGEN_DEVICE_FUNC inline const ExpReturnType exp() const { return ExpReturnType(
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_exp">Math functions</a>, exp(), pow(), log(), sin(),
* cos()
*/
EIGEN_DEVICE_FUNC inline const Exp2ReturnType exp2() const { return Exp2ReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const Exp2ReturnType exp2() const { return Exp2ReturnType(derived()); }
/** \returns an expression of the coefficient-wise exponential of *this minus 1.
*
@@ -100,7 +100,7 @@ EIGEN_DEVICE_FUNC inline const Exp2ReturnType exp2() const { return Exp2ReturnTy
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_expm1">Math functions</a>, exp()
*/
EIGEN_DEVICE_FUNC inline const Expm1ReturnType expm1() const { return Expm1ReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const Expm1ReturnType expm1() const { return Expm1ReturnType(derived()); }
/** \returns an expression of the coefficient-wise logarithm of *this.
*
@@ -112,7 +112,7 @@ EIGEN_DEVICE_FUNC inline const Expm1ReturnType expm1() const { return Expm1Retur
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_log">Math functions</a>, log()
*/
EIGEN_DEVICE_FUNC inline const LogReturnType log() const { return LogReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const LogReturnType log() const { return LogReturnType(derived()); }
/** \returns an expression of the coefficient-wise logarithm of 1 plus \c *this.
*
@@ -121,7 +121,7 @@ EIGEN_DEVICE_FUNC inline const LogReturnType log() const { return LogReturnType(
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_log1p">Math functions</a>, log()
*/
EIGEN_DEVICE_FUNC inline const Log1pReturnType log1p() const { return Log1pReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const Log1pReturnType log1p() const { return Log1pReturnType(derived()); }
/** \returns an expression of the coefficient-wise base-10 logarithm of *this.
*
@@ -132,14 +132,14 @@ EIGEN_DEVICE_FUNC inline const Log1pReturnType log1p() const { return Log1pRetur
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_log10">Math functions</a>, log()
*/
EIGEN_DEVICE_FUNC inline const Log10ReturnType log10() const { return Log10ReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const Log10ReturnType log10() const { return Log10ReturnType(derived()); }
/** \returns an expression of the coefficient-wise base-2 logarithm of *this.
*
* This function computes the coefficient-wise base-2 logarithm.
*
*/
EIGEN_DEVICE_FUNC inline const Log2ReturnType log2() const { return Log2ReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const Log2ReturnType log2() const { return Log2ReturnType(derived()); }
/** \returns an expression of the coefficient-wise square root of *this.
*
@@ -151,7 +151,7 @@ EIGEN_DEVICE_FUNC inline const Log2ReturnType log2() const { return Log2ReturnTy
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_sqrt">Math functions</a>, pow(), square(), cbrt()
*/
EIGEN_DEVICE_FUNC inline const SqrtReturnType sqrt() const { return SqrtReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const SqrtReturnType sqrt() const { return SqrtReturnType(derived()); }
/** \returns an expression of the coefficient-wise cube root of *this.
*
@@ -162,7 +162,7 @@ EIGEN_DEVICE_FUNC inline const SqrtReturnType sqrt() const { return SqrtReturnTy
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_cbrt">Math functions</a>, sqrt(), pow(), square()
*/
EIGEN_DEVICE_FUNC inline const CbrtReturnType cbrt() const { return CbrtReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const CbrtReturnType cbrt() const { return CbrtReturnType(derived()); }
/** \returns an expression of the coefficient-wise inverse square root of *this.
*
@@ -173,7 +173,7 @@ EIGEN_DEVICE_FUNC inline const CbrtReturnType cbrt() const { return CbrtReturnTy
*
* \sa pow(), square()
*/
EIGEN_DEVICE_FUNC inline const RsqrtReturnType rsqrt() const { return RsqrtReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const RsqrtReturnType rsqrt() const { return RsqrtReturnType(derived()); }
/** \returns an expression of the coefficient-wise signum of *this.
*
@@ -184,7 +184,7 @@ EIGEN_DEVICE_FUNC inline const RsqrtReturnType rsqrt() const { return RsqrtRetur
*
* \sa pow(), square()
*/
EIGEN_DEVICE_FUNC inline const SignReturnType sign() const { return SignReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const SignReturnType sign() const { return SignReturnType(derived()); }
/** \returns an expression of the coefficient-wise cosine of *this.
*
@@ -196,7 +196,7 @@ EIGEN_DEVICE_FUNC inline const SignReturnType sign() const { return SignReturnTy
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_cos">Math functions</a>, sin(), acos()
*/
EIGEN_DEVICE_FUNC inline const CosReturnType cos() const { return CosReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const CosReturnType cos() const { return CosReturnType(derived()); }
/** \returns an expression of the coefficient-wise sine of *this.
*
@@ -208,7 +208,7 @@ EIGEN_DEVICE_FUNC inline const CosReturnType cos() const { return CosReturnType(
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_sin">Math functions</a>, cos(), asin()
*/
EIGEN_DEVICE_FUNC inline const SinReturnType sin() const { return SinReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const SinReturnType sin() const { return SinReturnType(derived()); }
/** \returns an expression of the coefficient-wise tan of *this.
*
@@ -217,7 +217,7 @@ EIGEN_DEVICE_FUNC inline const SinReturnType sin() const { return SinReturnType(
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_tan">Math functions</a>, cos(), sin()
*/
EIGEN_DEVICE_FUNC inline const TanReturnType tan() const { return TanReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const TanReturnType tan() const { return TanReturnType(derived()); }
/** \returns an expression of the coefficient-wise arc tan of *this.
*
@@ -226,7 +226,7 @@ EIGEN_DEVICE_FUNC inline const TanReturnType tan() const { return TanReturnType(
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_atan">Math functions</a>, tan(), asin(), acos()
*/
EIGEN_DEVICE_FUNC inline const AtanReturnType atan() const { return AtanReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const AtanReturnType atan() const { return AtanReturnType(derived()); }
/** \returns an expression of the coefficient-wise arc cosine of *this.
*
@@ -235,7 +235,7 @@ EIGEN_DEVICE_FUNC inline const AtanReturnType atan() const { return AtanReturnTy
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_acos">Math functions</a>, cos(), asin()
*/
EIGEN_DEVICE_FUNC inline const AcosReturnType acos() const { return AcosReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const AcosReturnType acos() const { return AcosReturnType(derived()); }
/** \returns an expression of the coefficient-wise arc sine of *this.
*
@@ -244,7 +244,7 @@ EIGEN_DEVICE_FUNC inline const AcosReturnType acos() const { return AcosReturnTy
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_asin">Math functions</a>, sin(), acos()
*/
EIGEN_DEVICE_FUNC inline const AsinReturnType asin() const { return AsinReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const AsinReturnType asin() const { return AsinReturnType(derived()); }
/** \returns an expression of the coefficient-wise hyperbolic tan of *this.
*
@@ -253,7 +253,7 @@ EIGEN_DEVICE_FUNC inline const AsinReturnType asin() const { return AsinReturnTy
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_tanh">Math functions</a>, tan(), sinh(), cosh()
*/
EIGEN_DEVICE_FUNC inline const TanhReturnType tanh() const { return TanhReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const TanhReturnType tanh() const { return TanhReturnType(derived()); }
/** \returns an expression of the coefficient-wise hyperbolic sin of *this.
*
@@ -262,7 +262,7 @@ EIGEN_DEVICE_FUNC inline const TanhReturnType tanh() const { return TanhReturnTy
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_sinh">Math functions</a>, sin(), tanh(), cosh()
*/
EIGEN_DEVICE_FUNC inline const SinhReturnType sinh() const { return SinhReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const SinhReturnType sinh() const { return SinhReturnType(derived()); }
/** \returns an expression of the coefficient-wise hyperbolic cos of *this.
*
@@ -271,29 +271,29 @@ EIGEN_DEVICE_FUNC inline const SinhReturnType sinh() const { return SinhReturnTy
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_cosh">Math functions</a>, tanh(), sinh(), cosh()
*/
EIGEN_DEVICE_FUNC inline const CoshReturnType cosh() const { return CoshReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const CoshReturnType cosh() const { return CoshReturnType(derived()); }
/** \returns an expression of the coefficient-wise inverse hyperbolic tan of *this.
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_atanh">Math functions</a>, atanh(), asinh(), acosh()
*/
EIGEN_DEVICE_FUNC inline const AtanhReturnType atanh() const { return AtanhReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const AtanhReturnType atanh() const { return AtanhReturnType(derived()); }
/** \returns an expression of the coefficient-wise inverse hyperbolic sin of *this.
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_asinh">Math functions</a>, atanh(), asinh(), acosh()
*/
EIGEN_DEVICE_FUNC inline const AsinhReturnType asinh() const { return AsinhReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const AsinhReturnType asinh() const { return AsinhReturnType(derived()); }
/** \returns an expression of the coefficient-wise inverse hyperbolic cos of *this.
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_acosh">Math functions</a>, atanh(), asinh(), acosh()
*/
EIGEN_DEVICE_FUNC inline const AcoshReturnType acosh() const { return AcoshReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const AcoshReturnType acosh() const { return AcoshReturnType(derived()); }
/** \returns an expression of the coefficient-wise logistic of *this.
*/
EIGEN_DEVICE_FUNC inline const LogisticReturnType logistic() const { return LogisticReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const LogisticReturnType logistic() const { return LogisticReturnType(derived()); }
/** \returns an expression of the coefficient-wise inverse of *this.
*
@@ -302,7 +302,7 @@ EIGEN_DEVICE_FUNC inline const LogisticReturnType logistic() const { return Logi
*
* \sa operator/(), operator*()
*/
EIGEN_DEVICE_FUNC inline const InverseReturnType inverse() const { return InverseReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const InverseReturnType inverse() const { return InverseReturnType(derived()); }
/** \returns an expression of the coefficient-wise square of *this.
*
@@ -311,7 +311,7 @@ EIGEN_DEVICE_FUNC inline const InverseReturnType inverse() const { return Invers
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_squareE">Math functions</a>, abs2(), cube(), pow()
*/
EIGEN_DEVICE_FUNC inline const SquareReturnType square() const { return SquareReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const SquareReturnType square() const { return SquareReturnType(derived()); }
/** \returns an expression of the coefficient-wise cube of *this.
*
@@ -320,7 +320,7 @@ EIGEN_DEVICE_FUNC inline const SquareReturnType square() const { return SquareRe
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_cube">Math functions</a>, square(), pow()
*/
EIGEN_DEVICE_FUNC inline const CubeReturnType cube() const { return CubeReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const CubeReturnType cube() const { return CubeReturnType(derived()); }
/** \returns an expression of the coefficient-wise rint of *this.
*
@@ -329,7 +329,7 @@ EIGEN_DEVICE_FUNC inline const CubeReturnType cube() const { return CubeReturnTy
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_rint">Math functions</a>, ceil(), floor()
*/
EIGEN_DEVICE_FUNC inline const RintReturnType rint() const { return RintReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const RintReturnType rint() const { return RintReturnType(derived()); }
/** \returns an expression of the coefficient-wise round of *this.
*
@@ -338,7 +338,7 @@ EIGEN_DEVICE_FUNC inline const RintReturnType rint() const { return RintReturnTy
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_round">Math functions</a>, ceil(), floor()
*/
EIGEN_DEVICE_FUNC inline const RoundReturnType round() const { return RoundReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const RoundReturnType round() const { return RoundReturnType(derived()); }
/** \returns an expression of the coefficient-wise floor of *this.
*
@@ -347,7 +347,7 @@ EIGEN_DEVICE_FUNC inline const RoundReturnType round() const { return RoundRetur
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_floor">Math functions</a>, ceil(), round()
*/
EIGEN_DEVICE_FUNC inline const FloorReturnType floor() const { return FloorReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const FloorReturnType floor() const { return FloorReturnType(derived()); }
/** \returns an expression of the coefficient-wise ceil of *this.
*
@@ -356,7 +356,7 @@ EIGEN_DEVICE_FUNC inline const FloorReturnType floor() const { return FloorRetur
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_ceil">Math functions</a>, floor(), round()
*/
EIGEN_DEVICE_FUNC inline const CeilReturnType ceil() const { return CeilReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const CeilReturnType ceil() const { return CeilReturnType(derived()); }
/** \returns an expression of the coefficient-wise truncation of *this.
*
@@ -365,7 +365,7 @@ EIGEN_DEVICE_FUNC inline const CeilReturnType ceil() const { return CeilReturnTy
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_trunc">Math functions</a>, floor(), round()
*/
EIGEN_DEVICE_FUNC inline const TruncReturnType trunc() const { return TruncReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const TruncReturnType trunc() const { return TruncReturnType(derived()); }
template <int N>
struct ShiftRightXpr {
@@ -380,7 +380,7 @@ struct ShiftRightXpr {
* \sa shiftLeft()
*/
template <int N>
EIGEN_DEVICE_FUNC typename ShiftRightXpr<N>::Type shiftRight() const {
EIGEN_DEVICE_FUNC constexpr typename ShiftRightXpr<N>::Type shiftRight() const {
return typename ShiftRightXpr<N>::Type(derived());
}
@@ -397,7 +397,7 @@ struct ShiftLeftXpr {
* \sa shiftRight()
*/
template <int N>
EIGEN_DEVICE_FUNC typename ShiftLeftXpr<N>::Type shiftLeft() const {
EIGEN_DEVICE_FUNC constexpr typename ShiftLeftXpr<N>::Type shiftLeft() const {
return typename ShiftLeftXpr<N>::Type(derived());
}
@@ -408,7 +408,7 @@ EIGEN_DEVICE_FUNC typename ShiftLeftXpr<N>::Type shiftLeft() const {
*
* \sa isfinite(), isinf()
*/
EIGEN_DEVICE_FUNC inline const IsNaNReturnType isNaN() const { return IsNaNReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const IsNaNReturnType isNaN() const { return IsNaNReturnType(derived()); }
/** \returns an expression of the coefficient-wise isinf of *this.
*
@@ -417,7 +417,7 @@ EIGEN_DEVICE_FUNC inline const IsNaNReturnType isNaN() const { return IsNaNRetur
*
* \sa isnan(), isfinite()
*/
EIGEN_DEVICE_FUNC inline const IsInfReturnType isInf() const { return IsInfReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const IsInfReturnType isInf() const { return IsInfReturnType(derived()); }
/** \returns an expression of the coefficient-wise isfinite of *this.
*
@@ -426,8 +426,8 @@ EIGEN_DEVICE_FUNC inline const IsInfReturnType isInf() const { return IsInfRetur
*
* \sa isnan(), isinf()
*/
EIGEN_DEVICE_FUNC inline const IsFiniteReturnType isFinite() const { return IsFiniteReturnType(derived()); }
EIGEN_DEVICE_FUNC inline const IsFiniteTypedReturnType isFiniteTyped() const {
EIGEN_DEVICE_FUNC constexpr inline const IsFiniteReturnType isFinite() const { return IsFiniteReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const IsFiniteTypedReturnType isFiniteTyped() const {
return IsFiniteTypedReturnType(derived());
}
@@ -438,11 +438,15 @@ EIGEN_DEVICE_FUNC inline const IsFiniteTypedReturnType isFiniteTyped() const {
*
* \sa operator!=()
*/
EIGEN_DEVICE_FUNC inline const BooleanNotReturnType operator!() const { return BooleanNotReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const BooleanNotReturnType operator!() const {
return BooleanNotReturnType(derived());
}
/** \returns an expression of the bitwise ~ operator of *this
*/
EIGEN_DEVICE_FUNC inline const BitwiseNotReturnType operator~() const { return BitwiseNotReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const BitwiseNotReturnType operator~() const {
return BitwiseNotReturnType(derived());
}
// --- SpecialFunctions module ---
@@ -462,7 +466,7 @@ typedef CwiseUnaryOp<internal::scalar_ndtri_op<Scalar>, const Derived> NdtriRetu
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_lgamma">Math functions</a>, digamma()
*/
EIGEN_DEVICE_FUNC inline const LgammaReturnType lgamma() const { return LgammaReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const LgammaReturnType lgamma() const { return LgammaReturnType(derived()); }
/** \returns an expression of the coefficient-wise digamma (psi, derivative of lgamma).
*
@@ -475,7 +479,7 @@ EIGEN_DEVICE_FUNC inline const LgammaReturnType lgamma() const { return LgammaRe
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_digamma">Math functions</a>, Eigen::digamma(),
* Eigen::polygamma(), lgamma()
*/
EIGEN_DEVICE_FUNC inline const DigammaReturnType digamma() const { return DigammaReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const DigammaReturnType digamma() const { return DigammaReturnType(derived()); }
/** \cpp11 \returns an expression of the coefficient-wise Gauss error
* function of *this.
@@ -488,7 +492,7 @@ EIGEN_DEVICE_FUNC inline const DigammaReturnType digamma() const { return Digamm
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_erf">Math functions</a>, erfc()
*/
EIGEN_DEVICE_FUNC inline const ErfReturnType erf() const { return ErfReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const ErfReturnType erf() const { return ErfReturnType(derived()); }
/** \cpp11 \returns an expression of the coefficient-wise Complementary error
* function of *this.
@@ -501,7 +505,7 @@ EIGEN_DEVICE_FUNC inline const ErfReturnType erf() const { return ErfReturnType(
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_erfc">Math functions</a>, erf()
*/
EIGEN_DEVICE_FUNC inline const ErfcReturnType erfc() const { return ErfcReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const ErfcReturnType erfc() const { return ErfcReturnType(derived()); }
/** \returns an expression of the coefficient-wise inverse of the CDF of the Normal distribution function
* function of *this.
@@ -516,7 +520,7 @@ EIGEN_DEVICE_FUNC inline const ErfcReturnType erfc() const { return ErfcReturnTy
*
* \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_ndtri">Math functions</a>
*/
EIGEN_DEVICE_FUNC inline const NdtriReturnType ndtri() const { return NdtriReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const NdtriReturnType ndtri() const { return NdtriReturnType(derived()); }
template <typename ScalarExponent>
using UnaryPowReturnType =
@@ -538,7 +542,7 @@ using UnaryPowReturnType =
* \sa ArrayBase::pow(ArrayBase), square(), cube(), exp(), log()
*/
template <typename ScalarExponent>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const UnaryPowReturnType<ScalarExponent> pow(
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const UnaryPowReturnType<ScalarExponent> pow(
const ScalarExponent& exponent) const {
return UnaryPowReturnType<ScalarExponent>(derived(), internal::scalar_unary_pow_op<Scalar, ScalarExponent>(exponent));
}

View File

@@ -111,7 +111,7 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
/// \sa class Block, fix, fix<N>(int)
///
template <typename NRowsType, typename NColsType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
#ifndef EIGEN_PARSED_BY_DOXYGEN
typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
internal::get_fixed_value<NColsType>::value>::Type
@@ -128,7 +128,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
/// This is the const version of block(Index,Index,NRowsType,NColsType)
template <typename NRowsType, typename NColsType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
#ifndef EIGEN_PARSED_BY_DOXYGEN
const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
internal::get_fixed_value<NColsType>::value>::Type
@@ -163,7 +163,7 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
/// \sa block(Index,Index,NRowsType,NColsType), class Block
///
template <typename NRowsType, typename NColsType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
#ifndef EIGEN_PARSED_BY_DOXYGEN
typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
internal::get_fixed_value<NColsType>::value>::Type
@@ -181,7 +181,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
/// This is the const version of topRightCorner(NRowsType, NColsType).
template <typename NRowsType, typename NColsType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
#ifndef EIGEN_PARSED_BY_DOXYGEN
const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
internal::get_fixed_value<NColsType>::value>::Type
@@ -213,13 +213,14 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
/// \sa class Block, block<int,int>(Index,Index)
///
template <int CRows, int CCols>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type topRightCorner() {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type topRightCorner() {
return typename FixedBlockXpr<CRows, CCols>::Type(derived(), 0, cols() - CCols);
}
/// This is the const version of topRightCorner<int, int>().
template <int CRows, int CCols>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type topRightCorner() const {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type topRightCorner()
const {
return typename ConstFixedBlockXpr<CRows, CCols>::Type(derived(), 0, cols() - CCols);
}
@@ -243,14 +244,14 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
/// \sa class Block
///
template <int CRows, int CCols>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type topRightCorner(Index cRows,
Index cCols) {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type topRightCorner(Index cRows,
Index cCols) {
return typename FixedBlockXpr<CRows, CCols>::Type(derived(), 0, cols() - cCols, cRows, cCols);
}
/// This is the const version of topRightCorner<int, int>(Index, Index).
template <int CRows, int CCols>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type topRightCorner(
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type topRightCorner(
Index cRows, Index cCols) const {
return typename ConstFixedBlockXpr<CRows, CCols>::Type(derived(), 0, cols() - cCols, cRows, cCols);
}
@@ -274,7 +275,7 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
/// \sa block(Index,Index,NRowsType,NColsType), class Block
///
template <typename NRowsType, typename NColsType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
#ifndef EIGEN_PARSED_BY_DOXYGEN
typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
internal::get_fixed_value<NColsType>::value>::Type
@@ -290,7 +291,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
/// This is the const version of topLeftCorner(Index, Index).
template <typename NRowsType, typename NColsType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
#ifndef EIGEN_PARSED_BY_DOXYGEN
const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
internal::get_fixed_value<NColsType>::value>::Type
@@ -318,13 +319,14 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
/// \sa block(Index,Index,NRowsType,NColsType), class Block
///
template <int CRows, int CCols>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type topLeftCorner() {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type topLeftCorner() {
return typename FixedBlockXpr<CRows, CCols>::Type(derived(), 0, 0);
}
/// This is the const version of topLeftCorner<int, int>().
template <int CRows, int CCols>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type topLeftCorner() const {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type topLeftCorner()
const {
return typename ConstFixedBlockXpr<CRows, CCols>::Type(derived(), 0, 0);
}
@@ -348,14 +350,14 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
/// \sa class Block
///
template <int CRows, int CCols>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type topLeftCorner(Index cRows,
Index cCols) {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type topLeftCorner(Index cRows,
Index cCols) {
return typename FixedBlockXpr<CRows, CCols>::Type(derived(), 0, 0, cRows, cCols);
}
/// This is the const version of topLeftCorner<int, int>(Index, Index).
template <int CRows, int CCols>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type topLeftCorner(
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type topLeftCorner(
Index cRows, Index cCols) const {
return typename ConstFixedBlockXpr<CRows, CCols>::Type(derived(), 0, 0, cRows, cCols);
}
@@ -379,7 +381,7 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
/// \sa block(Index,Index,NRowsType,NColsType), class Block
///
template <typename NRowsType, typename NColsType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
#ifndef EIGEN_PARSED_BY_DOXYGEN
typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
internal::get_fixed_value<NColsType>::value>::Type
@@ -395,7 +397,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
/// This is the const version of bottomRightCorner(NRowsType, NColsType).
template <typename NRowsType, typename NColsType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
#ifndef EIGEN_PARSED_BY_DOXYGEN
const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
internal::get_fixed_value<NColsType>::value>::Type
@@ -423,13 +425,14 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
/// \sa block(Index,Index,NRowsType,NColsType), class Block
///
template <int CRows, int CCols>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type bottomRightCorner() {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type bottomRightCorner() {
return typename FixedBlockXpr<CRows, CCols>::Type(derived(), rows() - CRows, cols() - CCols);
}
/// This is the const version of bottomRightCorner<int, int>().
template <int CRows, int CCols>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type bottomRightCorner() const {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type
bottomRightCorner() const {
return typename ConstFixedBlockXpr<CRows, CCols>::Type(derived(), rows() - CRows, cols() - CCols);
}
@@ -453,14 +456,14 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
/// \sa class Block
///
template <int CRows, int CCols>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type bottomRightCorner(Index cRows,
Index cCols) {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type bottomRightCorner(
Index cRows, Index cCols) {
return typename FixedBlockXpr<CRows, CCols>::Type(derived(), rows() - cRows, cols() - cCols, cRows, cCols);
}
/// This is the const version of bottomRightCorner<int, int>(Index, Index).
template <int CRows, int CCols>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type bottomRightCorner(
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type bottomRightCorner(
Index cRows, Index cCols) const {
return typename ConstFixedBlockXpr<CRows, CCols>::Type(derived(), rows() - cRows, cols() - cCols, cRows, cCols);
}
@@ -484,7 +487,7 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
/// \sa block(Index,Index,NRowsType,NColsType), class Block
///
template <typename NRowsType, typename NColsType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
#ifndef EIGEN_PARSED_BY_DOXYGEN
typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
internal::get_fixed_value<NColsType>::value>::Type
@@ -503,7 +506,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
/// This is the const version of bottomLeftCorner(NRowsType, NColsType).
template <typename NRowsType, typename NColsType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
#ifndef EIGEN_PARSED_BY_DOXYGEN
typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
internal::get_fixed_value<NColsType>::value>::Type
@@ -530,13 +533,14 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
/// \sa block(Index,Index,NRowsType,NColsType), class Block
///
template <int CRows, int CCols>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type bottomLeftCorner() {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type bottomLeftCorner() {
return typename FixedBlockXpr<CRows, CCols>::Type(derived(), rows() - CRows, 0);
}
/// This is the const version of bottomLeftCorner<int, int>().
template <int CRows, int CCols>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type bottomLeftCorner() const {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type bottomLeftCorner()
const {
return typename ConstFixedBlockXpr<CRows, CCols>::Type(derived(), rows() - CRows, 0);
}
@@ -588,7 +592,7 @@ EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row - major)
/// \sa block(Index,Index,NRowsType,NColsType), class Block
///
template <typename NRowsType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
#ifndef EIGEN_PARSED_BY_DOXYGEN
typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
#else
@@ -601,7 +605,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
/// This is the const version of topRows(NRowsType).
template <typename NRowsType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
#ifndef EIGEN_PARSED_BY_DOXYGEN
const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
#else
@@ -628,13 +632,13 @@ EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row - major)
/// \sa block(Index,Index,NRowsType,NColsType), class Block
///
template <int N>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename NRowsBlockXpr<N>::Type topRows(Index n = N) {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename NRowsBlockXpr<N>::Type topRows(Index n = N) {
return typename NRowsBlockXpr<N>::Type(derived(), 0, 0, n, cols());
}
/// This is the const version of topRows<int>().
template <int N>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstNRowsBlockXpr<N>::Type topRows(Index n = N) const {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename ConstNRowsBlockXpr<N>::Type topRows(Index n = N) const {
return typename ConstNRowsBlockXpr<N>::Type(derived(), 0, 0, n, cols());
}
@@ -655,7 +659,7 @@ EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row - major)
/// \sa block(Index,Index,NRowsType,NColsType), class Block
///
template <typename NRowsType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
#ifndef EIGEN_PARSED_BY_DOXYGEN
typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
#else
@@ -668,7 +672,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
/// This is the const version of bottomRows(NRowsType).
template <typename NRowsType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
#ifndef EIGEN_PARSED_BY_DOXYGEN
const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
#else
@@ -695,13 +699,13 @@ EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row - major)
/// \sa block(Index,Index,NRowsType,NColsType), class Block
///
template <int N>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename NRowsBlockXpr<N>::Type bottomRows(Index n = N) {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename NRowsBlockXpr<N>::Type bottomRows(Index n = N) {
return typename NRowsBlockXpr<N>::Type(derived(), rows() - n, 0, n, cols());
}
/// This is the const version of bottomRows<int>().
template <int N>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstNRowsBlockXpr<N>::Type bottomRows(Index n = N) const {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename ConstNRowsBlockXpr<N>::Type bottomRows(Index n = N) const {
return typename ConstNRowsBlockXpr<N>::Type(derived(), rows() - n, 0, n, cols());
}
@@ -723,7 +727,7 @@ EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row - major)
/// \sa block(Index,Index,NRowsType,NColsType), class Block
///
template <typename NRowsType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
#ifndef EIGEN_PARSED_BY_DOXYGEN
typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
#else
@@ -736,7 +740,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
/// This is the const version of middleRows(Index,NRowsType).
template <typename NRowsType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
#ifndef EIGEN_PARSED_BY_DOXYGEN
const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
#else
@@ -764,14 +768,15 @@ EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row - major)
/// \sa block(Index,Index,NRowsType,NColsType), class Block
///
template <int N>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename NRowsBlockXpr<N>::Type middleRows(Index startRow, Index n = N) {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename NRowsBlockXpr<N>::Type middleRows(Index startRow,
Index n = N) {
return typename NRowsBlockXpr<N>::Type(derived(), startRow, 0, n, cols());
}
/// This is the const version of middleRows<int>().
template <int N>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstNRowsBlockXpr<N>::Type middleRows(Index startRow,
Index n = N) const {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename ConstNRowsBlockXpr<N>::Type middleRows(Index startRow,
Index n = N) const {
return typename ConstNRowsBlockXpr<N>::Type(derived(), startRow, 0, n, cols());
}
@@ -792,7 +797,7 @@ EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column - major)
/// \sa block(Index,Index,NRowsType,NColsType), class Block
///
template <typename NColsType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
#ifndef EIGEN_PARSED_BY_DOXYGEN
typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
#else
@@ -805,7 +810,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
/// This is the const version of leftCols(NColsType).
template <typename NColsType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
#ifndef EIGEN_PARSED_BY_DOXYGEN
const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
#else
@@ -832,13 +837,13 @@ EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column - major)
/// \sa block(Index,Index,NRowsType,NColsType), class Block
///
template <int N>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename NColsBlockXpr<N>::Type leftCols(Index n = N) {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename NColsBlockXpr<N>::Type leftCols(Index n = N) {
return typename NColsBlockXpr<N>::Type(derived(), 0, 0, rows(), n);
}
/// This is the const version of leftCols<int>().
template <int N>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstNColsBlockXpr<N>::Type leftCols(Index n = N) const {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename ConstNColsBlockXpr<N>::Type leftCols(Index n = N) const {
return typename ConstNColsBlockXpr<N>::Type(derived(), 0, 0, rows(), n);
}
@@ -859,7 +864,7 @@ EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column - major)
/// \sa block(Index,Index,NRowsType,NColsType), class Block
///
template <typename NColsType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
#ifndef EIGEN_PARSED_BY_DOXYGEN
typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
#else
@@ -872,7 +877,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
/// This is the const version of rightCols(NColsType).
template <typename NColsType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
#ifndef EIGEN_PARSED_BY_DOXYGEN
const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
#else
@@ -899,13 +904,13 @@ EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column - major)
/// \sa block(Index,Index,NRowsType,NColsType), class Block
///
template <int N>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename NColsBlockXpr<N>::Type rightCols(Index n = N) {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename NColsBlockXpr<N>::Type rightCols(Index n = N) {
return typename NColsBlockXpr<N>::Type(derived(), 0, cols() - n, rows(), n);
}
/// This is the const version of rightCols<int>().
template <int N>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstNColsBlockXpr<N>::Type rightCols(Index n = N) const {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename ConstNColsBlockXpr<N>::Type rightCols(Index n = N) const {
return typename ConstNColsBlockXpr<N>::Type(derived(), 0, cols() - n, rows(), n);
}
@@ -927,7 +932,7 @@ EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column - major)
/// \sa block(Index,Index,NRowsType,NColsType), class Block
///
template <typename NColsType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
#ifndef EIGEN_PARSED_BY_DOXYGEN
typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
#else
@@ -940,7 +945,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
/// This is the const version of middleCols(Index,NColsType).
template <typename NColsType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
#ifndef EIGEN_PARSED_BY_DOXYGEN
const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
#else
@@ -968,14 +973,15 @@ EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column - major)
/// \sa block(Index,Index,NRowsType,NColsType), class Block
///
template <int N>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename NColsBlockXpr<N>::Type middleCols(Index startCol, Index n = N) {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename NColsBlockXpr<N>::Type middleCols(Index startCol,
Index n = N) {
return typename NColsBlockXpr<N>::Type(derived(), 0, startCol, rows(), n);
}
/// This is the const version of middleCols<int>().
template <int N>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstNColsBlockXpr<N>::Type middleCols(Index startCol,
Index n = N) const {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename ConstNColsBlockXpr<N>::Type middleCols(Index startCol,
Index n = N) const {
return typename ConstNColsBlockXpr<N>::Type(derived(), 0, startCol, rows(), n);
}
@@ -1004,13 +1010,14 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
/// \sa block(Index,Index,NRowsType,NColsType), class Block
///
template <int NRows, int NCols>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedBlockXpr<NRows, NCols>::Type block(Index startRow, Index startCol) {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename FixedBlockXpr<NRows, NCols>::Type block(Index startRow,
Index startCol) {
return typename FixedBlockXpr<NRows, NCols>::Type(derived(), startRow, startCol);
}
/// This is the const version of block<>(Index, Index). */
template <int NRows, int NCols>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<NRows, NCols>::Type block(
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<NRows, NCols>::Type block(
Index startRow, Index startCol) const {
return typename ConstFixedBlockXpr<NRows, NCols>::Type(derived(), startRow, startCol);
}
@@ -1047,15 +1054,16 @@ EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
/// \sa block(Index,Index,NRowsType,NColsType), class Block
///
template <int NRows, int NCols>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedBlockXpr<NRows, NCols>::Type block(Index startRow, Index startCol,
Index blockRows,
Index blockCols) {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename FixedBlockXpr<NRows, NCols>::Type block(Index startRow,
Index startCol,
Index blockRows,
Index blockCols) {
return typename FixedBlockXpr<NRows, NCols>::Type(derived(), startRow, startCol, blockRows, blockCols);
}
/// This is the const version of block<>(Index, Index, Index, Index).
template <int NRows, int NCols>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<NRows, NCols>::Type block(
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<NRows, NCols>::Type block(
Index startRow, Index startCol, Index blockRows, Index blockCols) const {
return typename ConstFixedBlockXpr<NRows, NCols>::Type(derived(), startRow, startCol, blockRows, blockCols);
}
@@ -1068,10 +1076,10 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<NRows, N
EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column - major)
/**
* \sa row(), class Block */
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ColXpr col(Index i) { return ColXpr(derived(), i); }
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE ColXpr col(Index i) { return ColXpr(derived(), i); }
/// This is the const version of col().
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ConstColXpr col(Index i) const { return ConstColXpr(derived(), i); }
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE ConstColXpr col(Index i) const { return ConstColXpr(derived(), i); }
/// \returns an expression of the \a i-th row of \c *this. Note that the numbering starts at 0.
///
@@ -1081,10 +1089,10 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ConstColXpr col(Index i) const { return Co
EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row - major)
/**
* \sa col(), class Block */
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE RowXpr row(Index i) { return RowXpr(derived(), i); }
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE RowXpr row(Index i) { return RowXpr(derived(), i); }
/// This is the const version of row(). */
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ConstRowXpr row(Index i) const { return ConstRowXpr(derived(), i); }
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE ConstRowXpr row(Index i) const { return ConstRowXpr(derived(), i); }
/// \returns an expression of a segment (i.e. a vector block) in \c *this with either dynamic or fixed sizes.
///
@@ -1108,7 +1116,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ConstRowXpr row(Index i) const { return Co
/// \sa block(Index,Index,NRowsType,NColsType), fix<N>, fix<N>(int), class Block
///
template <typename NType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
#ifndef EIGEN_PARSED_BY_DOXYGEN
typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
#else
@@ -1122,7 +1130,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
/// This is the const version of segment(Index,NType).
template <typename NType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
#ifndef EIGEN_PARSED_BY_DOXYGEN
const typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
#else
@@ -1155,7 +1163,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
/// \sa class Block, block(Index,Index)
///
template <typename NType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
#ifndef EIGEN_PARSED_BY_DOXYGEN
typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
#else
@@ -1169,7 +1177,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
/// This is the const version of head(NType).
template <typename NType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
#ifndef EIGEN_PARSED_BY_DOXYGEN
const typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
#else
@@ -1202,7 +1210,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
/// \sa class Block, block(Index,Index)
///
template <typename NType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
#ifndef EIGEN_PARSED_BY_DOXYGEN
typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
#else
@@ -1216,7 +1224,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
/// This is the const version of tail(Index).
template <typename NType>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE
#ifndef EIGEN_PARSED_BY_DOXYGEN
const typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
#else
@@ -1245,15 +1253,16 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
/// \sa segment(Index,NType), class Block
///
template <int N>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedSegmentReturnType<N>::Type segment(Index start, Index n = N) {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename FixedSegmentReturnType<N>::Type segment(Index start,
Index n = N) {
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
return typename FixedSegmentReturnType<N>::Type(derived(), start, n);
}
/// This is the const version of segment<int>(Index).
template <int N>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstFixedSegmentReturnType<N>::Type segment(Index start,
Index n = N) const {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename ConstFixedSegmentReturnType<N>::Type segment(
Index start, Index n = N) const {
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
return typename ConstFixedSegmentReturnType<N>::Type(derived(), start, n);
}
@@ -1274,14 +1283,14 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstFixedSegmentReturnType<N>::T
/// \sa head(NType), class Block
///
template <int N>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedSegmentReturnType<N>::Type head(Index n = N) {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename FixedSegmentReturnType<N>::Type head(Index n = N) {
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
return typename FixedSegmentReturnType<N>::Type(derived(), 0, n);
}
/// This is the const version of head<int>().
template <int N>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstFixedSegmentReturnType<N>::Type head(Index n = N) const {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename ConstFixedSegmentReturnType<N>::Type head(Index n = N) const {
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
return typename ConstFixedSegmentReturnType<N>::Type(derived(), 0, n);
}
@@ -1302,14 +1311,14 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstFixedSegmentReturnType<N>::T
/// \sa tail(NType), class Block
///
template <int N>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedSegmentReturnType<N>::Type tail(Index n = N) {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename FixedSegmentReturnType<N>::Type tail(Index n = N) {
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
return typename FixedSegmentReturnType<N>::Type(derived(), size() - n, n);
}
/// This is the const version of tail<int>.
template <int N>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstFixedSegmentReturnType<N>::Type tail(Index n = N) const {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE typename ConstFixedSegmentReturnType<N>::Type tail(Index n = N) const {
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
return typename ConstFixedSegmentReturnType<N>::Type(derived(), size() - n, n);
}
@@ -1317,21 +1326,21 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstFixedSegmentReturnType<N>::T
/// \returns the \a outer -th column (resp. row) of the matrix \c *this if \c *this
/// is col-major (resp. row-major).
///
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE InnerVectorReturnType innerVector(Index outer) {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE InnerVectorReturnType innerVector(Index outer) {
return InnerVectorReturnType(derived(), outer);
}
/// \returns the \a outer -th column (resp. row) of the matrix \c *this if \c *this
/// is col-major (resp. row-major). Read-only.
///
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ConstInnerVectorReturnType innerVector(Index outer) const {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const ConstInnerVectorReturnType innerVector(Index outer) const {
return ConstInnerVectorReturnType(derived(), outer);
}
/// \returns the \a outer -th column (resp. row) of the matrix \c *this if \c *this
/// is col-major (resp. row-major).
///
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE InnerVectorsReturnType innerVectors(Index outerStart, Index outerSize) {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE InnerVectorsReturnType innerVectors(Index outerStart, Index outerSize) {
return Block<Derived, Dynamic, Dynamic, true>(derived(), IsRowMajor ? outerStart : 0, IsRowMajor ? 0 : outerStart,
IsRowMajor ? outerSize : rows(), IsRowMajor ? cols() : outerSize);
}
@@ -1339,8 +1348,8 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE InnerVectorsReturnType innerVectors(Index
/// \returns the \a outer -th column (resp. row) of the matrix \c *this if \c *this
/// is col-major (resp. row-major). Read-only.
///
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ConstInnerVectorsReturnType innerVectors(Index outerStart,
Index outerSize) const {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const ConstInnerVectorsReturnType innerVectors(Index outerStart,
Index outerSize) const {
return Block<const Derived, Dynamic, Dynamic, true>(derived(), IsRowMajor ? outerStart : 0,
IsRowMajor ? 0 : outerStart, IsRowMajor ? outerSize : rows(),
IsRowMajor ? cols() : outerSize);
@@ -1350,14 +1359,15 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ConstInnerVectorsReturnType innerVec
* \sa subVectors()
*/
template <DirectionType Direction>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::conditional_t<Direction == Vertical, ColXpr, RowXpr> subVector(Index i) {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE std::conditional_t<Direction == Vertical, ColXpr, RowXpr> subVector(
Index i) {
return std::conditional_t<Direction == Vertical, ColXpr, RowXpr>(derived(), i);
}
/** This is the const version of subVector(Index) */
template <DirectionType Direction>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::conditional_t<Direction == Vertical, ConstColXpr, ConstRowXpr> subVector(
Index i) const {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE std::conditional_t<Direction == Vertical, ConstColXpr, ConstRowXpr>
subVector(Index i) const {
return std::conditional_t<Direction == Vertical, ConstColXpr, ConstRowXpr>(derived(), i);
}

View File

@@ -38,8 +38,9 @@ EIGEN_MAKE_CWISE_BINARY_OP(operator+, sum)
* \sa class CwiseBinaryOp, operator+(), operator-(), cwiseProduct()
*/
template <typename CustomBinaryOp, typename OtherDerived>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseBinaryOp<CustomBinaryOp, const Derived, const OtherDerived> binaryExpr(
const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other, const CustomBinaryOp& func = CustomBinaryOp()) const {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseBinaryOp<CustomBinaryOp, const Derived, const OtherDerived>
binaryExpr(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other,
const CustomBinaryOp& func = CustomBinaryOp()) const {
return CwiseBinaryOp<CustomBinaryOp, const Derived, const OtherDerived>(derived(), other.derived(), func);
}
@@ -63,7 +64,8 @@ EIGEN_MAKE_SCALAR_BINARY_OP_ONTHERIGHT(operator/, quotient)
* \sa operator||(), select()
*/
template <typename OtherDerived>
EIGEN_DEVICE_FUNC inline const CwiseBinaryOp<internal::scalar_boolean_and_op<Scalar>, const Derived, const OtherDerived>
EIGEN_DEVICE_FUNC constexpr inline const CwiseBinaryOp<internal::scalar_boolean_and_op<Scalar>, const Derived,
const OtherDerived>
operator&&(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
return CwiseBinaryOp<internal::scalar_boolean_and_op<Scalar>, const Derived, const OtherDerived>(derived(),
other.derived());
@@ -77,7 +79,8 @@ operator&&(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
* \sa operator&&(), select()
*/
template <typename OtherDerived>
EIGEN_DEVICE_FUNC inline const CwiseBinaryOp<internal::scalar_boolean_or_op<Scalar>, const Derived, const OtherDerived>
EIGEN_DEVICE_FUNC constexpr inline const CwiseBinaryOp<internal::scalar_boolean_or_op<Scalar>, const Derived,
const OtherDerived>
operator||(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
return CwiseBinaryOp<internal::scalar_boolean_or_op<Scalar>, const Derived, const OtherDerived>(derived(),
other.derived());
@@ -88,7 +91,8 @@ operator||(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
* \sa operator|(), operator^()
*/
template <typename OtherDerived>
EIGEN_DEVICE_FUNC inline const CwiseBinaryOp<internal::scalar_bitwise_and_op<Scalar>, const Derived, const OtherDerived>
EIGEN_DEVICE_FUNC constexpr inline const CwiseBinaryOp<internal::scalar_bitwise_and_op<Scalar>, const Derived,
const OtherDerived>
operator&(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
return CwiseBinaryOp<internal::scalar_bitwise_and_op<Scalar>, const Derived, const OtherDerived>(derived(),
other.derived());
@@ -99,7 +103,8 @@ operator&(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
* \sa operator&(), operator^()
*/
template <typename OtherDerived>
EIGEN_DEVICE_FUNC inline const CwiseBinaryOp<internal::scalar_bitwise_or_op<Scalar>, const Derived, const OtherDerived>
EIGEN_DEVICE_FUNC constexpr inline const CwiseBinaryOp<internal::scalar_bitwise_or_op<Scalar>, const Derived,
const OtherDerived>
operator|(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
return CwiseBinaryOp<internal::scalar_bitwise_or_op<Scalar>, const Derived, const OtherDerived>(derived(),
other.derived());
@@ -109,7 +114,8 @@ operator|(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
* \sa operator&(), operator|()
*/
template <typename OtherDerived>
EIGEN_DEVICE_FUNC inline const CwiseBinaryOp<internal::scalar_bitwise_xor_op<Scalar>, const Derived, const OtherDerived>
EIGEN_DEVICE_FUNC constexpr inline const CwiseBinaryOp<internal::scalar_bitwise_xor_op<Scalar>, const Derived,
const OtherDerived>
operator^(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
return CwiseBinaryOp<internal::scalar_bitwise_xor_op<Scalar>, const Derived, const OtherDerived>(derived(),
other.derived());

View File

@@ -37,7 +37,7 @@ typedef CwiseUnaryOp<internal::scalar_opposite_op<Scalar>, const Derived> Negati
///
EIGEN_DOC_UNARY_ADDONS(operator-, opposite)
///
EIGEN_DEVICE_FUNC inline const NegativeReturnType operator-() const { return NegativeReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const NegativeReturnType operator-() const { return NegativeReturnType(derived()); }
template <class NewType>
struct CastXpr {
@@ -55,7 +55,7 @@ EIGEN_DOC_UNARY_ADDONS(cast, conversion function)
/// \sa class CwiseUnaryOp
///
template <typename NewType>
EIGEN_DEVICE_FUNC typename CastXpr<NewType>::Type cast() const {
EIGEN_DEVICE_FUNC constexpr typename CastXpr<NewType>::Type cast() const {
return typename CastXpr<NewType>::Type(derived());
}
@@ -64,7 +64,7 @@ EIGEN_DEVICE_FUNC typename CastXpr<NewType>::Type cast() const {
EIGEN_DOC_UNARY_ADDONS(conjugate, complex conjugate)
///
/// \sa <a href="group__CoeffwiseMathFunctions.html#cwisetable_conj">Math functions</a>, MatrixBase::adjoint()
EIGEN_DEVICE_FUNC inline ConjugateReturnType conjugate() const { return ConjugateReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline ConjugateReturnType conjugate() const { return ConjugateReturnType(derived()); }
/// \returns an expression of the complex conjugate of \c *this if Cond==true, returns derived() otherwise.
///
@@ -72,7 +72,7 @@ EIGEN_DOC_UNARY_ADDONS(conjugate, complex conjugate)
///
/// \sa conjugate()
template <bool Cond>
EIGEN_DEVICE_FUNC inline std::conditional_t<Cond, ConjugateReturnType, const Derived&> conjugateIf() const {
EIGEN_DEVICE_FUNC constexpr inline std::conditional_t<Cond, ConjugateReturnType, const Derived&> conjugateIf() const {
typedef std::conditional_t<Cond, ConjugateReturnType, const Derived&> ReturnType;
return ReturnType(derived());
}
@@ -82,14 +82,14 @@ EIGEN_DEVICE_FUNC inline std::conditional_t<Cond, ConjugateReturnType, const Der
EIGEN_DOC_UNARY_ADDONS(real, real part function)
///
/// \sa imag()
EIGEN_DEVICE_FUNC inline RealReturnType real() const { return RealReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline RealReturnType real() const { return RealReturnType(derived()); }
/// \returns an read-only expression of the imaginary part of \c *this.
///
EIGEN_DOC_UNARY_ADDONS(imag, imaginary part function)
///
/// \sa real()
EIGEN_DEVICE_FUNC inline const ImagReturnType imag() const { return ImagReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const ImagReturnType imag() const { return ImagReturnType(derived()); }
/// \brief Apply a unary operator coefficient-wise
/// \param[in] func Functor implementing the unary operator
@@ -113,7 +113,7 @@ EIGEN_DOC_UNARY_ADDONS(unaryExpr, unary function)
/// \sa unaryViewExpr, binaryExpr, class CwiseUnaryOp
///
template <typename CustomUnaryOp>
EIGEN_DEVICE_FUNC inline const CwiseUnaryOp<CustomUnaryOp, const Derived> unaryExpr(
EIGEN_DEVICE_FUNC constexpr inline const CwiseUnaryOp<CustomUnaryOp, const Derived> unaryExpr(
const CustomUnaryOp& func = CustomUnaryOp()) const {
return CwiseUnaryOp<CustomUnaryOp, const Derived>(derived(), func);
}
@@ -132,7 +132,7 @@ EIGEN_DOC_UNARY_ADDONS(unaryViewExpr, unary function)
/// \sa unaryExpr, binaryExpr class CwiseUnaryOp
///
template <typename CustomViewOp>
EIGEN_DEVICE_FUNC inline const CwiseUnaryView<CustomViewOp, const Derived> unaryViewExpr(
EIGEN_DEVICE_FUNC constexpr inline const CwiseUnaryView<CustomViewOp, const Derived> unaryViewExpr(
const CustomViewOp& func = CustomViewOp()) const {
return CwiseUnaryView<CustomViewOp, const Derived>(derived(), func);
}
@@ -147,7 +147,7 @@ EIGEN_DOC_UNARY_ADDONS(unaryViewExpr, unary function)
/// \sa unaryExpr, binaryExpr class CwiseUnaryOp
///
template <typename CustomViewOp>
EIGEN_DEVICE_FUNC inline CwiseUnaryView<CustomViewOp, Derived> unaryViewExpr(
EIGEN_DEVICE_FUNC constexpr inline CwiseUnaryView<CustomViewOp, Derived> unaryViewExpr(
const CustomViewOp& func = CustomViewOp()) {
return CwiseUnaryView<CustomViewOp, Derived>(derived(), func);
}
@@ -157,11 +157,11 @@ EIGEN_DEVICE_FUNC inline CwiseUnaryView<CustomViewOp, Derived> unaryViewExpr(
EIGEN_DOC_UNARY_ADDONS(real, real part function)
///
/// \sa imag()
EIGEN_DEVICE_FUNC inline NonConstRealReturnType real() { return NonConstRealReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline NonConstRealReturnType real() { return NonConstRealReturnType(derived()); }
/// \returns a non const expression of the imaginary part of \c *this.
///
EIGEN_DOC_UNARY_ADDONS(imag, imaginary part function)
///
/// \sa real()
EIGEN_DEVICE_FUNC inline NonConstImagReturnType imag() { return NonConstImagReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline NonConstImagReturnType imag() { return NonConstImagReturnType(derived()); }

View File

@@ -18,7 +18,7 @@
* \sa class CwiseBinaryOp, cwiseAbs2
*/
template <typename OtherDerived>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const EIGEN_CWISE_BINARY_RETURN_TYPE(Derived, OtherDerived, product)
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const EIGEN_CWISE_BINARY_RETURN_TYPE(Derived, OtherDerived, product)
cwiseProduct(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
return EIGEN_CWISE_BINARY_RETURN_TYPE(Derived, OtherDerived, product)(derived(), other.derived());
}
@@ -55,7 +55,7 @@ using CwiseBinaryGreaterOrEqualReturnType =
* \sa cwiseNotEqual(), isApprox(), isMuchSmallerThan()
*/
template <typename OtherDerived>
EIGEN_DEVICE_FUNC inline const CwiseBinaryEqualReturnType<OtherDerived> cwiseEqual(
EIGEN_DEVICE_FUNC constexpr inline const CwiseBinaryEqualReturnType<OtherDerived> cwiseEqual(
const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
return CwiseBinaryEqualReturnType<OtherDerived>(derived(), other.derived());
}
@@ -73,35 +73,35 @@ EIGEN_DEVICE_FUNC inline const CwiseBinaryEqualReturnType<OtherDerived> cwiseEqu
* \sa cwiseEqual(), isApprox(), isMuchSmallerThan()
*/
template <typename OtherDerived>
EIGEN_DEVICE_FUNC inline const CwiseBinaryNotEqualReturnType<OtherDerived> cwiseNotEqual(
EIGEN_DEVICE_FUNC constexpr inline const CwiseBinaryNotEqualReturnType<OtherDerived> cwiseNotEqual(
const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
return CwiseBinaryNotEqualReturnType<OtherDerived>(derived(), other.derived());
}
/** \returns an expression of the coefficient-wise < operator of *this and \a other */
template <typename OtherDerived>
EIGEN_DEVICE_FUNC inline const CwiseBinaryLessReturnType<OtherDerived> cwiseLess(
EIGEN_DEVICE_FUNC constexpr inline const CwiseBinaryLessReturnType<OtherDerived> cwiseLess(
const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
return CwiseBinaryLessReturnType<OtherDerived>(derived(), other.derived());
}
/** \returns an expression of the coefficient-wise > operator of *this and \a other */
template <typename OtherDerived>
EIGEN_DEVICE_FUNC inline const CwiseBinaryGreaterReturnType<OtherDerived> cwiseGreater(
EIGEN_DEVICE_FUNC constexpr inline const CwiseBinaryGreaterReturnType<OtherDerived> cwiseGreater(
const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
return CwiseBinaryGreaterReturnType<OtherDerived>(derived(), other.derived());
}
/** \returns an expression of the coefficient-wise <= operator of *this and \a other */
template <typename OtherDerived>
EIGEN_DEVICE_FUNC inline const CwiseBinaryLessOrEqualReturnType<OtherDerived> cwiseLessOrEqual(
EIGEN_DEVICE_FUNC constexpr inline const CwiseBinaryLessOrEqualReturnType<OtherDerived> cwiseLessOrEqual(
const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
return CwiseBinaryLessOrEqualReturnType<OtherDerived>(derived(), other.derived());
}
/** \returns an expression of the coefficient-wise >= operator of *this and \a other */
template <typename OtherDerived>
EIGEN_DEVICE_FUNC inline const CwiseBinaryGreaterOrEqualReturnType<OtherDerived> cwiseGreaterOrEqual(
EIGEN_DEVICE_FUNC constexpr inline const CwiseBinaryGreaterOrEqualReturnType<OtherDerived> cwiseGreaterOrEqual(
const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
return CwiseBinaryGreaterOrEqualReturnType<OtherDerived>(derived(), other.derived());
}
@@ -114,7 +114,7 @@ EIGEN_DEVICE_FUNC inline const CwiseBinaryGreaterOrEqualReturnType<OtherDerived>
* \sa class CwiseBinaryOp, max()
*/
template <int NaNPropagation = PropagateFast, typename OtherDerived>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const
CwiseBinaryOp<internal::scalar_min_op<Scalar, Scalar, NaNPropagation>, const Derived, const OtherDerived>
cwiseMin(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
return CwiseBinaryOp<internal::scalar_min_op<Scalar, Scalar, NaNPropagation>, const Derived, const OtherDerived>(
@@ -126,7 +126,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
* \sa class CwiseBinaryOp, min()
*/
template <int NaNPropagation = PropagateFast>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const
CwiseBinaryOp<internal::scalar_min_op<Scalar, Scalar, NaNPropagation>, const Derived, const ConstantReturnType>
cwiseMin(const Scalar& other) const {
return cwiseMin<NaNPropagation>(Derived::Constant(rows(), cols(), other));
@@ -140,7 +140,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
* \sa class CwiseBinaryOp, min()
*/
template <int NaNPropagation = PropagateFast, typename OtherDerived>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const
CwiseBinaryOp<internal::scalar_max_op<Scalar, Scalar, NaNPropagation>, const Derived, const OtherDerived>
cwiseMax(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
return CwiseBinaryOp<internal::scalar_max_op<Scalar, Scalar, NaNPropagation>, const Derived, const OtherDerived>(
@@ -152,7 +152,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
* \sa class CwiseBinaryOp, min()
*/
template <int NaNPropagation = PropagateFast>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const
CwiseBinaryOp<internal::scalar_max_op<Scalar, Scalar, NaNPropagation>, const Derived, const ConstantReturnType>
cwiseMax(const Scalar& other) const {
return cwiseMax<NaNPropagation>(Derived::Constant(rows(), cols(), other));
@@ -166,7 +166,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
* \sa class CwiseBinaryOp, cwiseProduct(), cwiseInverse()
*/
template <typename OtherDerived>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const
CwiseBinaryOp<internal::scalar_quotient_op<Scalar>, const Derived, const OtherDerived>
cwiseQuotient(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
return CwiseBinaryOp<internal::scalar_quotient_op<Scalar>, const Derived, const OtherDerived>(derived(),
@@ -195,7 +195,7 @@ using CwiseScalarGreaterOrEqualReturnType =
*
* \sa cwiseEqual(const MatrixBase<OtherDerived> &) const
*/
EIGEN_DEVICE_FUNC inline const CwiseScalarEqualReturnType cwiseEqual(const Scalar& s) const {
EIGEN_DEVICE_FUNC constexpr inline const CwiseScalarEqualReturnType cwiseEqual(const Scalar& s) const {
return CwiseScalarEqualReturnType(derived(), Derived::Constant(rows(), cols(), s));
}
@@ -208,27 +208,28 @@ EIGEN_DEVICE_FUNC inline const CwiseScalarEqualReturnType cwiseEqual(const Scala
*
* \sa cwiseEqual(const MatrixBase<OtherDerived> &) const
*/
EIGEN_DEVICE_FUNC inline const CwiseScalarNotEqualReturnType cwiseNotEqual(const Scalar& s) const {
EIGEN_DEVICE_FUNC constexpr inline const CwiseScalarNotEqualReturnType cwiseNotEqual(const Scalar& s) const {
return CwiseScalarNotEqualReturnType(derived(), Derived::Constant(rows(), cols(), s));
}
/** \returns an expression of the coefficient-wise < operator of \c *this and a scalar \a s */
EIGEN_DEVICE_FUNC inline const CwiseScalarLessReturnType cwiseLess(const Scalar& s) const {
EIGEN_DEVICE_FUNC constexpr inline const CwiseScalarLessReturnType cwiseLess(const Scalar& s) const {
return CwiseScalarLessReturnType(derived(), Derived::Constant(rows(), cols(), s));
}
/** \returns an expression of the coefficient-wise > operator of \c *this and a scalar \a s */
EIGEN_DEVICE_FUNC inline const CwiseScalarGreaterReturnType cwiseGreater(const Scalar& s) const {
EIGEN_DEVICE_FUNC constexpr inline const CwiseScalarGreaterReturnType cwiseGreater(const Scalar& s) const {
return CwiseScalarGreaterReturnType(derived(), Derived::Constant(rows(), cols(), s));
}
/** \returns an expression of the coefficient-wise <= operator of \c *this and a scalar \a s */
EIGEN_DEVICE_FUNC inline const CwiseScalarLessOrEqualReturnType cwiseLessOrEqual(const Scalar& s) const {
EIGEN_DEVICE_FUNC constexpr inline const CwiseScalarLessOrEqualReturnType cwiseLessOrEqual(const Scalar& s) const {
return CwiseScalarLessOrEqualReturnType(derived(), Derived::Constant(rows(), cols(), s));
}
/** \returns an expression of the coefficient-wise >= operator of \c *this and a scalar \a s */
EIGEN_DEVICE_FUNC inline const CwiseScalarGreaterOrEqualReturnType cwiseGreaterOrEqual(const Scalar& s) const {
EIGEN_DEVICE_FUNC constexpr inline const CwiseScalarGreaterOrEqualReturnType cwiseGreaterOrEqual(
const Scalar& s) const {
return CwiseScalarGreaterOrEqualReturnType(derived(), Derived::Constant(rows(), cols(), s));
}
@@ -252,37 +253,37 @@ using CwiseBinaryTypedGreaterOrEqualReturnType =
CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GE, true>, const Derived, const OtherDerived>;
template <typename OtherDerived>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseBinaryTypedEqualReturnType<OtherDerived> cwiseTypedEqual(
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseBinaryTypedEqualReturnType<OtherDerived> cwiseTypedEqual(
const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
return CwiseBinaryTypedEqualReturnType<OtherDerived>(derived(), other.derived());
}
template <typename OtherDerived>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseBinaryTypedNotEqualReturnType<OtherDerived> cwiseTypedNotEqual(
const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseBinaryTypedNotEqualReturnType<OtherDerived>
cwiseTypedNotEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
return CwiseBinaryTypedNotEqualReturnType<OtherDerived>(derived(), other.derived());
}
template <typename OtherDerived>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseBinaryTypedLessReturnType<OtherDerived> cwiseTypedLess(
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseBinaryTypedLessReturnType<OtherDerived> cwiseTypedLess(
const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
return CwiseBinaryTypedLessReturnType<OtherDerived>(derived(), other.derived());
}
template <typename OtherDerived>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseBinaryTypedGreaterReturnType<OtherDerived> cwiseTypedGreater(
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseBinaryTypedGreaterReturnType<OtherDerived> cwiseTypedGreater(
const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
return CwiseBinaryTypedGreaterReturnType<OtherDerived>(derived(), other.derived());
}
template <typename OtherDerived>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseBinaryTypedLessOrEqualReturnType<OtherDerived> cwiseTypedLessOrEqual(
const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseBinaryTypedLessOrEqualReturnType<OtherDerived>
cwiseTypedLessOrEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
return CwiseBinaryTypedLessOrEqualReturnType<OtherDerived>(derived(), other.derived());
}
template <typename OtherDerived>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseBinaryTypedGreaterOrEqualReturnType<OtherDerived>
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseBinaryTypedGreaterOrEqualReturnType<OtherDerived>
cwiseTypedGreaterOrEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& other) const {
return CwiseBinaryTypedGreaterOrEqualReturnType<OtherDerived>(derived(), other.derived());
}
@@ -303,29 +304,32 @@ using CwiseScalarTypedGreaterOrEqualReturnType =
CwiseBinaryOp<internal::scalar_cmp_op<Scalar, Scalar, internal::cmp_GE, true>, const Derived,
const ConstantReturnType>;
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseScalarTypedEqualReturnType cwiseTypedEqual(const Scalar& s) const {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseScalarTypedEqualReturnType
cwiseTypedEqual(const Scalar& s) const {
return CwiseScalarTypedEqualReturnType(derived(), ConstantReturnType(rows(), cols(), s));
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseScalarTypedNotEqualReturnType
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseScalarTypedNotEqualReturnType
cwiseTypedNotEqual(const Scalar& s) const {
return CwiseScalarTypedNotEqualReturnType(derived(), ConstantReturnType(rows(), cols(), s));
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseScalarTypedLessReturnType cwiseTypedLess(const Scalar& s) const {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseScalarTypedLessReturnType
cwiseTypedLess(const Scalar& s) const {
return CwiseScalarTypedLessReturnType(derived(), ConstantReturnType(rows(), cols(), s));
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseScalarTypedGreaterReturnType cwiseTypedGreater(const Scalar& s) const {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseScalarTypedGreaterReturnType
cwiseTypedGreater(const Scalar& s) const {
return CwiseScalarTypedGreaterReturnType(derived(), ConstantReturnType(rows(), cols(), s));
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseScalarTypedLessOrEqualReturnType
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseScalarTypedLessOrEqualReturnType
cwiseTypedLessOrEqual(const Scalar& s) const {
return CwiseScalarTypedLessOrEqualReturnType(derived(), ConstantReturnType(rows(), cols(), s));
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseScalarTypedGreaterOrEqualReturnType
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseScalarTypedGreaterOrEqualReturnType
cwiseTypedGreaterOrEqual(const Scalar& s) const {
return CwiseScalarTypedGreaterOrEqualReturnType(derived(), ConstantReturnType(rows(), cols(), s));
}

View File

@@ -30,7 +30,7 @@ EIGEN_DOC_UNARY_ADDONS(cwiseAbs, absolute value)
///
/// \sa cwiseAbs2()
///
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseAbsReturnType cwiseAbs() const {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseAbsReturnType cwiseAbs() const {
return CwiseAbsReturnType(derived());
}
@@ -43,7 +43,7 @@ EIGEN_DOC_UNARY_ADDONS(cwiseAbs2, squared absolute value)
///
/// \sa cwiseAbs()
///
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseAbs2ReturnType cwiseAbs2() const {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseAbs2ReturnType cwiseAbs2() const {
return CwiseAbs2ReturnType(derived());
}
@@ -56,7 +56,9 @@ EIGEN_DOC_UNARY_ADDONS(cwiseSqrt, square - root)
///
/// \sa cwisePow(), cwiseSquare(), cwiseCbrt()
///
EIGEN_DEVICE_FUNC inline const CwiseSqrtReturnType cwiseSqrt() const { return CwiseSqrtReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const CwiseSqrtReturnType cwiseSqrt() const {
return CwiseSqrtReturnType(derived());
}
/// \returns an expression of the coefficient-wise cube root of *this.
///
@@ -64,7 +66,9 @@ EIGEN_DOC_UNARY_ADDONS(cwiseCbrt, cube - root)
///
/// \sa cwiseSqrt(), cwiseSquare(), cwisePow()
///
EIGEN_DEVICE_FUNC inline const CwiseCbrtReturnType cwiseCbrt() const { return CwiseCbrtReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const CwiseCbrtReturnType cwiseCbrt() const {
return CwiseCbrtReturnType(derived());
}
/// \returns an expression of the coefficient-wise square of *this.
///
@@ -72,7 +76,9 @@ EIGEN_DOC_UNARY_ADDONS(cwiseSquare, square)
///
/// \sa cwisePow(), cwiseSqrt(), cwiseCbrt()
///
EIGEN_DEVICE_FUNC inline const CwiseSquareReturnType cwiseSquare() const { return CwiseSquareReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const CwiseSquareReturnType cwiseSquare() const {
return CwiseSquareReturnType(derived());
}
/// \returns an expression of the coefficient-wise signum of *this.
///
@@ -81,7 +87,9 @@ EIGEN_DEVICE_FUNC inline const CwiseSquareReturnType cwiseSquare() const { retur
///
EIGEN_DOC_UNARY_ADDONS(cwiseSign, sign function)
///
EIGEN_DEVICE_FUNC inline const CwiseSignReturnType cwiseSign() const { return CwiseSignReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const CwiseSignReturnType cwiseSign() const {
return CwiseSignReturnType(derived());
}
/// \returns an expression of the coefficient-wise inverse of *this.
///
@@ -92,7 +100,9 @@ EIGEN_DOC_UNARY_ADDONS(cwiseInverse, inverse)
///
/// \sa cwiseProduct()
///
EIGEN_DEVICE_FUNC inline const CwiseInverseReturnType cwiseInverse() const { return CwiseInverseReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const CwiseInverseReturnType cwiseInverse() const {
return CwiseInverseReturnType(derived());
}
/// \returns an expression of the coefficient-wise phase angle of \c *this
///
@@ -101,9 +111,9 @@ EIGEN_DEVICE_FUNC inline const CwiseInverseReturnType cwiseInverse() const { ret
///
EIGEN_DOC_UNARY_ADDONS(cwiseArg, arg)
EIGEN_DEVICE_FUNC inline const CwiseArgReturnType cwiseArg() const { return CwiseArgReturnType(derived()); }
EIGEN_DEVICE_FUNC constexpr inline const CwiseArgReturnType cwiseArg() const { return CwiseArgReturnType(derived()); }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseCArgReturnType cwiseCArg() const {
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const CwiseCArgReturnType cwiseCArg() const {
return CwiseCArgReturnType(derived());
}
@@ -113,6 +123,7 @@ using CwisePowReturnType =
CwiseUnaryOp<internal::scalar_unary_pow_op<Scalar, ScalarExponent>, const Derived>>;
template <typename ScalarExponent>
EIGEN_DEVICE_FUNC inline const CwisePowReturnType<ScalarExponent> cwisePow(const ScalarExponent& exponent) const {
EIGEN_DEVICE_FUNC constexpr inline const CwisePowReturnType<ScalarExponent> cwisePow(
const ScalarExponent& exponent) const {
return CwisePowReturnType<ScalarExponent>(derived(), internal::scalar_unary_pow_op<Scalar, ScalarExponent>(exponent));
}

View File

@@ -27,11 +27,11 @@
/// \sa class Reshaped, fix, fix<N>(int)
///
template <int Order = ColMajor, typename NRowsType, typename NColsType>
EIGEN_DEVICE_FUNC inline Reshaped<Derived, ...> reshaped(NRowsType nRows, NColsType nCols);
EIGEN_DEVICE_FUNC constexpr inline Reshaped<Derived, ...> reshaped(NRowsType nRows, NColsType nCols);
/// This is the const version of reshaped(NRowsType,NColsType).
template <int Order = ColMajor, typename NRowsType, typename NColsType>
EIGEN_DEVICE_FUNC inline const Reshaped<const Derived, ...> reshaped(NRowsType nRows, NColsType nCols) const;
EIGEN_DEVICE_FUNC constexpr inline const Reshaped<const Derived, ...> reshaped(NRowsType nRows, NColsType nCols) const;
/// \returns an expression of \c *this with columns (or rows) stacked to a linear column vector
///
@@ -56,11 +56,11 @@ EIGEN_DEVICE_FUNC inline const Reshaped<const Derived, ...> reshaped(NRowsType n
/// \sa reshaped(NRowsType,NColsType), class Reshaped
///
template <int Order = ColMajor>
EIGEN_DEVICE_FUNC inline Reshaped<Derived, ...> reshaped();
EIGEN_DEVICE_FUNC constexpr inline Reshaped<Derived, ...> reshaped();
/// This is the const version of reshaped().
template <int Order = ColMajor>
EIGEN_DEVICE_FUNC inline const Reshaped<const Derived, ...> reshaped() const;
EIGEN_DEVICE_FUNC constexpr inline const Reshaped<const Derived, ...> reshaped() const;
#else
@@ -79,7 +79,7 @@ EIGEN_DEVICE_FUNC inline const Reshaped<const Derived, ...> reshaped() const;
#endif
template <typename NRowsType, typename NColsType>
EIGEN_DEVICE_FUNC inline Reshaped<
EIGEN_DEVICE_FUNC constexpr inline Reshaped<
EIGEN_RESHAPED_METHOD_CONST Derived,
internal::get_compiletime_reshape_size<NRowsType, NColsType, SizeAtCompileTime>::value,
internal::get_compiletime_reshape_size<NColsType, NRowsType, SizeAtCompileTime>::value>
@@ -92,7 +92,7 @@ reshaped(NRowsType nRows, NColsType nCols) EIGEN_RESHAPED_METHOD_CONST {
}
template <int Order, typename NRowsType, typename NColsType>
EIGEN_DEVICE_FUNC inline Reshaped<
EIGEN_DEVICE_FUNC constexpr inline Reshaped<
EIGEN_RESHAPED_METHOD_CONST Derived,
internal::get_compiletime_reshape_size<NRowsType, NColsType, SizeAtCompileTime>::value,
internal::get_compiletime_reshape_size<NColsType, NRowsType, SizeAtCompileTime>::value,
@@ -108,14 +108,14 @@ reshaped(NRowsType nRows, NColsType nCols) EIGEN_RESHAPED_METHOD_CONST {
// Views as linear vectors
EIGEN_DEVICE_FUNC inline Reshaped<EIGEN_RESHAPED_METHOD_CONST Derived, SizeAtCompileTime, 1> reshaped()
EIGEN_DEVICE_FUNC constexpr inline Reshaped<EIGEN_RESHAPED_METHOD_CONST Derived, SizeAtCompileTime, 1> reshaped()
EIGEN_RESHAPED_METHOD_CONST {
return Reshaped<EIGEN_RESHAPED_METHOD_CONST Derived, SizeAtCompileTime, 1>(derived(), size(), 1);
}
template <int Order>
EIGEN_DEVICE_FUNC inline Reshaped<EIGEN_RESHAPED_METHOD_CONST Derived, SizeAtCompileTime, 1,
internal::get_compiletime_reshape_order(Flags, Order)>
EIGEN_DEVICE_FUNC constexpr inline Reshaped<EIGEN_RESHAPED_METHOD_CONST Derived, SizeAtCompileTime, 1,
internal::get_compiletime_reshape_order(Flags, Order)>
reshaped() EIGEN_RESHAPED_METHOD_CONST {
EIGEN_STATIC_ASSERT(Order == RowMajor || Order == ColMajor || Order == AutoOrder, INVALID_TEMPLATE_PARAMETER);
return Reshaped<EIGEN_RESHAPED_METHOD_CONST Derived, SizeAtCompileTime, 1,