11 #ifndef EIGEN_MATRIX_H 12 #define EIGEN_MATRIX_H 105 template<
typename _Scalar,
int _Rows,
int _Cols,
int _Options,
int _MaxRows,
int _MaxCols>
106 struct traits<
Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
110 typedef DenseIndex Index;
113 RowsAtCompileTime = _Rows,
114 ColsAtCompileTime = _Cols,
115 MaxRowsAtCompileTime = _MaxRows,
116 MaxColsAtCompileTime = _MaxCols,
120 InnerStrideAtCompileTime = 1,
121 OuterStrideAtCompileTime = (Options&
RowMajor) ? ColsAtCompileTime : RowsAtCompileTime
126 template<
typename _Scalar,
int _Rows,
int _Cols,
int _Options,
int _MaxRows,
int _MaxCols>
128 :
public PlainObjectBase<Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
139 EIGEN_DENSE_PUBLIC_INTERFACE(
Matrix)
141 typedef typename Base::PlainObject PlainObject;
144 using Base::coeffRef;
156 return Base::_set(other);
169 template<
typename OtherDerived>
172 return Base::_set(other);
181 template<
typename OtherDerived>
184 return Base::operator=(other);
187 template<
typename OtherDerived>
190 return Base::operator=(func);
205 Base::_check_template_params();
206 EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
212 { Base::_check_template_params(); EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED }
214 #ifdef EIGEN_HAVE_RVALUE_REFERENCES 216 : Base(std::move(other))
218 Base::_check_template_params();
220 Base::_set_noalias(other);
222 Matrix& operator=(Matrix&& other)
235 EIGEN_STRONG_INLINE
explicit Matrix(Index dim)
236 : Base(dim, RowsAtCompileTime == 1 ? 1 : dim, ColsAtCompileTime == 1 ? 1 : dim)
238 Base::_check_template_params();
239 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Matrix)
240 eigen_assert(dim >= 0);
241 eigen_assert(SizeAtCompileTime ==
Dynamic || SizeAtCompileTime == dim);
242 EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
245 #ifndef EIGEN_PARSED_BY_DOXYGEN 246 template<
typename T0,
typename T1>
247 EIGEN_STRONG_INLINE
Matrix(
const T0& x,
const T1& y)
249 Base::_check_template_params();
250 Base::template _init2<T0,T1>(x, y);
258 Matrix(Index rows, Index cols);
260 Matrix(
const Scalar& x,
const Scalar& y);
264 EIGEN_STRONG_INLINE
Matrix(
const Scalar& x,
const Scalar& y,
const Scalar& z)
266 Base::_check_template_params();
267 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Matrix, 3)
268 m_storage.data()[0] = x;
269 m_storage.data()[1] = y;
270 m_storage.data()[2] = z;
273 EIGEN_STRONG_INLINE
Matrix(
const Scalar& x,
const Scalar& y,
const Scalar& z,
const Scalar& w)
275 Base::_check_template_params();
276 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Matrix, 4)
277 m_storage.data()[0] = x;
278 m_storage.data()[1] = y;
279 m_storage.data()[2] = z;
280 m_storage.data()[3] = w;
283 explicit Matrix(
const Scalar *data);
286 template<
typename OtherDerived>
288 : Base(other.rows() * other.cols(), other.rows(), other.cols())
293 YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
295 Base::_check_template_params();
296 Base::_set_noalias(other);
299 EIGEN_STRONG_INLINE
Matrix(
const Matrix& other)
300 : Base(other.rows() * other.cols(), other.rows(), other.cols())
302 Base::_check_template_params();
303 Base::_set_noalias(other);
306 template<
typename OtherDerived>
309 Base::_check_template_params();
310 Base::resize(other.rows(), other.cols());
317 template<
typename OtherDerived>
319 : Base(other.derived().rows() * other.derived().cols(), other.derived().rows(), other.derived().cols())
321 Base::_check_template_params();
322 Base::_resize_to_match(other);
332 template<
typename OtherDerived>
334 { this->_swap(other.derived()); }
336 inline Index innerStride()
const {
return 1; }
337 inline Index outerStride()
const {
return this->innerSize(); }
341 template<
typename OtherDerived>
343 template<
typename OtherDerived>
346 #ifdef EIGEN2_SUPPORT 347 template<
typename OtherDerived>
348 explicit Matrix(
const eigen2_RotationBase<OtherDerived,ColsAtCompileTime>& r);
349 template<
typename OtherDerived>
350 Matrix& operator=(
const eigen2_RotationBase<OtherDerived,ColsAtCompileTime>& r);
354 #ifdef EIGEN_MATRIX_PLUGIN 355 #include EIGEN_MATRIX_PLUGIN 359 template <
typename Derived,
typename OtherDerived,
bool IsVector>
362 using Base::m_storage;
385 #define EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Size, SizeSuffix) \ 387 typedef Matrix<Type, Size, Size> Matrix##SizeSuffix##TypeSuffix; \ 389 typedef Matrix<Type, Size, 1> Vector##SizeSuffix##TypeSuffix; \ 391 typedef Matrix<Type, 1, Size> RowVector##SizeSuffix##TypeSuffix; 393 #define EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, Size) \ 395 typedef Matrix<Type, Size, Dynamic> Matrix##Size##X##TypeSuffix; \ 397 typedef Matrix<Type, Dynamic, Size> Matrix##X##Size##TypeSuffix; 399 #define EIGEN_MAKE_TYPEDEFS_ALL_SIZES(Type, TypeSuffix) \ 400 EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 2, 2) \ 401 EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 3, 3) \ 402 EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 4, 4) \ 403 EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Dynamic, X) \ 404 EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, 2) \ 405 EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, 3) \ 406 EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, 4) 408 EIGEN_MAKE_TYPEDEFS_ALL_SIZES(
int, i)
409 EIGEN_MAKE_TYPEDEFS_ALL_SIZES(
float, f)
410 EIGEN_MAKE_TYPEDEFS_ALL_SIZES(
double, d)
411 EIGEN_MAKE_TYPEDEFS_ALL_SIZES(std::complex<float>, cf)
412 EIGEN_MAKE_TYPEDEFS_ALL_SIZES(std::complex<double>, cd)
414 #undef EIGEN_MAKE_TYPEDEFS_ALL_SIZES 415 #undef EIGEN_MAKE_TYPEDEFS 416 #undef EIGEN_MAKE_FIXED_TYPEDEFS 420 #endif // EIGEN_MATRIX_H EIGEN_STRONG_INLINE Matrix(const MatrixBase< OtherDerived > &other)
Constructor copying the value of the expression other.
Definition: Matrix.h:287
iterative scaling algorithm to equilibrate rows and column norms in matrices
Definition: TestIMU_Common.h:87
Holds information about the various numeric (i.e.
Definition: NumTraits.h:88
EIGEN_STRONG_INLINE Matrix(Index dim)
Constructs a vector or row-vector with given dimension.
Definition: Matrix.h:235
Common base class for all classes T such that MatrixBase has an operator=(T) and a constructor Matrix...
Definition: EigenBase.h:26
The type used to identify a matrix expression.
Definition: Constants.h:431
Definition: ReturnByValue.h:50
EIGEN_STRONG_INLINE Matrix(const Scalar &x, const Scalar &y, const Scalar &z)
Constructs an initialized 3D vector with given coefficients.
Definition: Matrix.h:264
EIGEN_STRONG_INLINE Matrix(const Matrix &other)
Copy constructor.
Definition: Matrix.h:299
EIGEN_STRONG_INLINE Matrix()
Default constructor.
Definition: Matrix.h:203
EIGEN_STRONG_INLINE Matrix(const ReturnByValue< OtherDerived > &other)
Copy constructor with in-place evaluation.
Definition: Matrix.h:307
Dense storage base class for matrices and arrays.
Definition: PlainObjectBase.h:88
Common base class for compact rotation representations.
Definition: ForwardDeclarations.h:231
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:273
EIGEN_STRONG_INLINE Matrix(const EigenBase< OtherDerived > &other)
Copy constructor for generic expressions.
Definition: Matrix.h:318
Definition: benchGeometry.cpp:23
Definition: BandTriangularSolver.h:13
Storage order is row major (see TopicStorageOrders).
Definition: Constants.h:266
EIGEN_STRONG_INLINE Matrix & operator=(const Matrix &other)
Assigns matrices to each other.
Definition: Matrix.h:154
Definition: XprHelper.h:128
void swap(const DenseBase< OtherDerived > &other, int=OtherDerived::ThisConstantIsPrivateInPlainObjectBase)
swaps *this with the expression other.
Definition: DenseBase.h:372
The type used to identify a dense storage.
Definition: Constants.h:428
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:127
Definition: DenseStorage.h:25
EIGEN_STRONG_INLINE Matrix & operator=(const EigenBase< OtherDerived > &other)
Copies the generic expression other into *this.
Definition: Matrix.h:182
PlainObjectBase< Matrix > Base
Base class typedef.
Definition: Matrix.h:135
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48
Definition: ForwardDeclarations.h:17
Definition: osvr_print_tree.cpp:52
double Scalar
Common scalar type.
Definition: FlexibleKalmanBase.h:48
Eigen::Matrix< Scalar, m, n > Matrix
A matrix with rows = m, cols = n.
Definition: FlexibleKalmanBase.h:121
Definition: PlainObjectBase.h:53