11 #ifndef EIGEN_MATRIX_H 12 #define EIGEN_MATRIX_H 17 template<
typename _Scalar,
int _Rows,
int _Cols,
int _Options,
int _MaxRows,
int _MaxCols>
18 struct traits<
Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
22 typedef typename find_best_packet<_Scalar,size>::type PacketScalar;
26 max_size = is_dynamic_size_storage ?
Dynamic : _MaxRows*_MaxCols,
28 actual_alignment = ((_Options&
DontAlign)==0) ? default_alignment : 0,
34 typedef _Scalar Scalar;
39 RowsAtCompileTime = _Rows,
40 ColsAtCompileTime = _Cols,
41 MaxRowsAtCompileTime = _MaxRows,
42 MaxColsAtCompileTime = _MaxCols,
45 InnerStrideAtCompileTime = 1,
46 OuterStrideAtCompileTime = (Options&
RowMajor) ? ColsAtCompileTime : RowsAtCompileTime,
50 Alignment = actual_alignment
177 template<
typename _Scalar,
int _Rows,
int _Cols,
int _Options,
int _MaxRows,
int _MaxCols>
179 :
public PlainObjectBase<Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
188 enum { Options = _Options };
190 EIGEN_DENSE_PUBLIC_INTERFACE(
Matrix)
192 typedef typename Base::PlainObject PlainObject;
195 using Base::coeffRef;
208 return Base::_set(other);
221 template<
typename OtherDerived>
225 return Base::_set(other);
234 template<
typename OtherDerived>
238 return Base::operator=(other);
241 template<
typename OtherDerived>
245 return Base::operator=(func);
261 Base::_check_template_params();
262 EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
269 { Base::_check_template_params(); EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED }
271 #if EIGEN_HAS_RVALUE_REFERENCES 273 Matrix(Matrix&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_constructible<Scalar>::value)
274 : Base(std::move(other))
276 Base::_check_template_params();
278 Base::_set_noalias(other);
281 Matrix& operator=(Matrix&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_assignable<Scalar>::value)
288 #ifndef EIGEN_PARSED_BY_DOXYGEN 293 EIGEN_STRONG_INLINE
explicit Matrix(
const T& x)
295 Base::_check_template_params();
296 Base::template _init1<T>(x);
299 template<
typename T0,
typename T1>
301 EIGEN_STRONG_INLINE Matrix(
const T0& x,
const T1& y)
303 Base::_check_template_params();
304 Base::template _init2<T0,T1>(x, y);
309 explicit Matrix(
const Scalar *data);
323 EIGEN_STRONG_INLINE
explicit Matrix(
Index dim);
325 Matrix(
const Scalar& x);
342 Matrix(
const Scalar& x,
const Scalar& y);
347 EIGEN_STRONG_INLINE
Matrix(
const Scalar& x,
const Scalar& y,
const Scalar& z)
349 Base::_check_template_params();
350 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Matrix, 3)
351 m_storage.data()[0] = x;
352 m_storage.data()[1] = y;
353 m_storage.data()[2] = z;
357 EIGEN_STRONG_INLINE
Matrix(
const Scalar& x,
const Scalar& y,
const Scalar& z,
const Scalar& w)
359 Base::_check_template_params();
360 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Matrix, 4)
361 m_storage.data()[0] = x;
362 m_storage.data()[1] = y;
363 m_storage.data()[2] = z;
364 m_storage.data()[3] = w;
370 EIGEN_STRONG_INLINE
Matrix(
const Matrix& other) : Base(other)
376 template<
typename OtherDerived>
379 : Base(other.derived())
382 EIGEN_DEVICE_FUNC
inline Index innerStride()
const {
return 1; }
383 EIGEN_DEVICE_FUNC
inline Index outerStride()
const {
return this->innerSize(); }
387 template<
typename OtherDerived>
390 template<
typename OtherDerived>
395 #ifdef EIGEN_MATRIX_PLUGIN 396 #include EIGEN_MATRIX_PLUGIN 400 template <
typename Derived,
typename OtherDerived,
bool IsVector>
403 using Base::m_storage;
426 #define EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Size, SizeSuffix) \ 428 typedef Matrix<Type, Size, Size> Matrix##SizeSuffix##TypeSuffix; \ 430 typedef Matrix<Type, Size, 1> Vector##SizeSuffix##TypeSuffix; \ 432 typedef Matrix<Type, 1, Size> RowVector##SizeSuffix##TypeSuffix; 434 #define EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, Size) \ 436 typedef Matrix<Type, Size, Dynamic> Matrix##Size##X##TypeSuffix; \ 438 typedef Matrix<Type, Dynamic, Size> Matrix##X##Size##TypeSuffix; 440 #define EIGEN_MAKE_TYPEDEFS_ALL_SIZES(Type, TypeSuffix) \ 441 EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 2, 2) \ 442 EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 3, 3) \ 443 EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 4, 4) \ 444 EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Dynamic, X) \ 445 EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, 2) \ 446 EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, 3) \ 447 EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, 4) 449 EIGEN_MAKE_TYPEDEFS_ALL_SIZES(
int, i)
450 EIGEN_MAKE_TYPEDEFS_ALL_SIZES(
float, f)
451 EIGEN_MAKE_TYPEDEFS_ALL_SIZES(
double, d)
452 EIGEN_MAKE_TYPEDEFS_ALL_SIZES(std::complex<float>, cf)
453 EIGEN_MAKE_TYPEDEFS_ALL_SIZES(std::complex<double>, cd)
455 #undef EIGEN_MAKE_TYPEDEFS_ALL_SIZES 456 #undef EIGEN_MAKE_TYPEDEFS 457 #undef EIGEN_MAKE_FIXED_TYPEDEFS 461 #endif // EIGEN_MATRIX_H EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix(const Scalar &x, const Scalar &y, const Scalar &z)
Constructs an initialized 3D vector with given coefficients.
Definition: Matrix.h:347
Don't require alignment for the matrix itself (the array of coefficients, if dynamically allocated...
Definition: Constants.h:326
Definition: XprHelper.h:158
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix(const Matrix &other)
Copy constructor.
Definition: Matrix.h:370
const unsigned int DirectAccessBit
Means that the underlying array of coefficients can be directly accessed as a plain strided array...
Definition: Constants.h:150
EIGEN_DEVICE_FUNC void swap(const DenseBase< OtherDerived > &other)
swaps *this with the expression other.
Definition: DenseBase.h:414
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:85
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition: Constants.h:61
Base class for all dense matrices, vectors, and arrays.
Definition: DenseBase.h:41
const unsigned int PacketAccessBit
Short version: means the expression might be vectorized.
Definition: Constants.h:89
Common base class for all classes T such that MatrixBase has an operator=(T) and a constructor Matrix...
Definition: EigenBase.h:28
The type used to identify a matrix expression.
Definition: Constants.h:506
Definition: ReturnByValue.h:50
Definition: GenericPacketMath.h:96
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix()
Default constructor.
Definition: Matrix.h:259
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:33
Dense storage base class for matrices and arrays.
Definition: PlainObjectBase.h:92
Common base class for compact rotation representations.
Definition: ForwardDeclarations.h:266
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix(const EigenBase< OtherDerived > &other)
Copy constructor for generic expressions.
Definition: Matrix.h:378
Definition: benchGeometry.cpp:23
Definition: BandTriangularSolver.h:13
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix & operator=(const Matrix &other)
Assigns matrices to each other.
Definition: Matrix.h:206
Definition: XprHelper.h:222
Definition: XprHelper.h:251
Storage order is row major (see TopicStorageOrders).
Definition: Constants.h:322
The type used to identify a dense storage.
Definition: Constants.h:491
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix & operator=(const EigenBase< OtherDerived > &other)
Copies the generic expression other into *this.
Definition: Matrix.h:236
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
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:178
Definition: DenseStorage.h:25
PlainObjectBase< Matrix > Base
Base class typedef.
Definition: Matrix.h:186
const unsigned int LinearAccessBit
Short version: means the expression can be seen as 1D vector.
Definition: Constants.h:125
Definition: ForwardDeclarations.h:17
Definition: XprHelper.h:261
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix(const Scalar &x, const Scalar &y, const Scalar &z, const Scalar &w)
Constructs an initialized 4D vector with given coefficients.
Definition: Matrix.h:357
Definition: PlainObjectBase.h:55