13 #include "./InternalHeaderCheck.h"
18 template<
typename Scalar_,
int Rows_,
int Cols_,
int Options_,
int MaxRows_,
int MaxCols_>
19 struct traits<Array<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_> > : traits<Matrix<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_> >
21 typedef ArrayXpr XprKind;
22 typedef ArrayBase<Array<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_> > XprBase;
46 template<
typename Scalar_,
int Rows_,
int Cols_,
int Options_,
int MaxRows_,
int MaxCols_>
48 :
public PlainObjectBase<Array<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_> >
53 EIGEN_DENSE_PUBLIC_INTERFACE(
Array)
55 enum { Options = Options_ };
56 typedef typename Base::PlainObject PlainObject;
59 template <
typename Derived,
typename OtherDerived,
bool IsVector>
60 friend struct internal::conservative_resize_like_impl;
62 using Base::m_storage;
76 template<
typename OtherDerived>
107 template<
typename OtherDerived>
136 EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
139 #ifndef EIGEN_PARSED_BY_DOXYGEN
143 Array(internal::constructor_without_unaligned_array_assert)
144 : Base(internal::constructor_without_unaligned_array_assert())
146 EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
151 Array(
Array&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_constructible<Scalar>::value)
152 : Base(std::move(other))
156 Array&
operator=(
Array&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_assignable<Scalar>::value)
170 template <
typename... ArgTypes>
171 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
173 :
Base(a0, a1, a2, a3, args...) {}
197 EIGEN_STRONG_INLINE
Array(
const std::initializer_list<std::initializer_list<Scalar>>& list) :
Base(list) {}
199 #ifndef EIGEN_PARSED_BY_DOXYGEN
202 EIGEN_STRONG_INLINE
explicit Array(
const T&
x)
204 Base::template _init1<T>(
x);
207 template<
typename T0,
typename T1>
209 EIGEN_STRONG_INLINE
Array(
const T0& val0,
const T1& val1)
211 this->
template _init2<T0,T1>(val0, val1);
245 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(
Array, 3)
246 m_storage.data()[0] = val0;
247 m_storage.data()[1] = val1;
248 m_storage.data()[2] = val2;
256 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(
Array, 4)
257 m_storage.data()[0] = val0;
258 m_storage.data()[1] = val1;
259 m_storage.data()[2] = val2;
260 m_storage.data()[3] = val3;
270 struct PrivateType {};
274 template<
typename OtherDerived>
277 std::enable_if_t<internal::is_convertible<typename OtherDerived::Scalar,Scalar>::value,
278 PrivateType> = PrivateType())
282 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
283 inline Index innerStride() const EIGEN_NOEXCEPT{
return 1; }
284 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
285 inline Index outerStride() const EIGEN_NOEXCEPT {
return this->
innerSize(); }
287 #ifdef EIGEN_ARRAY_PLUGIN
288 #include EIGEN_ARRAY_PLUGIN
293 template<
typename MatrixType,
typename OtherDerived,
bool SwapPo
inters>
294 friend struct internal::matrix_swap_impl;
322 #define EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, Size, SizeSuffix) \
324 typedef Array<Type, Size, Size> Array##SizeSuffix##SizeSuffix##TypeSuffix; \
326 typedef Array<Type, Size, 1> Array##SizeSuffix##TypeSuffix;
328 #define EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Type, TypeSuffix, Size) \
330 typedef Array<Type, Size, Dynamic> Array##Size##X##TypeSuffix; \
332 typedef Array<Type, Dynamic, Size> Array##X##Size##TypeSuffix;
334 #define EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(Type, TypeSuffix) \
335 EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, 2, 2) \
336 EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, 3, 3) \
337 EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, 4, 4) \
338 EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, Dynamic, X) \
339 EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Type, TypeSuffix, 2) \
340 EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Type, TypeSuffix, 3) \
341 EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Type, TypeSuffix, 4)
343 EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(
int, i)
344 EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(
float, f)
345 EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(
double, d)
346 EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(std::complex<float>, cf)
347 EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(std::complex<double>, cd)
349 #undef EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES
350 #undef EIGEN_MAKE_ARRAY_TYPEDEFS
351 #undef EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS
353 #define EIGEN_MAKE_ARRAY_TYPEDEFS(Size, SizeSuffix) \
356 template <typename Type> \
357 using Array##SizeSuffix##SizeSuffix = Array<Type, Size, Size>; \
360 template <typename Type> \
361 using Array##SizeSuffix = Array<Type, Size, 1>;
363 #define EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Size) \
366 template <typename Type> \
367 using Array##Size##X = Array<Type, Size, Dynamic>; \
370 template <typename Type> \
371 using Array##X##Size = Array<Type, Dynamic, Size>;
373 EIGEN_MAKE_ARRAY_TYPEDEFS(2, 2)
374 EIGEN_MAKE_ARRAY_TYPEDEFS(3, 3)
375 EIGEN_MAKE_ARRAY_TYPEDEFS(4, 4)
377 EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(2)
378 EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(3)
379 EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(4)
381 #undef EIGEN_MAKE_ARRAY_TYPEDEFS
382 #undef EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS
384 #define EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, SizeSuffix) \
385 using Eigen::Matrix##SizeSuffix##TypeSuffix; \
386 using Eigen::Vector##SizeSuffix##TypeSuffix; \
387 using Eigen::RowVector##SizeSuffix##TypeSuffix;
389 #define EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(TypeSuffix) \
390 EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 2) \
391 EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 3) \
392 EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 4) \
393 EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, X) \
395 #define EIGEN_USING_ARRAY_TYPEDEFS \
396 EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(i) \
397 EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(f) \
398 EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(d) \
399 EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(cf) \
400 EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(cd)
General-purpose arrays with easy API for coefficient-wise operations.
Definition: Array.h:49
Array(const Scalar &val0, const Scalar &val1, const Scalar &val2, const Scalar &val3)
Definition: Array.h:254
Array(const Array &other)
Definition: Array.h:265
Array(const EigenBase< OtherDerived > &other, std::enable_if_t< internal::is_convertible< typename OtherDerived::Scalar, Scalar >::value, PrivateType >=PrivateType())
Definition: Array.h:276
Array(const Scalar &val0, const Scalar &val1)
Array(const Scalar *data)
Constructs a fixed-sized array initialized with coefficients starting at data.
Array(const Scalar &val0, const Scalar &val1, const Scalar &val2)
Definition: Array.h:243
Array(Index rows, Index cols)
Array & operator=(const EigenBase< OtherDerived > &other)
Definition: Array.h:78
Array & operator=(const Array &other)
Definition: Array.h:118
Array()
Definition: Array.h:134
Array(const std::initializer_list< std::initializer_list< Scalar >> &list)
Constructs an array and initializes it from the coefficients given as initializer-lists grouped by ro...
Definition: Array.h:197
Array(const Scalar &a0, const Scalar &a1, const Scalar &a2, const Scalar &a3, const ArgTypes &... args)
Definition: Array.h:172
Array & operator=(const Scalar &value)
Definition: Array.h:92
Array(const Scalar &value)
Array & operator=(const DenseBase< OtherDerived > &other)
Definition: Array.h:109
Base class for all dense matrices, vectors, and arrays.
Definition: DenseBase.h:42
EIGEN_CONSTEXPR Index innerSize() const
Definition: DenseBase.h:224
internal::traits< Derived >::Scalar Scalar
Definition: DenseBase.h:61
CoeffReturnType value() const
Definition: DenseBase.h:515
Derived & derived()
Definition: EigenBase.h:48
Scalar & x()
Definition: DenseCoeffsBase.h:437
Dense storage base class for matrices and arrays.
Definition: PlainObjectBase.h:102
Derived & _set(const DenseBase< OtherDerived > &other)
Copies the value of the expression other into *this with automatic resizing.
Definition: PlainObjectBase.h:775
const Scalar & coeff(Index rowId, Index colId) const
Definition: PlainObjectBase.h:164
Scalar & coeffRef(Index rowId, Index colId)
Definition: PlainObjectBase.h:187
Derived & setConstant(Index size, const Scalar &val)
Definition: CwiseNullaryOp.h:363
const Scalar * data() const
Definition: PlainObjectBase.h:259
Derived & operator=(const PlainObjectBase &other)
Definition: PlainObjectBase.h:461
Namespace containing all symbols from the Eigen library.
Definition: Core:139
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:59
const int Dynamic
Definition: Constants.h:24
Definition: EigenBase.h:32
Eigen::Index Index
The interface type of indices.
Definition: EigenBase.h:41