10 #ifndef EIGEN_ARRAYBASE_H 11 #define EIGEN_ARRAYBASE_H 14 #include "./InternalHeaderCheck.h" 18 template <
typename ExpressionType>
43 template <
typename Derived>
46 #ifndef EIGEN_PARSED_BY_DOXYGEN 50 typedef ArrayBase Eigen_BaseClassForSpecializationOfGlobalMathFuncImpl;
52 typedef typename internal::traits<Derived>::StorageKind StorageKind;
53 typedef typename internal::traits<Derived>::Scalar
Scalar;
54 typedef typename internal::packet_traits<Scalar>::type PacketScalar;
58 using Base::ColsAtCompileTime;
60 using Base::IsVectorAtCompileTime;
61 using Base::MaxColsAtCompileTime;
62 using Base::MaxRowsAtCompileTime;
63 using Base::MaxSizeAtCompileTime;
64 using Base::RowsAtCompileTime;
65 using Base::SizeAtCompileTime;
70 using Base::const_cast_derived;
72 using Base::lazyAssign;
75 using Base::operator-;
76 using Base::operator=;
77 using Base::operator+=;
78 using Base::operator-=;
79 using Base::operator*=;
80 using Base::operator/=;
82 typedef typename Base::CoeffReturnType CoeffReturnType;
88 #endif // not EIGEN_PARSED_BY_DOXYGEN 90 #define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::ArrayBase 91 #define EIGEN_DOC_UNARY_ADDONS(X, Y) 92 #include "../plugins/MatrixCwiseUnaryOps.inc" 93 #include "../plugins/ArrayCwiseUnaryOps.inc" 94 #include "../plugins/CommonCwiseBinaryOps.inc" 95 #include "../plugins/MatrixCwiseBinaryOps.inc" 96 #include "../plugins/ArrayCwiseBinaryOps.inc" 97 #ifdef EIGEN_ARRAYBASE_PLUGIN 98 #include EIGEN_ARRAYBASE_PLUGIN 100 #undef EIGEN_CURRENT_STORAGE_BASE_CLASS 101 #undef EIGEN_DOC_UNARY_ADDONS 118 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator+=(
const Scalar& other) {
119 internal::call_assignment(this->
derived(), PlainObject::Constant(
rows(),
cols(), other),
120 internal::add_assign_op<Scalar, Scalar>());
124 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator-=(
const Scalar& other) {
125 internal::call_assignment(this->
derived(), PlainObject::Constant(
rows(),
cols(), other),
126 internal::sub_assign_op<Scalar, Scalar>());
134 template <
typename OtherDerived>
136 call_assignment(
derived(), other.
derived(), internal::add_assign_op<Scalar, typename OtherDerived::Scalar>());
144 template <
typename OtherDerived>
146 call_assignment(
derived(), other.
derived(), internal::sub_assign_op<Scalar, typename OtherDerived::Scalar>());
154 template <
typename OtherDerived>
156 call_assignment(
derived(), other.
derived(), internal::mul_assign_op<Scalar, typename OtherDerived::Scalar>());
164 template <
typename OtherDerived>
166 call_assignment(
derived(), other.
derived(), internal::div_assign_op<Scalar, typename OtherDerived::Scalar>());
185 EIGEN_DEFAULT_COPY_CONSTRUCTOR(
ArrayBase)
186 EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(
ArrayBase)
191 template <typename OtherDerived>
196 template <typename OtherDerived>
197 Derived& operator+=(const
MatrixBase<OtherDerived>&) {
198 EIGEN_STATIC_ASSERT(std::ptrdiff_t(
sizeof(
typename OtherDerived::Scalar)) == -1,
199 YOU_CANNOT_MIX_ARRAYS_AND_MATRICES);
203 template <
typename OtherDerived>
205 EIGEN_STATIC_ASSERT(std::ptrdiff_t(
sizeof(
typename OtherDerived::Scalar)) == -1,
206 YOU_CANNOT_MIX_ARRAYS_AND_MATRICES);
213 #endif // EIGEN_ARRAYBASE_H Generic expression of a matrix where all coefficients are defined by a functor.
Definition: CwiseNullaryOp.h:63
constexpr Derived & derived()
Definition: EigenBase.h:49
internal::traits< Derived >::Scalar Scalar
Definition: DenseBase.h:62
Derived & operator=(const Scalar &value)
Definition: ArrayBase.h:113
std::conditional_t< internal::is_same< typename internal::traits< Derived >::XprKind, MatrixXpr >::value, PlainMatrix, PlainArray > PlainObject
The plain matrix or array type corresponding to this expression.
Definition: DenseBase.h:204
Namespace containing all symbols from the Eigen library.
Definition: B01_Experimental.dox:1
Derived & operator-=(const ArrayBase< OtherDerived > &other)
Definition: ArrayBase.h:145
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
Definition: NumTraits.h:232
Eigen::Index Index
The interface type of indices.
Definition: EigenBase.h:43
Base class for all dense matrices, vectors, and arrays.
Definition: DenseBase.h:38
constexpr Index rows() const noexcept
Definition: EigenBase.h:59
Derived & operator/=(const ArrayBase< OtherDerived > &other)
Definition: ArrayBase.h:165
Expression of an array as a mathematical vector or matrix.
Definition: ArrayBase.h:19
constexpr Index cols() const noexcept
Definition: EigenBase.h:61
Derived & operator*=(const ArrayBase< OtherDerived > &other)
Definition: ArrayBase.h:155
Derived & operator=(const ArrayBase &other)
Definition: ArrayBase.h:106
Derived & operator+=(const ArrayBase< OtherDerived > &other)
Definition: ArrayBase.h:135
Base class for all 1D and 2D array, and related expressions.
Definition: ArrayBase.h:44
constexpr Derived & derived()
Definition: EigenBase.h:49
MatrixWrapper< Derived > matrix()
Definition: ArrayBase.h:176
CoeffReturnType value() const
Definition: DenseBase.h:486
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:52