11 #ifndef EIGEN_MATRIX_H
12 #define EIGEN_MATRIX_H
19 template<
typename Scalar_,
int Rows_,
int Cols_,
int Options_,
int MaxRows_,
int MaxCols_>
20 struct traits<Matrix<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_> >
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,
36 typedef Scalar_ Scalar;
37 typedef Dense StorageKind;
39 typedef MatrixXpr XprKind;
41 RowsAtCompileTime = Rows_,
42 ColsAtCompileTime = Cols_,
43 MaxRowsAtCompileTime = MaxRows_,
44 MaxColsAtCompileTime = MaxCols_,
47 InnerStrideAtCompileTime = 1,
48 OuterStrideAtCompileTime = (Options&
RowMajor) ? ColsAtCompileTime : RowsAtCompileTime,
52 Alignment = actual_alignment
179 template<
typename Scalar_,
int Rows_,
int Cols_,
int Options_,
int MaxRows_,
int MaxCols_>
181 :
public PlainObjectBase<Matrix<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_> >
223 template<
typename OtherDerived>
236 template<
typename OtherDerived>
243 template<
typename OtherDerived>
268 explicit Matrix(internal::constructor_without_unaligned_array_assert)
269 :
Base(
internal::constructor_without_unaligned_array_assert())
289 template <
typename... ArgTypes>
292 :
Base(a0, a1, a2, a3, args...) {}
316 const std::initializer_list<std::initializer_list<Scalar>>& list)
319 #ifndef EIGEN_PARSED_BY_DOXYGEN
326 Base::template _init1<T>(
x);
329 template<
typename T0,
typename T1>
333 Base::template _init2<T0,T1>(
x,
y);
411 template<
typename OtherDerived>
424 template<
typename OtherDerived>
427 template<
typename OtherDerived>
432 #ifdef EIGEN_MATRIX_PLUGIN
433 #include EIGEN_MATRIX_PLUGIN
437 template <
typename Derived,
typename OtherDerived,
bool IsVector>
438 friend struct internal::conservative_resize_like_impl;
472 #define EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Size, SizeSuffix) \
475 typedef Matrix<Type, Size, Size> Matrix##SizeSuffix##TypeSuffix; \
478 typedef Matrix<Type, Size, 1> Vector##SizeSuffix##TypeSuffix; \
481 typedef Matrix<Type, 1, Size> RowVector##SizeSuffix##TypeSuffix;
483 #define EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, Size) \
486 typedef Matrix<Type, Size, Dynamic> Matrix##Size##X##TypeSuffix; \
489 typedef Matrix<Type, Dynamic, Size> Matrix##X##Size##TypeSuffix;
491 #define EIGEN_MAKE_TYPEDEFS_ALL_SIZES(Type, TypeSuffix) \
492 EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 2, 2) \
493 EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 3, 3) \
494 EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 4, 4) \
495 EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Dynamic, X) \
496 EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, 2) \
497 EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, 3) \
498 EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, 4)
506 #undef EIGEN_MAKE_TYPEDEFS_ALL_SIZES
507 #undef EIGEN_MAKE_TYPEDEFS
508 #undef EIGEN_MAKE_FIXED_TYPEDEFS
510 #define EIGEN_MAKE_TYPEDEFS(Size, SizeSuffix) \
513 template <typename Type> \
514 using Matrix##SizeSuffix = Matrix<Type, Size, Size>; \
517 template <typename Type> \
518 using Vector##SizeSuffix = Matrix<Type, Size, 1>; \
521 template <typename Type> \
522 using RowVector##SizeSuffix = Matrix<Type, 1, Size>;
524 #define EIGEN_MAKE_FIXED_TYPEDEFS(Size) \
527 template <typename Type> \
528 using Matrix##Size##X = Matrix<Type, Size, Dynamic>; \
531 template <typename Type> \
532 using Matrix##X##Size = Matrix<Type, Dynamic, Size>;
544 template <typename
Type,
int Size>
549 template <typename
Type,
int Size>
552 #undef EIGEN_MAKE_TYPEDEFS
553 #undef EIGEN_MAKE_FIXED_TYPEDEFS
#define EIGEN_NOEXCEPT_IF(x)
#define EIGEN_DEVICE_FUNC
#define EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
#define EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Size, SizeSuffix)
#define EIGEN_MAKE_TYPEDEFS_ALL_SIZES(Type, TypeSuffix)
#define EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, Size)
#define EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
#define EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(TYPE, SIZE)
Base class for all dense matrices, vectors, and arrays.
std::conditional_t< internal::is_same< typename internal::traits< Derived >::XprKind, MatrixXpr >::value, PlainMatrix, PlainArray > PlainObject
The plain matrix or array type corresponding to this expression.
EIGEN_CONSTEXPR Index innerSize() const
internal::traits< Derived >::Scalar Scalar
The matrix class, also used for vectors and row-vectors.
Matrix(internal::constructor_without_unaligned_array_assert)
Matrix & operator=(Matrix &&other) EIGEN_NOEXCEPT_IF(std
Matrix(const Scalar &x, const Scalar &y, const Scalar &z)
Constructs an initialized 3D vector with given coefficients.
Matrix(Index dim)
Constructs a vector or row-vector with given dimension. This is only for vectors (either row-vectors ...
Matrix & operator=(const EigenBase< OtherDerived > &other)
Copies the generic expression other into *this.
Matrix(const EigenBase< OtherDerived > &other)
Copy constructor for generic expressions.
Matrix()
Default constructor.
Matrix & operator=(const DenseBase< OtherDerived > &other)
EIGEN_CONSTEXPR Index outerStride() const EIGEN_NOEXCEPT
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)
Matrix(const Scalar &x, const Scalar &y, const Scalar &z, const Scalar &w)
Constructs an initialized 4D vector with given coefficients.
Matrix(const Matrix &other)
Copy constructor.
constexpr 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...
Matrix(const Scalar &x)
Constructs an initialized 1x1 matrix with the given coefficient.
Matrix(const Scalar *data)
Constructs a fixed-sized matrix initialized with coefficients starting at data.
PlainObjectBase< Matrix > Base
Base class typedef.
Matrix(Matrix &&other) EIGEN_NOEXCEPT_IF(std
Matrix & operator=(const RotationBase< OtherDerived, ColsAtCompileTime > &r)
EIGEN_CONSTEXPR Index innerStride() const EIGEN_NOEXCEPT
Matrix(const Scalar &x, const Scalar &y)
Constructs an initialized 2D vector with given coefficients.
Matrix & operator=(const ReturnByValue< OtherDerived > &func)
Dense storage base class for matrices and arrays.
Derived & _set(const DenseBase< OtherDerived > &other)
Copies the value of the expression other into *this with automatic resizing.
DenseStorage< Scalar, Base::MaxSizeAtCompileTime, Base::RowsAtCompileTime, Base::ColsAtCompileTime, Options > m_storage
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
const Base & base() const
const Scalar * data() const
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Derived & operator=(const PlainObjectBase &other)
Common base class for compact rotation representations.
const unsigned int PacketAccessBit
const unsigned int LinearAccessBit
const unsigned int DirectAccessBit
const unsigned int RowMajorBit
constexpr unsigned compute_matrix_flags(int Options)
constexpr int size_at_compile_time(int rows, int cols)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Eigen::Index Index
The interface type of indices.