16template<
typename _Scalar,
int _Rows,
int _Cols,
int _Options,
int _MaxRows,
int _MaxCols>
17struct traits<
Array<_Scalar,
_Rows,
_Cols, _Options,
_MaxRows,
_MaxCols> > :
traits<Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
44template<
typename _Scalar,
int _Rows,
int _Cols,
int _Options,
int _MaxRows,
int _MaxCols>
46 :
public PlainObjectBase<Array<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
51 EIGEN_DENSE_PUBLIC_INTERFACE(
Array)
53 enum { Options = _Options };
54 typedef typename Base::PlainObject PlainObject;
57 template <
typename Derived,
typename OtherDerived,
bool IsVector>
60 using Base::m_storage;
74 template<
typename OtherDerived>
105 template<
typename OtherDerived>
134 Base::_check_template_params();
135 EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
138#ifndef EIGEN_PARSED_BY_DOXYGEN
143 : Base(internal::constructor_without_unaligned_array_assert())
145 Base::_check_template_params();
146 EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
150#if EIGEN_HAS_RVALUE_REFERENCES
152 Array(
Array&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_constructible<Scalar>::value)
153 : Base(
std::move(other))
155 Base::_check_template_params();
158 Array&
operator=(
Array&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_assignable<Scalar>::value)
182 template <
typename... ArgTypes>
183 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
184 Array(
const Scalar& a0,
const Scalar& a1,
const Scalar& a2,
const Scalar& a3,
const ArgTypes&... args)
185 : Base(a0, a1, a2, a3, args...) {}
209 EIGEN_STRONG_INLINE
Array(
const std::initializer_list<std::initializer_list<Scalar>>& list) : Base(list) {}
212 #ifndef EIGEN_PARSED_BY_DOXYGEN
215 EIGEN_STRONG_INLINE
explicit Array(
const T& x)
217 Base::_check_template_params();
218 Base::template _init1<T>(x);
221 template<
typename T0,
typename T1>
223 EIGEN_STRONG_INLINE
Array(
const T0& val0,
const T1& val1)
225 Base::_check_template_params();
226 this->
template _init2<T0,T1>(val0, val1);
231 EIGEN_DEVICE_FUNC
explicit Array(
const Scalar *
data);
239 EIGEN_STRONG_INLINE
explicit Array(
Index dim);
242 Array(
const Scalar& value);
251 Array(
const Scalar& val0,
const Scalar& val1);
258 EIGEN_STRONG_INLINE
Array(
const Scalar&
val0,
const Scalar& val1,
const Scalar& val2)
260 Base::_check_template_params();
261 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(
Array, 3)
262 m_storage.data()[0] =
val0;
263 m_storage.data()[1] = val1;
264 m_storage.data()[2] = val2;
270 EIGEN_STRONG_INLINE
Array(
const Scalar&
val0,
const Scalar& val1,
const Scalar& val2,
const Scalar& val3)
272 Base::_check_template_params();
273 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(
Array, 4)
274 m_storage.data()[0] =
val0;
275 m_storage.data()[1] = val1;
276 m_storage.data()[2] = val2;
277 m_storage.data()[3] = val3;
287 struct PrivateType {};
291 template<
typename OtherDerived>
295 PrivateType>::type = PrivateType())
296 :
Base(other.derived())
299 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
300 inline Index innerStride()
const EIGEN_NOEXCEPT{
return 1; }
301 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
302 inline Index outerStride() const EIGEN_NOEXCEPT {
return this->innerSize(); }
304 #ifdef EIGEN_ARRAY_PLUGIN
305 #include EIGEN_ARRAY_PLUGIN
310 template<
typename MatrixType,
typename OtherDerived,
bool SwapPo
inters>
311 friend struct internal::matrix_swap_impl;
339#define EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, Size, SizeSuffix) \
341typedef Array<Type, Size, Size> Array##SizeSuffix##SizeSuffix##TypeSuffix; \
343typedef Array<Type, Size, 1> Array##SizeSuffix##TypeSuffix;
345#define EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Type, TypeSuffix, Size) \
347typedef Array<Type, Size, Dynamic> Array##Size##X##TypeSuffix; \
349typedef Array<Type, Dynamic, Size> Array##X##Size##TypeSuffix;
351#define EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(Type, TypeSuffix) \
352EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, 2, 2) \
353EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, 3, 3) \
354EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, 4, 4) \
355EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, Dynamic, X) \
356EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Type, TypeSuffix, 2) \
357EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Type, TypeSuffix, 3) \
358EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Type, TypeSuffix, 4)
360EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(
int, i)
361EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(
float, f)
362EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(
double, d)
363EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(std::complex<float>, cf)
364EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(std::complex<double>, cd)
366#undef EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES
367#undef EIGEN_MAKE_ARRAY_TYPEDEFS
368#undef EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS
372#define EIGEN_MAKE_ARRAY_TYPEDEFS(Size, SizeSuffix) \
375template <typename Type> \
376using Array##SizeSuffix##SizeSuffix = Array<Type, Size, Size>; \
379template <typename Type> \
380using Array##SizeSuffix = Array<Type, Size, 1>;
382#define EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Size) \
385template <typename Type> \
386using Array##Size##X = Array<Type, Size, Dynamic>; \
389template <typename Type> \
390using Array##X##Size = Array<Type, Dynamic, Size>;
392EIGEN_MAKE_ARRAY_TYPEDEFS(2, 2)
393EIGEN_MAKE_ARRAY_TYPEDEFS(3, 3)
394EIGEN_MAKE_ARRAY_TYPEDEFS(4, 4)
395EIGEN_MAKE_ARRAY_TYPEDEFS(Dynamic, X)
396EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(2)
397EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(3)
398EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(4)
400#undef EIGEN_MAKE_ARRAY_TYPEDEFS
401#undef EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS
405#define EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, SizeSuffix) \
406using Eigen::Matrix##SizeSuffix##TypeSuffix; \
407using Eigen::Vector##SizeSuffix##TypeSuffix; \
408using Eigen::RowVector##SizeSuffix##TypeSuffix;
410#define EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(TypeSuffix) \
411EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 2) \
412EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 3) \
413EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 4) \
414EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, X) \
416#define EIGEN_USING_ARRAY_TYPEDEFS \
417EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(i) \
418EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(f) \
419EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(d) \
420EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(cf) \
421EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(cd)
General-purpose arrays with easy API for coefficient-wise operations.
Definition Array.h:47
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array(const Array &other)
Copy constructor.
Definition Array.h:282
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array & operator=(const EigenBase< OtherDerived > &other)
The usage of using Base::operator=; fails on MSVC.
Definition Array.h:76
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array & operator=(const DenseBase< OtherDerived > &other)
Copies the value of the expression other into *this with automatic resizing.
Definition Array.h:107
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array & operator=(const Scalar &value)
Set all the entries to value.
Definition Array.h:90
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array()
Default constructor.
Definition Array.h:132
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array(const EigenBase< OtherDerived > &other, typename internal::enable_if< internal::is_convertible< typename OtherDerived::Scalar, Scalar >::value, PrivateType >::type=PrivateType())
Definition Array.h:293
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array(const Scalar &val0, const Scalar &val1, const Scalar &val2, const Scalar &val3)
constructs an initialized 4D vector with given coefficients
Definition Array.h:270
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array(const Scalar &val0, const Scalar &val1, const Scalar &val2)
constructs an initialized 3D vector with given coefficients
Definition Array.h:258
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Array & operator=(const Array &other)
This is a special case of the templated operator=.
Definition Array.h:116
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:50
Definition PlainObjectBase.h:100
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar * data() const
Definition PlainObjectBase.h:247
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator=(const PlainObjectBase &other)
This is a special case of the templated operator=.
Definition PlainObjectBase.h:449
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar & coeff(Index rowId, Index colId) const
This is an overloaded version of DenseCoeffsBase<Derived,ReadOnlyAccessors>::coeff(Index,...
Definition PlainObjectBase.h:152
EIGEN_DEVICE_FUNC Derived & setConstant(Index size, const Scalar &val)
Resizes to the given size, and sets all coefficients in this expression to the given value val.
Definition CwiseNullaryOp.h:361
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index rowId, Index colId)
This is an overloaded version of DenseCoeffsBase<Derived,WriteAccessors>::coeffRef(Index,...
Definition PlainObjectBase.h:175
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & _set(const DenseBase< OtherDerived > &other)
Copies the value of the expression other into *this with automatic resizing.
Definition PlainObjectBase.h:777
Namespace containing all symbols from the Eigen library.
Definition LDLT.h:16
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:74
The type used to identify an array expression.
Definition Constants.h:525
Definition PlainObjectBase.h:1001
Definition DenseStorage.h:25
Definition ForwardDeclarations.h:17