105template<
typename _Scalar,
int _Rows,
int _Cols,
int _Options,
int _MaxRows,
int _MaxCols>
106struct traits<Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
108 typedef _Scalar Scalar;
109 typedef Dense StorageKind;
110 typedef DenseIndex Index;
111 typedef MatrixXpr XprKind;
113 RowsAtCompileTime = _Rows,
114 ColsAtCompileTime = _Cols,
115 MaxRowsAtCompileTime = _MaxRows,
116 MaxColsAtCompileTime = _MaxCols,
117 Flags = compute_matrix_flags<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::ret,
118 CoeffReadCost = NumTraits<Scalar>::ReadCost,
120 InnerStrideAtCompileTime = 1,
121 OuterStrideAtCompileTime = (Options&
RowMajor) ? ColsAtCompileTime : RowsAtCompileTime
126template<
typename _Scalar,
int _Rows,
int _Cols,
int _Options,
int _MaxRows,
int _MaxCols>
128 :
public PlainObjectBase<Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
135 typedef PlainObjectBase<Matrix>
Base;
137 enum { Options = _Options };
139 EIGEN_DENSE_PUBLIC_INTERFACE(
Matrix)
141 typedef typename Base::PlainObject PlainObject;
144 using Base::coeffRef;
169 template<
typename OtherDerived>
172 return Base::_set(other);
181 template<
typename OtherDerived>
187 template<
typename OtherDerived>
188 EIGEN_STRONG_INLINE
Matrix& operator=(
const ReturnByValue<OtherDerived>& func)
190 return Base::operator=(func);
205 Base::_check_template_params();
206 EIGEN_INITIALIZE_BY_ZERO_IF_THAT_OPTION_IS_ENABLED
210 Matrix(internal::constructor_without_unaligned_array_assert)
211 : Base(
internal::constructor_without_unaligned_array_assert())
212 { Base::_check_template_params(); EIGEN_INITIALIZE_BY_ZERO_IF_THAT_OPTION_IS_ENABLED }
220 EIGEN_STRONG_INLINE
explicit Matrix(Index dim)
223 Base::_check_template_params();
224 EIGEN_STATIC_ASSERT_VECTOR_ONLY(
Matrix)
225 eigen_assert(dim >= 0);
227 EIGEN_INITIALIZE_BY_ZERO_IF_THAT_OPTION_IS_ENABLED
230 #ifndef EIGEN_PARSED_BY_DOXYGEN
231 template<
typename T0,
typename T1>
232 EIGEN_STRONG_INLINE
Matrix(
const T0& x,
const T1& y)
234 Base::_check_template_params();
235 Base::template _init2<T0,T1>(x, y);
245 Matrix(
const Scalar& x,
const Scalar& y);
249 EIGEN_STRONG_INLINE
Matrix(
const Scalar& x,
const Scalar& y,
const Scalar& z)
251 Base::_check_template_params();
252 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(
Matrix, 3)
253 m_storage.data()[0] = x;
254 m_storage.data()[1] = y;
255 m_storage.data()[2] = z;
258 EIGEN_STRONG_INLINE
Matrix(
const Scalar& x,
const Scalar& y,
const Scalar& z,
const Scalar& w)
260 Base::_check_template_params();
261 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(
Matrix, 4)
262 m_storage.data()[0] = x;
263 m_storage.data()[1] = y;
264 m_storage.data()[2] = z;
265 m_storage.data()[3] = w;
268 explicit Matrix(
const Scalar *data);
271 template<
typename OtherDerived>
273 :
Base(other.rows() * other.cols(), other.rows(), other.cols())
277 EIGEN_STATIC_ASSERT((internal::is_same<Scalar, typename OtherDerived::Scalar>::value),
278 YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
280 Base::_check_template_params();
281 Base::_set_noalias(other);
285 :
Base(other.rows() * other.cols(), other.rows(), other.cols())
287 Base::_check_template_params();
288 Base::_set_noalias(other);
291 template<
typename OtherDerived>
292 EIGEN_STRONG_INLINE
Matrix(
const ReturnByValue<OtherDerived>& other)
294 Base::_check_template_params();
302 template<
typename OtherDerived>
304 :
Base(other.derived().rows() * other.derived().cols(), other.derived().rows(), other.derived().cols())
306 Base::_check_template_params();
317 template<
typename OtherDerived>
319 { this->_swap(other.derived()); }
321 inline Index innerStride()
const {
return 1; }
322 inline Index outerStride()
const {
return this->innerSize(); }
326 template<
typename OtherDerived>
328 template<
typename OtherDerived>
331 #ifdef EIGEN2_SUPPORT
332 template<
typename OtherDerived>
333 explicit Matrix(
const eigen2_RotationBase<OtherDerived,ColsAtCompileTime>& r);
334 template<
typename OtherDerived>
335 Matrix&
operator=(
const eigen2_RotationBase<OtherDerived,ColsAtCompileTime>& r);
339 #ifdef EIGEN_MATRIX_PLUGIN
340 #include EIGEN_MATRIX_PLUGIN
344 template <
typename Derived,
typename OtherDerived,
bool IsVector>
345 friend struct internal::conservative_resize_like_impl;
347 using Base::m_storage;
370#define EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Size, SizeSuffix) \
372typedef Matrix<Type, Size, Size> Matrix##SizeSuffix##TypeSuffix; \
374typedef Matrix<Type, Size, 1> Vector##SizeSuffix##TypeSuffix; \
376typedef Matrix<Type, 1, Size> RowVector##SizeSuffix##TypeSuffix;
378#define EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, Size) \
380typedef Matrix<Type, Size, Dynamic> Matrix##Size##X##TypeSuffix; \
382typedef Matrix<Type, Dynamic, Size> Matrix##X##Size##TypeSuffix;
384#define EIGEN_MAKE_TYPEDEFS_ALL_SIZES(Type, TypeSuffix) \
385EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 2, 2) \
386EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 3, 3) \
387EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 4, 4) \
388EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Dynamic, X) \
389EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, 2) \
390EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, 3) \
391EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, 4)
393EIGEN_MAKE_TYPEDEFS_ALL_SIZES(
int, i)
394EIGEN_MAKE_TYPEDEFS_ALL_SIZES(
float, f)
395EIGEN_MAKE_TYPEDEFS_ALL_SIZES(
double, d)
396EIGEN_MAKE_TYPEDEFS_ALL_SIZES(std::complex<float>, cf)
397EIGEN_MAKE_TYPEDEFS_ALL_SIZES(std::complex<double>, cd)
399#undef EIGEN_MAKE_TYPEDEFS_ALL_SIZES
400#undef EIGEN_MAKE_TYPEDEFS
401#undef EIGEN_MAKE_FIXED_TYPEDEFS
@ RowsAtCompileTime
Definition DenseBase.h:92
@ SizeAtCompileTime
Definition DenseBase.h:105
@ ColsAtCompileTime
Definition DenseBase.h:98
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:50
The matrix class, also used for vectors and row-vectors.
Definition Matrix.h:129
Matrix(const MatrixBase< OtherDerived > &other)
Constructor copying the value of the expression other.
Definition Matrix.h:272
PlainObjectBase< Matrix > Base
Definition Matrix.h:135
Matrix(Index dim)
Constructs a vector or row-vector with given dimension. This is only for vectors (either row-vectors ...
Definition Matrix.h:220
Matrix()
Default constructor.
Definition Matrix.h:203
Matrix(Index rows, Index cols)
Constructs an uninitialized matrix with rows rows and cols columns.
Matrix(const Scalar &x, const Scalar &y, const Scalar &z, const Scalar &w)
Constructs an initialized 4D vector with given coefficients.
Definition Matrix.h:258
Matrix(const Matrix &other)
Copy constructor.
Definition Matrix.h:284
Matrix & operator=(const Matrix &other)
Assigns matrices to each other.
Definition Matrix.h:154
Matrix(const RotationBase< OtherDerived, ColsAtCompileTime > &r)
Constructs a Dim x Dim rotation matrix from the rotation r.
Definition RotationBase.h:141
Matrix(const ReturnByValue< OtherDerived > &other)
Copy constructor with in-place evaluation.
Definition Matrix.h:292
Matrix(const Scalar &x, const Scalar &y)
Constructs an initialized 2D vector with given coefficients.
Matrix(const EigenBase< OtherDerived > &other)
Copy constructor for generic expressions.
Definition Matrix.h:303
Matrix(const Scalar &x, const Scalar &y, const Scalar &z)
Constructs an initialized 3D vector with given coefficients.
Definition Matrix.h:249
Matrix & operator=(const EigenBase< OtherDerived > &other)
Copies the generic expression other into *this.
Definition Matrix.h:182
Matrix & operator=(const PlainObjectBase &other)
Definition PlainObjectBase.h:383
void resize(Index rows, Index cols)
Definition PlainObjectBase.h:219
Matrix & _set(const DenseBase< OtherDerived > &other)
Definition PlainObjectBase.h:575
Common base class for compact rotation representations.
Definition RotationBase.h:30
@ RowMajor
Definition Constants.h:259
Definition EigenBase.h:27
Index cols() const
Definition EigenBase.h:46
Index rows() const
Definition EigenBase.h:44