33template<
typename _Scalar,
int _Rows,
int _Cols,
int _Options,
int _MaxRows,
int _MaxCols>
34struct traits<Array<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> > : traits<Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
36 typedef ArrayXpr XprKind;
37 typedef ArrayBase<Array<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> > XprBase;
41template<
typename _Scalar,
int _Rows,
int _Cols,
int _Options,
int _MaxRows,
int _MaxCols>
43 :
public PlainObjectBase<Array<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
47 typedef PlainObjectBase<Array> Base;
48 EIGEN_DENSE_PUBLIC_INTERFACE(
Array)
50 enum { Options = _Options };
51 typedef typename Base::PlainObject PlainObject;
54 template <
typename Derived,
typename OtherDerived,
bool IsVector>
55 friend struct internal::conservative_resize_like_impl;
57 using Base::m_storage;
71 template<
typename OtherDerived>
86 template<
typename OtherDerived>
110 EIGEN_STRONG_INLINE
explicit Array() : Base()
112 Base::_check_template_params();
113 EIGEN_INITIALIZE_BY_ZERO_IF_THAT_OPTION_IS_ENABLED
116#ifndef EIGEN_PARSED_BY_DOXYGEN
119 Array(internal::constructor_without_unaligned_array_assert)
120 : Base(
internal::constructor_without_unaligned_array_assert())
122 Base::_check_template_params();
123 EIGEN_INITIALIZE_BY_ZERO_IF_THAT_OPTION_IS_ENABLED
133 EIGEN_STRONG_INLINE
explicit Array(Index dim)
136 Base::_check_template_params();
137 EIGEN_STATIC_ASSERT_VECTOR_ONLY(
Array)
138 eigen_assert(dim >= 0);
140 EIGEN_INITIALIZE_BY_ZERO_IF_THAT_OPTION_IS_ENABLED
143 #ifndef EIGEN_PARSED_BY_DOXYGEN
144 template<
typename T0,
typename T1>
145 EIGEN_STRONG_INLINE
Array(
const T0& x,
const T1& y)
147 Base::_check_template_params();
148 this->
template _init2<T0,T1>(x, y);
158 Array(
const Scalar& x,
const Scalar& y);
162 EIGEN_STRONG_INLINE
Array(
const Scalar& x,
const Scalar& y,
const Scalar& z)
164 Base::_check_template_params();
165 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(
Array, 3)
166 m_storage.data()[0] = x;
167 m_storage.data()[1] = y;
168 m_storage.data()[2] = z;
171 EIGEN_STRONG_INLINE
Array(
const Scalar& x,
const Scalar& y,
const Scalar& z,
const Scalar& w)
173 Base::_check_template_params();
174 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(
Array, 4)
175 m_storage.data()[0] = x;
176 m_storage.data()[1] = y;
177 m_storage.data()[2] = z;
178 m_storage.data()[3] = w;
184 template<
typename OtherDerived>
186 : Base(other.rows() * other.cols(), other.rows(), other.cols())
188 Base::_check_template_params();
189 Base::_set_noalias(other);
193 : Base(other.rows() * other.cols(), other.rows(), other.cols())
195 Base::_check_template_params();
196 Base::_set_noalias(other);
199 template<
typename OtherDerived>
200 EIGEN_STRONG_INLINE
Array(
const ReturnByValue<OtherDerived>& other)
202 Base::_check_template_params();
208 template<
typename OtherDerived>
210 : Base(other.derived().rows() * other.derived().cols(), other.derived().rows(), other.derived().cols())
212 Base::_check_template_params();
220 template<
typename OtherDerived>
222 { this->_swap(other.derived()); }
224 inline Index innerStride()
const {
return 1; }
225 inline Index outerStride()
const {
return this->
innerSize(); }
227 #ifdef EIGEN_ARRAY_PLUGIN
228 #include EIGEN_ARRAY_PLUGIN
233 template<
typename MatrixType,
typename OtherDerived,
bool SwapPo
inters>
234 friend struct internal::matrix_swap_impl;
256#define EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, Size, SizeSuffix) \
258typedef Array<Type, Size, Size> Array##SizeSuffix##SizeSuffix##TypeSuffix; \
260typedef Array<Type, Size, 1> Array##SizeSuffix##TypeSuffix;
262#define EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Type, TypeSuffix, Size) \
264typedef Array<Type, Size, Dynamic> Array##Size##X##TypeSuffix; \
266typedef Array<Type, Dynamic, Size> Array##X##Size##TypeSuffix;
268#define EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(Type, TypeSuffix) \
269EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, 2, 2) \
270EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, 3, 3) \
271EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, 4, 4) \
272EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, Dynamic, X) \
273EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Type, TypeSuffix, 2) \
274EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Type, TypeSuffix, 3) \
275EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Type, TypeSuffix, 4)
277EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(
int, i)
278EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(
float, f)
279EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(
double, d)
280EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(std::complex<float>, cf)
281EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(std::complex<double>, cd)
283#undef EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES
284#undef EIGEN_MAKE_ARRAY_TYPEDEFS
286#undef EIGEN_MAKE_ARRAY_TYPEDEFS_LARGE
288#define EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, SizeSuffix) \
289using Eigen::Matrix##SizeSuffix##TypeSuffix; \
290using Eigen::Vector##SizeSuffix##TypeSuffix; \
291using Eigen::RowVector##SizeSuffix##TypeSuffix;
293#define EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(TypeSuffix) \
294EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 2) \
295EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 3) \
296EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 4) \
297EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, X) \
299#define EIGEN_USING_ARRAY_TYPEDEFS \
300EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(i) \
301EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(f) \
302EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(d) \
303EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(cf) \
304EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(cd)
Base class for all 1D and 2D array, and related expressions.
Definition ArrayBase.h:41
Array(const Array &other)
Definition Array.h:192
Array(Index dim)
Definition Array.h:133
Array(Index rows, Index cols)
void swap(ArrayBase< OtherDerived > const &other)
Definition Array.h:221
Array(const Scalar &x, const Scalar &y, const Scalar &z)
Definition Array.h:162
Array & operator=(const ArrayBase< OtherDerived > &other)
Definition Array.h:87
Array(const Scalar &x, const Scalar &y)
Array & operator=(const Array &other)
Definition Array.h:95
Array(const ReturnByValue< OtherDerived > &other)
Definition Array.h:200
Array & operator=(const EigenBase< OtherDerived > &other)
Definition Array.h:72
Array(const EigenBase< OtherDerived > &other)
Definition Array.h:209
Array(const Scalar &x, const Scalar &y, const Scalar &z, const Scalar &w)
Definition Array.h:171
Array(const ArrayBase< OtherDerived > &other)
Definition Array.h:185
Array()
Definition Array.h:110
Index innerSize() const
Definition DenseBase.h:197
@ RowsAtCompileTime
Definition DenseBase.h:92
@ SizeAtCompileTime
Definition DenseBase.h:105
@ ColsAtCompileTime
Definition DenseBase.h:98
Array & operator=(const PlainObjectBase &other)
Definition PlainObjectBase.h:383
const Scalar * data() const
Definition PlainObjectBase.h:196
void resize(Index rows, Index cols)
Definition PlainObjectBase.h:219
Array & _set(const DenseBase< OtherDerived > &other)
Definition PlainObjectBase.h:575
Definition EigenBase.h:27
Index cols() const
Definition EigenBase.h:46
Index rows() const
Definition EigenBase.h:44