14#include "./InternalHeaderCheck.h"
19template<
typename Scalar_,
int Rows_,
int Cols_,
int Options_,
int MaxRows_,
int MaxCols_>
20struct traits<Matrix<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_> >
23 enum { size = internal::size_at_compile_time<Rows_,Cols_>::ret };
24 typedef typename find_best_packet<Scalar_,size>::type PacketScalar;
28 max_size = is_dynamic_size_storage ?
Dynamic : MaxRows_*MaxCols_,
29 default_alignment = compute_default_alignment<Scalar_,max_size>::value,
30 actual_alignment = ((Options_&
DontAlign)==0) ? default_alignment : 0,
31 required_alignment = unpacket_traits<PacketScalar>::alignment,
32 packet_access_bit = (packet_traits<Scalar_>::Vectorizable && (EIGEN_UNALIGNED_VECTORIZE || (actual_alignment>=required_alignment))) ?
PacketAccessBit : 0
36 typedef Scalar_ Scalar;
37 typedef Dense StorageKind;
39 typedef MatrixXpr XprKind;
41 RowsAtCompileTime = Rows_,
42 ColsAtCompileTime = Cols_,
43 MaxRowsAtCompileTime = MaxRows_,
44 MaxColsAtCompileTime = MaxCols_,
45 Flags = compute_matrix_flags<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_>::ret,
47 InnerStrideAtCompileTime = 1,
48 OuterStrideAtCompileTime = (Options&
RowMajor) ? ColsAtCompileTime : RowsAtCompileTime,
52 Alignment = actual_alignment
179template<
typename Scalar_,
int Rows_,
int Cols_,
int Options_,
int MaxRows_,
int MaxCols_>
181 :
public PlainObjectBase<Matrix<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_> >
190 enum { Options = Options_ };
192 EIGEN_DENSE_PUBLIC_INTERFACE(
Matrix)
194 typedef typename Base::PlainObject PlainObject;
223 template<
typename OtherDerived>
236 template<
typename OtherDerived>
243 template<
typename OtherDerived>
245 EIGEN_STRONG_INLINE
Matrix&
operator=(
const ReturnByValue<OtherDerived>& func)
260 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
263 EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
267 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
268 explicit Matrix(internal::constructor_without_unaligned_array_assert)
269 :
Base(internal::constructor_without_unaligned_array_assert())
270 { EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED }
272 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
273 Matrix(
Matrix&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_constructible<Scalar>::value)
274 :
Base(std::move(other)) {}
275 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
289 template <
typename... ArgTypes>
290 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
292 : Base(a0, a1, a2, a3, args...) {}
316 explicit EIGEN_STRONG_INLINE
Matrix(
const std::initializer_list<std::initializer_list<Scalar>>& list) : Base(list) {}
318#ifndef EIGEN_PARSED_BY_DOXYGEN
322 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
325 Base::template _init1<T>(
x);
328 template<
typename T0,
typename T1>
329 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
332 Base::template _init2<T0,T1>(
x,
y);
383 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(
Matrix, 3)
384 m_storage.data()[0] =
x;
385 m_storage.data()[1] =
y;
386 m_storage.data()[2] =
z;
394 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(
Matrix, 4)
395 m_storage.data()[0] =
x;
396 m_storage.data()[1] =
y;
397 m_storage.data()[2] =
z;
398 m_storage.data()[3] =
w;
410 template<
typename OtherDerived>
416 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
417 inline Index innerStride() const EIGEN_NOEXCEPT {
return 1; }
418 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
419 inline Index outerStride() const EIGEN_NOEXCEPT {
return this->
innerSize(); }
423 template<
typename OtherDerived>
425 explicit Matrix(
const RotationBase<OtherDerived,ColsAtCompileTime>& r);
426 template<
typename OtherDerived>
428 Matrix&
operator=(
const RotationBase<OtherDerived,ColsAtCompileTime>& r);
431 #ifdef EIGEN_MATRIX_PLUGIN
432 #include EIGEN_MATRIX_PLUGIN
436 template <
typename Derived,
typename OtherDerived,
bool IsVector>
437 friend struct internal::conservative_resize_like_impl;
439 using Base::m_storage;
471#define EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Size, SizeSuffix) \
473typedef Matrix<Type, Size, Size> Matrix##SizeSuffix##TypeSuffix; \
475typedef Matrix<Type, Size, 1> Vector##SizeSuffix##TypeSuffix; \
477typedef Matrix<Type, 1, Size> RowVector##SizeSuffix##TypeSuffix;
479#define EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, Size) \
481typedef Matrix<Type, Size, Dynamic> Matrix##Size##X##TypeSuffix; \
483typedef Matrix<Type, Dynamic, Size> Matrix##X##Size##TypeSuffix;
485#define EIGEN_MAKE_TYPEDEFS_ALL_SIZES(Type, TypeSuffix) \
486EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 2, 2) \
487EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 3, 3) \
488EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 4, 4) \
489EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Dynamic, X) \
490EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, 2) \
491EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, 3) \
492EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, 4)
494EIGEN_MAKE_TYPEDEFS_ALL_SIZES(
int, i)
495EIGEN_MAKE_TYPEDEFS_ALL_SIZES(
float, f)
496EIGEN_MAKE_TYPEDEFS_ALL_SIZES(
double, d)
497EIGEN_MAKE_TYPEDEFS_ALL_SIZES(std::complex<float>, cf)
498EIGEN_MAKE_TYPEDEFS_ALL_SIZES(std::complex<double>, cd)
500#undef EIGEN_MAKE_TYPEDEFS_ALL_SIZES
501#undef EIGEN_MAKE_TYPEDEFS
502#undef EIGEN_MAKE_FIXED_TYPEDEFS
504#define EIGEN_MAKE_TYPEDEFS(Size, SizeSuffix) \
507template <typename Type> \
508using Matrix##SizeSuffix = Matrix<Type, Size, Size>; \
511template <typename Type> \
512using Vector##SizeSuffix = Matrix<Type, Size, 1>; \
515template <typename Type> \
516using RowVector##SizeSuffix = Matrix<Type, 1, Size>;
518#define EIGEN_MAKE_FIXED_TYPEDEFS(Size) \
521template <typename Type> \
522using Matrix##Size##X = Matrix<Type, Size, Dynamic>; \
525template <typename Type> \
526using Matrix##X##Size = Matrix<Type, Dynamic, Size>;
528EIGEN_MAKE_TYPEDEFS(2, 2)
529EIGEN_MAKE_TYPEDEFS(3, 3)
530EIGEN_MAKE_TYPEDEFS(4, 4)
532EIGEN_MAKE_FIXED_TYPEDEFS(2)
533EIGEN_MAKE_FIXED_TYPEDEFS(3)
534EIGEN_MAKE_FIXED_TYPEDEFS(4)
538template <typename Type,
int Size>
543template <typename Type,
int Size>
546#undef EIGEN_MAKE_TYPEDEFS
547#undef EIGEN_MAKE_FIXED_TYPEDEFS
Base class for all dense matrices, vectors, and arrays.
Definition: DenseBase.h:42
EIGEN_CONSTEXPR Index innerSize() const
Definition: DenseBase.h:225
internal::traits< Derived >::Scalar Scalar
Definition: DenseBase.h:61
Derived & derived()
Definition: EigenBase.h:48
Scalar & z()
Definition: DenseCoeffsBase.h:453
Scalar & w()
Definition: DenseCoeffsBase.h:463
Scalar & y()
Definition: DenseCoeffsBase.h:443
Scalar & x()
Definition: DenseCoeffsBase.h:437
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:182
Matrix(const Scalar &x, const Scalar &y, const Scalar &z)
Constructs an initialized 3D vector with given coefficients.
Definition: Matrix.h:381
Matrix(Index dim)
Constructs a vector or row-vector with given dimension. This is only for vectors (either row-vectors ...
Matrix(const EigenBase< OtherDerived > &other)
Copy constructor for generic expressions.
Definition: Matrix.h:412
Matrix()
Default constructor.
Definition: Matrix.h:261
Matrix(Index rows, Index cols)
Constructs an uninitialized matrix with rows rows and cols columns.
Matrix(const Scalar &a0, const Scalar &a1, const Scalar &a2, const Scalar &a3, const ArgTypes &... args)
Definition: Matrix.h:291
Matrix(const Scalar &x, const Scalar &y, const Scalar &z, const Scalar &w)
Constructs an initialized 4D vector with given coefficients.
Definition: Matrix.h:392
Matrix(const Matrix &other)
Copy constructor.
Definition: Matrix.h:404
Matrix & operator=(const Matrix &other)
Assigns matrices to each other.
Definition: Matrix.h:208
Matrix(const Scalar &x)
Constructs an initialized 1x1 matrix with the given coefficient.
Matrix(const std::initializer_list< std::initializer_list< Scalar > > &list)
Constructs a Matrix and initializes it from the coefficients given as initializer-lists grouped by ro...
Definition: Matrix.h:316
Matrix(const Scalar *data)
Constructs a fixed-sized matrix initialized with coefficients starting at data.
PlainObjectBase< Matrix > Base
Base class typedef.
Definition: Matrix.h:188
Matrix(const Scalar &x, const Scalar &y)
Constructs an initialized 2D vector with given coefficients.
Matrix & operator=(const EigenBase< OtherDerived > &other)
Copies the generic expression other into *this.
Definition: Matrix.h:238
Dense storage base class for matrices and arrays.
Definition: PlainObjectBase.h:102
Scalar & coeffRef(Index rowId, Index colId)
Definition: PlainObjectBase.h:187
Derived & _set(const DenseBase< OtherDerived > &other)
Copies the value of the expression other into *this with automatic resizing.
Definition: PlainObjectBase.h:776
Derived & operator=(const PlainObjectBase &other)
Definition: PlainObjectBase.h:461
const Scalar * data() const
Definition: PlainObjectBase.h:259
@ DontAlign
Definition: Constants.h:327
@ RowMajor
Definition: Constants.h:323
const unsigned int PacketAccessBit
Definition: Constants.h:96
const unsigned int LinearAccessBit
Definition: Constants.h:132
const unsigned int DirectAccessBit
Definition: Constants.h:157
const unsigned int RowMajorBit
Definition: Constants.h:68
Namespace containing all symbols from the Eigen library.
Definition: B01_Experimental.dox:1
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