33 template<
typename _Scalar,
int _Rows,
int _Cols,
int _Options,
int _MaxRows,
int _MaxCols>
34 struct traits<
Array<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> > :
traits<Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
41 template<
typename _Scalar,
int _Rows,
int _Cols,
int _Options,
int _MaxRows,
int _MaxCols>
43 :
public PlainObjectBase<Array<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
48 EIGEN_DENSE_PUBLIC_INTERFACE(
Array)
51 typedef typename Base::PlainObject PlainObject;
54 template <
typename Derived,
typename OtherDerived,
bool IsVector>
57 using Base::m_storage;
71 template<
typename OtherDerived>
74 return Base::operator=(other);
86 template<
typename OtherDerived>
89 return Base::_set(other);
97 return Base::_set(other);
110 EIGEN_STRONG_INLINE
Array() : Base()
112 Base::_check_template_params();
113 EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
116 #ifndef EIGEN_PARSED_BY_DOXYGEN 122 Base::_check_template_params();
123 EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
127 #ifdef EIGEN_HAVE_RVALUE_REFERENCES 129 : Base(std::move(other))
131 Base::_check_template_params();
133 Base::_set_noalias(other);
135 Array& operator=(Array&& other)
148 EIGEN_STRONG_INLINE
explicit Array(Index dim)
149 : Base(dim, RowsAtCompileTime == 1 ? 1 : dim, ColsAtCompileTime == 1 ? 1 : dim)
151 Base::_check_template_params();
152 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Array)
153 eigen_assert(dim >= 0);
154 eigen_assert(SizeAtCompileTime ==
Dynamic || SizeAtCompileTime == dim);
155 EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
158 #ifndef EIGEN_PARSED_BY_DOXYGEN 159 template<
typename T0,
typename T1>
160 EIGEN_STRONG_INLINE Array(
const T0& val0,
const T1& val1)
162 Base::_check_template_params();
163 this->
template _init2<T0,T1>(val0, val1);
171 Array(Index rows, Index cols);
173 Array(
const Scalar& val0,
const Scalar& val1);
177 EIGEN_STRONG_INLINE
Array(
const Scalar& val0,
const Scalar& val1,
const Scalar& val2)
179 Base::_check_template_params();
180 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Array, 3)
181 m_storage.data()[0] = val0;
182 m_storage.data()[1] = val1;
183 m_storage.data()[2] = val2;
186 EIGEN_STRONG_INLINE
Array(
const Scalar& val0,
const Scalar& val1,
const Scalar& val2,
const Scalar& val3)
188 Base::_check_template_params();
189 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Array, 4)
190 m_storage.data()[0] = val0;
191 m_storage.data()[1] = val1;
192 m_storage.data()[2] = val2;
193 m_storage.data()[3] = val3;
196 explicit Array(
const Scalar *data);
199 template<
typename OtherDerived>
201 : Base(other.rows() * other.cols(), other.rows(), other.cols())
203 Base::_check_template_params();
204 Base::_set_noalias(other);
207 EIGEN_STRONG_INLINE
Array(
const Array& other)
208 : Base(other.rows() * other.cols(), other.rows(), other.cols())
210 Base::_check_template_params();
211 Base::_set_noalias(other);
214 template<
typename OtherDerived>
217 Base::_check_template_params();
218 Base::resize(other.rows(), other.cols());
223 template<
typename OtherDerived>
225 : Base(other.derived().rows() * other.derived().cols(), other.derived().rows(), other.derived().cols())
227 Base::_check_template_params();
228 Base::_resize_to_match(other);
235 template<
typename OtherDerived>
237 { this->_swap(other.derived()); }
239 inline Index innerStride()
const {
return 1; }
240 inline Index outerStride()
const {
return this->innerSize(); }
242 #ifdef EIGEN_ARRAY_PLUGIN 243 #include EIGEN_ARRAY_PLUGIN 248 template<
typename MatrixType,
typename OtherDerived,
bool SwapPo
inters>
271 #define EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, Size, SizeSuffix) \ 273 typedef Array<Type, Size, Size> Array##SizeSuffix##SizeSuffix##TypeSuffix; \ 275 typedef Array<Type, Size, 1> Array##SizeSuffix##TypeSuffix; 277 #define EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Type, TypeSuffix, Size) \ 279 typedef Array<Type, Size, Dynamic> Array##Size##X##TypeSuffix; \ 281 typedef Array<Type, Dynamic, Size> Array##X##Size##TypeSuffix; 283 #define EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(Type, TypeSuffix) \ 284 EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, 2, 2) \ 285 EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, 3, 3) \ 286 EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, 4, 4) \ 287 EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, Dynamic, X) \ 288 EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Type, TypeSuffix, 2) \ 289 EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Type, TypeSuffix, 3) \ 290 EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Type, TypeSuffix, 4) 292 EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(
int, i)
293 EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(
float, f)
294 EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(
double, d)
295 EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(std::complex<float>, cf)
296 EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(std::complex<double>, cd)
298 #undef EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES 299 #undef EIGEN_MAKE_ARRAY_TYPEDEFS 301 #undef EIGEN_MAKE_ARRAY_TYPEDEFS_LARGE 303 #define EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, SizeSuffix) \ 304 using Eigen::Matrix##SizeSuffix##TypeSuffix; \ 305 using Eigen::Vector##SizeSuffix##TypeSuffix; \ 306 using Eigen::RowVector##SizeSuffix##TypeSuffix; 308 #define EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(TypeSuffix) \ 309 EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 2) \ 310 EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 3) \ 311 EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 4) \ 312 EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, X) \ 314 #define EIGEN_USING_ARRAY_TYPEDEFS \ 315 EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(i) \ 316 EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(f) \ 317 EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(d) \ 318 EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(cf) \ 319 EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(cd) 323 #endif // EIGEN_ARRAY_H EIGEN_STRONG_INLINE Array & operator=(const EigenBase< OtherDerived > &other)
The usage of using Base::operator=; fails on MSVC.
Definition: Array.h:72
EIGEN_STRONG_INLINE Array(const EigenBase< OtherDerived > &other)
Definition: Array.h:224
void swap(ArrayBase< OtherDerived > const &other)
Override MatrixBase::swap() since for dynamic-sized matrices of same type it is enough to swap the da...
Definition: Array.h:236
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:186
iterative scaling algorithm to equilibrate rows and column norms in matrices
Definition: TestIMU_Common.h:87
Common base class for all classes T such that MatrixBase has an operator=(T) and a constructor Matrix...
Definition: EigenBase.h:26
Definition: ReturnByValue.h:50
EIGEN_STRONG_INLINE Array(const Array &other)
Copy constructor.
Definition: Array.h:207
EIGEN_STRONG_INLINE Array()
Default constructor.
Definition: Array.h:110
Dense storage base class for matrices and arrays.
Definition: PlainObjectBase.h:88
EIGEN_STRONG_INLINE Array(Index dim)
Constructs a vector or row-vector with given dimension.
Definition: Array.h:148
EIGEN_STRONG_INLINE Array(const ArrayBase< OtherDerived > &other)
Constructor copying the value of the expression other.
Definition: Array.h:200
EIGEN_STRONG_INLINE Array & operator=(const ArrayBase< OtherDerived > &other)
Copies the value of the expression other into *this with automatic resizing.
Definition: Array.h:87
Base class for all 1D and 2D array, and related expressions.
Definition: ArrayBase.h:39
Definition: BandTriangularSolver.h:13
General-purpose arrays with easy API for coefficient-wise operations.
Definition: Array.h:42
EIGEN_STRONG_INLINE Array(const ReturnByValue< OtherDerived > &other)
Copy constructor with in-place evaluation.
Definition: Array.h:215
The type used to identify an array expression.
Definition: Constants.h:434
const int Dynamic
This value means that a positive quantity (e.g., a size) is not known at compile-time, and that instead the value is stored in some runtime variable.
Definition: Constants.h:21
Definition: PlainObjectBase.h:55
Definition: DenseStorage.h:25
EIGEN_STRONG_INLINE Array & operator=(const Array &other)
This is a special case of the templated operator=.
Definition: Array.h:95
Definition: ForwardDeclarations.h:17
Definition: osvr_print_tree.cpp:52
EIGEN_STRONG_INLINE Array(const Scalar &val0, const Scalar &val1, const Scalar &val2)
constructs an initialized 3D vector with given coefficients
Definition: Array.h:177
Definition: PlainObjectBase.h:53