Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > Class Template Reference

The matrix class, also used for vectors and row-vectors. More...

#include <src/eigen/Eigen/src/Core/Matrix.h>

Inherits Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >.

+ Collaboration diagram for Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >:

Public Types

enum  { Options = _Options }
 
typedef PlainObjectBase< MatrixBase
 Base class typedef.
 
typedef Base::PlainObject PlainObject
 
enum  
 
enum  
 
typedef internal::traits< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::StorageKind StorageKind
 
typedef internal::traits< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Scalar Scalar
 
typedef internal::packet_traits< Scalar >::type PacketScalar
 
typedef NumTraits< Scalar >::Real RealScalar
 
typedef Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > DenseType
 
typedef Eigen::Map< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >, UnalignedMapType
 
typedef const Eigen::Map< const Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >, UnalignedConstMapType
 
typedef Eigen::Map< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >, AlignedMaxAlignedMapType
 
typedef const Eigen::Map< const Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >, AlignedMaxConstAlignedMapType
 

Public Member Functions

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrixoperator= (const Matrix &other)
 Assigns matrices to each other.
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrixoperator= (const DenseBase< OtherDerived > &other)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrixoperator= (const EigenBase< OtherDerived > &other)
 Copies the generic expression other into *this.
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrixoperator= (const ReturnByValue< OtherDerived > &func)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix ()
 Default constructor.
 
EIGEN_DEVICE_FUNC Matrix (internal::constructor_without_unaligned_array_assert)
 
template<typename T >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix (const T &x)
 
template<typename T0 , typename T1 >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix (const T0 &x, const T1 &y)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix (const Scalar &x, const Scalar &y, const Scalar &z)
 Constructs an initialized 3D vector with given coefficients.
 
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.
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix (const Matrix &other)
 Copy constructor.
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix (const EigenBase< OtherDerived > &other)
 Copy constructor for generic expressions.
 
EIGEN_DEVICE_FUNC Index innerStride () const
 
EIGEN_DEVICE_FUNC Index outerStride () const
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Matrix (const RotationBase< OtherDerived, ColsAtCompileTime > &r)
 Constructs a Dim x Dim rotation matrix from the rotation r.
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Matrixoperator= (const RotationBase< OtherDerived, ColsAtCompileTime > &r)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Matrix< _Scalar, _Rows, _Cols, _Storage, _MaxRows, _MaxCols > & operator= (const RotationBase< OtherDerived, ColsAtCompileTime > &r)
 Set a Dim x Dim rotation matrix from the rotation r.
 
EIGEN_DEVICE_FUNC Basebase ()
 
EIGEN_DEVICE_FUNC const Basebase () const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ScalarcoeffRef (Index rowId, Index colId)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ScalarcoeffRef (Index index)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ScalarcoeffRef (Index rowId, Index colId) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ScalarcoeffRef (Index index) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rows () const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index cols () const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalarcoeff (Index rowId, Index colId) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalarcoeff (Index index) const
 
EIGEN_STRONG_INLINE PacketScalar packet (Index rowId, Index colId) const
 
EIGEN_STRONG_INLINE PacketScalar packet (Index index) const
 
EIGEN_STRONG_INLINE void writePacket (Index rowId, Index colId, const PacketScalar &val)
 
EIGEN_STRONG_INLINE void writePacket (Index index, const PacketScalar &val)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalardata () const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalardata ()
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize (Index rows, Index cols)
 
EIGEN_DEVICE_FUNC void resize (Index size)
 
EIGEN_DEVICE_FUNC void resize (NoChange_t, Index cols)
 
EIGEN_DEVICE_FUNC void resize (Index rows, NoChange_t)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resizeLike (const EigenBase< OtherDerived > &_other)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void conservativeResize (Index rows, Index cols)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void conservativeResize (Index rows, NoChange_t)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void conservativeResize (NoChange_t, Index cols)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void conservativeResize (Index size)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void conservativeResizeLike (const DenseBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & lazyAssign (const DenseBase< OtherDerived > &other)
 

Protected Attributes

DenseStorage< Scalar, Base::MaxSizeAtCompileTime, Base::RowsAtCompileTime, Base::ColsAtCompileTime, Optionsm_storage
 

Friends

template<typename Derived , typename OtherDerived , bool IsVector>
struct internal::conservative_resize_like_impl
 

Map

These are convenience functions returning Map objects. The Map() static functions return unaligned Map objects, while the AlignedMap() functions return aligned Map objects and thus should be called only with 16-byte-aligned data pointers.

Here is an example using strides:

Output:

See also
class Map
enum  
 
EIGEN_DEVICE_FUNC Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & setConstant (Index size, const Scalar &val)
 
EIGEN_DEVICE_FUNC Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & setConstant (Index rows, Index cols, const Scalar &val)
 
EIGEN_DEVICE_FUNC Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & setZero (Index size)
 
EIGEN_DEVICE_FUNC Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & setZero (Index rows, Index cols)
 
EIGEN_DEVICE_FUNC Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & setOnes (Index size)
 
EIGEN_DEVICE_FUNC Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & setOnes (Index rows, Index cols)
 
Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & setRandom (Index size)
 
Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & setRandom (Index rows, Index cols)
 
EIGEN_DEVICE_FUNC void swap (DenseBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC void swap (DenseBase< OtherDerived > const &other)
 
static ConstMapType Map (const Scalar *data)
 
static MapType Map (Scalar *data)
 
static ConstMapType Map (const Scalar *data, Index size)
 
static MapType Map (Scalar *data, Index size)
 
static ConstMapType Map (const Scalar *data, Index rows, Index cols)
 
static MapType Map (Scalar *data, Index rows, Index cols)
 
static StridedConstMapType< Stride< Outer, Inner > >::type Map (const Scalar *data, const Stride< Outer, Inner > &stride)
 
static StridedMapType< Stride< Outer, Inner > >::type Map (Scalar *data, const Stride< Outer, Inner > &stride)
 
static StridedConstMapType< Stride< Outer, Inner > >::type Map (const Scalar *data, Index size, const Stride< Outer, Inner > &stride)
 
static StridedMapType< Stride< Outer, Inner > >::type Map (Scalar *data, Index size, const Stride< Outer, Inner > &stride)
 
static StridedConstMapType< Stride< Outer, Inner > >::type Map (const Scalar *data, Index rows, Index cols, const Stride< Outer, Inner > &stride)
 
static StridedMapType< Stride< Outer, Inner > >::type Map (Scalar *data, Index rows, Index cols, const Stride< Outer, Inner > &stride)
 
static ConstAlignedMapType MapAligned (const Scalar *data)
 
static AlignedMapType MapAligned (Scalar *data)
 
static ConstAlignedMapType MapAligned (const Scalar *data, Index size)
 
static AlignedMapType MapAligned (Scalar *data, Index size)
 
static ConstAlignedMapType MapAligned (const Scalar *data, Index rows, Index cols)
 
static AlignedMapType MapAligned (Scalar *data, Index rows, Index cols)
 
static StridedConstAlignedMapType< Stride< Outer, Inner > >::type MapAligned (const Scalar *data, const Stride< Outer, Inner > &stride)
 
static StridedAlignedMapType< Stride< Outer, Inner > >::type MapAligned (Scalar *data, const Stride< Outer, Inner > &stride)
 
static StridedConstAlignedMapType< Stride< Outer, Inner > >::type MapAligned (const Scalar *data, Index size, const Stride< Outer, Inner > &stride)
 
static StridedAlignedMapType< Stride< Outer, Inner > >::type MapAligned (Scalar *data, Index size, const Stride< Outer, Inner > &stride)
 
static StridedConstAlignedMapType< Stride< Outer, Inner > >::type MapAligned (const Scalar *data, Index rows, Index cols, const Stride< Outer, Inner > &stride)
 
static StridedAlignedMapType< Stride< Outer, Inner > >::type MapAligned (Scalar *data, Index rows, Index cols, const Stride< Outer, Inner > &stride)
 
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _check_template_params ()
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _resize_to_match (const EigenBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & _set (const DenseBase< OtherDerived > &other)
 Copies the value of the expression other into *this with automatic resizing.
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & _set_noalias (const DenseBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init2 (Index rows, Index cols, typename internal::enable_if< Base::SizeAtCompileTime!=2, T0 >::type *=0)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init2 (const T0 &val0, const T1 &val1, typename internal::enable_if< Base::SizeAtCompileTime==2, T0 >::type *=0)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init2 (const Index &val0, const Index &val1, typename internal::enable_if<(!internal::is_same< Index, Scalar >::value) &&(internal::is_same< T0, Index >::value) &&(internal::is_same< T1, Index >::value) &&Base::SizeAtCompileTime==2, T1 >::type *=0)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1 (Index size, typename internal::enable_if<(Base::SizeAtCompileTime!=1||!internal::is_convertible< T, Scalar >::value) &&((!internal::is_same< typename internal::traits< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::XprKind, ArrayXpr >::value||Base::SizeAtCompileTime==Dynamic)), T >::type *=0)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1 (const Scalar &val0, typename internal::enable_if< Base::SizeAtCompileTime==1 &&internal::is_convertible< T, Scalar >::value, T >::type *=0)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1 (const Index &val0, typename internal::enable_if<(!internal::is_same< Index, Scalar >::value) &&(internal::is_same< Index, T >::value) &&Base::SizeAtCompileTime==1 &&internal::is_convertible< T, Scalar >::value, T * >::type *=0)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1 (const Scalar *data)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1 (const DenseBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1 (const Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &other)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1 (const EigenBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1 (const ReturnByValue< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1 (const RotationBase< OtherDerived, ColsAtCompileTime > &r)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1 (const Scalar &val0, typename internal::enable_if< Base::SizeAtCompileTime!=Dynamic &&Base::SizeAtCompileTime!=1 &&internal::is_convertible< T, Scalar >::value &&internal::is_same< typename internal::traits< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::XprKind, ArrayXpr >::value, T >::type *=0)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1 (const Index &val0, typename internal::enable_if<(!internal::is_same< Index, Scalar >::value) &&(internal::is_same< Index, T >::value) &&Base::SizeAtCompileTime!=Dynamic &&Base::SizeAtCompileTime!=1 &&internal::is_convertible< T, Scalar >::value &&internal::is_same< typename internal::traits< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::XprKind, ArrayXpr >::value, T * >::type *=0)
 

Detailed Description

template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
class Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >

The matrix class, also used for vectors and row-vectors.

The Matrix class is the work-horse for all dense (note) matrices and vectors within Eigen. Vectors are matrices with one column, and row-vectors are matrices with one row.

The Matrix class encompasses both fixed-size and dynamic-size objects (note).

The first three template parameters are required:

Template Parameters
_ScalarNumeric type, e.g. float, double, int or std::complex<float>. User defined scalar types are supported as well (see here).
_RowsNumber of rows, or Dynamic
_ColsNumber of columns, or Dynamic

The remaining template parameters are optional – in most cases you don't have to worry about them.

Template Parameters
_OptionsA combination of either RowMajor or ColMajor, and of either AutoAlign or DontAlign. The former controls storage order, and defaults to column-major. The latter controls alignment, which is required for vectorization. It defaults to aligning matrices except for fixed sizes that aren't a multiple of the packet size.
_MaxRowsMaximum number of rows. Defaults to _Rows (note).
_MaxColsMaximum number of columns. Defaults to _Cols (note).

Eigen provides a number of typedefs covering the usual cases. Here are some examples:

  • Matrix2d is a 2x2 square matrix of doubles (Matrix<double, 2, 2>)
  • Vector4f is a vector of 4 floats (Matrix<float, 4, 1>)
  • RowVector3i is a row-vector of 3 ints (Matrix<int, 1, 3>)
  • MatrixXf is a dynamic-size matrix of floats (Matrix<float, Dynamic, Dynamic>)
  • VectorXf is a dynamic-size vector of floats (Matrix<float, Dynamic, 1>)
  • Matrix2Xf is a partially fixed-size (dynamic-size) matrix of floats (Matrix<float, 2, Dynamic>)
  • MatrixX3d is a partially dynamic-size (fixed-size) matrix of double (Matrix<double, Dynamic, 3>)

See this page for a complete list of predefined Matrix and Vector typedefs.

You can access elements of vectors and matrices using normal subscripting:

Eigen::VectorXd v(10);
v[0] = 0.1;
v[1] = 0.2;
v(0) = 0.3;
v(1) = 0.4;
Eigen::MatrixXi m(10, 10);
m(0, 1) = 1;
m(0, 2) = 2;
m(0, 3) = 3;

This class can be extended with the help of the plugin mechanism described on the page TopicCustomizing_Plugins by defining the preprocessor symbol EIGEN_MATRIX_PLUGIN.

Some notes:

Dense versus sparse:

This Matrix class handles dense, not sparse matrices and vectors. For sparse matrices and vectors, see the Sparse module.

Dense matrices and vectors are plain usual arrays of coefficients. All the coefficients are stored, in an ordinary contiguous array. This is unlike Sparse matrices and vectors where the coefficients are stored as a list of nonzero coefficients.

Fixed-size versus dynamic-size:

Fixed-size means that the numbers of rows and columns are known are compile-time. In this case, Eigen allocates the array of coefficients as a fixed-size array, as a class member. This makes sense for very small matrices, typically up to 4x4, sometimes up to 16x16. Larger matrices should be declared as dynamic-size even if one happens to know their size at compile-time.

Dynamic-size means that the numbers of rows or columns are not necessarily known at compile-time. In this case they are runtime variables, and the array of coefficients is allocated dynamically on the heap.

Note that dense matrices, be they Fixed-size or Dynamic-size, do not expand dynamically in the sense of a std::map. If you want this behavior, see the Sparse module.

_MaxRows and _MaxCols:
In most cases, one just leaves these parameters to the default values. These parameters mean the maximum size of rows and columns that the matrix may have. They are useful in cases when the exact numbers of rows and columns are not known are compile-time, but it is known at compile-time that they cannot exceed a certain value. This happens when taking dynamic-size blocks inside fixed-size matrices: in this case _MaxRows and _MaxCols are the dimensions of the original matrix, while _Rows and _Cols are Dynamic.

ABI and storage layout

The table below summarizes the ABI of some possible Matrix instances which is fixed thorough the lifetime of Eigen 3.

Matrix typeEquivalent C structure
The matrix class, also used for vectors and row-vectors.
Definition Matrix.h:180
struct {
T *data; // with (size_t(data)%EIGEN_MAX_ALIGN_BYTES)==0
};
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index cols() const
Definition PlainObjectBase.h:153
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar * data() const
Definition PlainObjectBase.h:255
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rows() const
Definition PlainObjectBase.h:151
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:33
struct {
T *data; // with (size_t(data)%EIGEN_MAX_ALIGN_BYTES)==0
};
struct {
T data[Rows*Cols]; // with (size_t(data)%A(Rows*Cols*sizeof(T)))==0
};
struct {
T data[MaxRows*MaxCols]; // with (size_t(data)%A(MaxRows*MaxCols*sizeof(T)))==0
};

Note that in this table Rows, Cols, MaxRows and MaxCols are all positive integers. A(S) is defined to the largest possible power-of-two smaller to EIGEN_MAX_STATIC_ALIGN_BYTES.

See also
MatrixBase for the majority of the hidapi API methods for matrices, TopicClassHierarchy, TopicStorageOrders

Member Typedef Documentation

◆ AlignedMapType

typedef Eigen::Map<Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > , AlignedMax> Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::AlignedMapType
inherited

◆ Base

template<typename _Scalar , int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
typedef PlainObjectBase<Matrix> Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::Base

Base class typedef.

See also
PlainObjectBase

◆ ConstAlignedMapType

typedef const Eigen::Map<const Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > , AlignedMax> Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::ConstAlignedMapType
inherited

◆ ConstMapType

typedef const Eigen::Map<const Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > , Unaligned> Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::ConstMapType
inherited

◆ DenseType

typedef Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::DenseType
inherited

◆ MapType

typedef Eigen::Map<Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > , Unaligned> Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::MapType
inherited

◆ PacketScalar

typedef internal::packet_traits<Scalar>::type Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::PacketScalar
inherited

◆ PlainObject

template<typename _Scalar , int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
typedef Base::PlainObject Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::PlainObject

◆ RealScalar

typedef NumTraits<Scalar>::Real Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::RealScalar
inherited

◆ Scalar

typedef internal::traits<Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Scalar Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Scalar
inherited

◆ StorageKind

typedef internal::traits<Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::StorageKind Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::StorageKind
inherited

Member Enumeration Documentation

◆ anonymous enum

template<typename _Scalar , int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
anonymous enum
Enumerator
Options 
188{ Options = _Options };
@ Options
Definition Matrix.h:188

◆ anonymous enum

anonymous enum
inherited
102{ Options = internal::traits<Derived>::Options };

◆ anonymous enum

anonymous enum
inherited
142{ NeedsToAlign = (SizeAtCompileTime != Dynamic) && (internal::traits<Derived>::Alignment>0) };
const int Dynamic
Definition Constants.h:21

◆ anonymous enum

anonymous enum
inherited

Constructor & Destructor Documentation

◆ Matrix() [1/9]

template<typename _Scalar , int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::Matrix ( )
inline

Default constructor.

For fixed-size matrices, does nothing.

For dynamic-size matrices, creates an empty matrix of size 0. Does not allocate any array. Such a matrix is called a null matrix. This constructor is the unique way to create null matrices: resizing a matrix to 0 is not supported.

See also
resize(Index,Index)
259 : Base()
260 {
263 }
#define EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
Definition PlainObjectBase.h:22
PlainObjectBase< Matrix > Base
Base class typedef.
Definition Matrix.h:186
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _check_template_params()
Definition PlainObjectBase.h:901

References EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED.

◆ Matrix() [2/9]

template<typename _Scalar , int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
EIGEN_DEVICE_FUNC Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::Matrix ( internal::constructor_without_unaligned_array_assert  )
inlineexplicit
268 : Base(internal::constructor_without_unaligned_array_assert())

References EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED.

◆ Matrix() [3/9]

template<typename _Scalar , int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
template<typename T >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::Matrix ( const T &  x)
inlineexplicit
292 {
294 Base::template _init1<T>(x);
295 }

◆ Matrix() [4/9]

template<typename _Scalar , int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
template<typename T0 , typename T1 >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::Matrix ( const T0 &  x,
const T1 &  y 
)
inline
300 {
302 Base::template _init2<T0,T1>(x, y);
303 }

◆ Matrix() [5/9]

template<typename _Scalar , int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::Matrix ( const Scalar x,
const Scalar y,
const Scalar z 
)
inline

Constructs an initialized 3D vector with given coefficients.

346 {
349 m_storage.data()[0] = x;
350 m_storage.data()[1] = y;
351 m_storage.data()[2] = z;
352 }
#define EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(TYPE, SIZE)
Definition StaticAssert.h:154
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix()
Default constructor.
Definition Matrix.h:259
DenseStorage< Scalar, Base::MaxSizeAtCompileTime, Base::RowsAtCompileTime, Base::ColsAtCompileTime, Options > m_storage
Definition PlainObjectBase.h:139

References EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE.

◆ Matrix() [6/9]

template<typename _Scalar , int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::Matrix ( const Scalar x,
const Scalar y,
const Scalar z,
const Scalar w 
)
inline

Constructs an initialized 4D vector with given coefficients.

356 {
359 m_storage.data()[0] = x;
360 m_storage.data()[1] = y;
361 m_storage.data()[2] = z;
362 m_storage.data()[3] = w;
363 }

References EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE.

◆ Matrix() [7/9]

template<typename _Scalar , int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::Matrix ( const Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &  other)
inline

Copy constructor.

368 : Base(other)
369 { }

◆ Matrix() [8/9]

template<typename _Scalar , int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::Matrix ( const EigenBase< OtherDerived > &  other)
inline

Copy constructor for generic expressions.

See also
MatrixBase::operator=(const EigenBase<OtherDerived>&)
377 : Base(other.derived())
378 { }

◆ Matrix() [9/9]

template<typename _Scalar , int _Rows, int _Cols, int _Storage, int _MaxRows, int _MaxCols>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Eigen::Matrix< _Scalar, _Rows, _Cols, _Storage, _MaxRows, _MaxCols >::Matrix ( const RotationBase< OtherDerived, ColsAtCompileTime > &  r)
explicit

Constructs a Dim x Dim rotation matrix from the rotation r.

\geometry_module

142{
143 EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(Matrix,int(OtherDerived::Dim),int(OtherDerived::Dim))
144 *this = r.toRotationMatrix();
145}
#define EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(TYPE, ROWS, COLS)
Definition StaticAssert.h:159

References EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE, and Eigen::RotationBase< Derived, _Dim >::toRotationMatrix().

+ Here is the call graph for this function:

Member Function Documentation

◆ _check_template_params()

static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::_check_template_params ( )
inlinestaticinherited
902 {
903 EIGEN_STATIC_ASSERT((EIGEN_IMPLIES(MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1, (Options&RowMajor)==RowMajor)
904 && EIGEN_IMPLIES(MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1, (Options&RowMajor)==0)
905 && ((RowsAtCompileTime == Dynamic) || (RowsAtCompileTime >= 0))
906 && ((ColsAtCompileTime == Dynamic) || (ColsAtCompileTime >= 0))
907 && ((MaxRowsAtCompileTime == Dynamic) || (MaxRowsAtCompileTime >= 0))
908 && ((MaxColsAtCompileTime == Dynamic) || (MaxColsAtCompileTime >= 0))
909 && (MaxRowsAtCompileTime == RowsAtCompileTime || RowsAtCompileTime==Dynamic)
910 && (MaxColsAtCompileTime == ColsAtCompileTime || ColsAtCompileTime==Dynamic)
911 && (Options & (DontAlign|RowMajor)) == Options),
912 INVALID_MATRIX_TEMPLATE_PARAMETERS)
913 }
#define EIGEN_IMPLIES(a, b)
Definition Macros.h:902
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
Definition StaticAssert.h:124

◆ _init1() [1/11]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::_init1 ( const DenseBase< OtherDerived > &  other)
inlineprotectedinherited
815 {
816 this->_set_noalias(other);
817 }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & _set_noalias(const DenseBase< OtherDerived > &other)
Definition PlainObjectBase.h:725

◆ _init1() [2/11]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::_init1 ( const EigenBase< OtherDerived > &  other)
inlineprotectedinherited
829 {
830 this->derived() = other;
831 }

◆ _init1() [3/11]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::_init1 ( const Index val0,
typename internal::enable_if<(!internal::is_same< Index, Scalar >::value) &&(internal::is_same< Index, T >::value) &&Base::SizeAtCompileTime!=Dynamic &&Base::SizeAtCompileTime!=1 &&internal::is_convertible< T, Scalar >::value &&internal::is_same< typename internal::traits< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::XprKind, ArrayXpr >::value, T * >::type *  = 0 
)
inlineprotectedinherited
870 {
871 Base::setConstant(val0);
872 }

◆ _init1() [4/11]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::_init1 ( const Index val0,
typename internal::enable_if<(!internal::is_same< Index, Scalar >::value) &&(internal::is_same< Index, T >::value) &&Base::SizeAtCompileTime==1 &&internal::is_convertible< T, Scalar >::value, T * >::type *  = 0 
)
inlineprotectedinherited
800 {
802 m_storage.data()[0] = Scalar(val0);
803 }

◆ _init1() [5/11]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::_init1 ( const Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &  other)
inlineprotectedinherited
822 {
823 this->_set_noalias(other);
824 }

◆ _init1() [6/11]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::_init1 ( const ReturnByValue< OtherDerived > &  other)
inlineprotectedinherited
836 {
837 resize(other.rows(), other.cols());
838 other.evalTo(this->derived());
839 }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index rows, Index cols)
Definition PlainObjectBase.h:279

◆ _init1() [7/11]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::_init1 ( const RotationBase< OtherDerived, ColsAtCompileTime > &  r)
inlineprotectedinherited
844 {
845 this->derived() = r;
846 }

◆ _init1() [8/11]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::_init1 ( const Scalar val0,
typename internal::enable_if< Base::SizeAtCompileTime!=Dynamic &&Base::SizeAtCompileTime!=1 &&internal::is_convertible< T, Scalar >::value &&internal::is_same< typename internal::traits< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::XprKind, ArrayXpr >::value, T >::type *  = 0 
)
inlineprotectedinherited
856 {
857 Base::setConstant(val0);
858 }

◆ _init1() [9/11]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::_init1 ( const Scalar val0,
typename internal::enable_if< Base::SizeAtCompileTime==1 &&internal::is_convertible< T, Scalar >::value, T >::type *  = 0 
)
inlineprotectedinherited
787 {
789 m_storage.data()[0] = val0;
790 }

◆ _init1() [10/11]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::_init1 ( const Scalar data)
inlineprotectedinherited
808 {
809 this->_set_noalias(ConstMapType(data));
810 }
const Eigen::Map< const Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >, Unaligned > ConstMapType
Definition PlainObjectBase.h:125

◆ _init1() [11/11]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::_init1 ( Index  size,
typename internal::enable_if<(Base::SizeAtCompileTime!=1||!internal::is_convertible< T, Scalar >::value) &&((!internal::is_same< typename internal::traits< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::XprKind, ArrayXpr >::value||Base::SizeAtCompileTime==Dynamic)), T >::type *  = 0 
)
inlineprotectedinherited
774 {
775 // NOTE MSVC 2008 complains if we directly put bool(NumTraits<T>::IsInteger) as the EIGEN_STATIC_ASSERT argument.
776 const bool is_integer = NumTraits<T>::IsInteger;
777 EIGEN_UNUSED_VARIABLE(is_integer);
778 EIGEN_STATIC_ASSERT(is_integer,
779 FLOATING_POINT_ARGUMENT_PASSED__INTEGER_WAS_EXPECTED)
780 resize(size);
781 }
#define EIGEN_UNUSED_VARIABLE(var)
Definition Macros.h:618
fastfloat_really_inline bool is_integer(char c) noexcept
Definition fast_float.h:453

◆ _init2() [1/3]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::_init2 ( const Index val0,
const Index val1,
typename internal::enable_if<(!internal::is_same< Index, Scalar >::value) &&(internal::is_same< T0, Index >::value) &&(internal::is_same< T1, Index >::value) &&Base::SizeAtCompileTime==2, T1 >::type *  = 0 
)
inlineprotectedinherited
762 {
764 m_storage.data()[0] = Scalar(val0);
765 m_storage.data()[1] = Scalar(val1);
766 }

◆ _init2() [2/3]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::_init2 ( const T0 &  val0,
const T1 &  val1,
typename internal::enable_if< Base::SizeAtCompileTime==2, T0 >::type *  = 0 
)
inlineprotectedinherited
749 {
751 m_storage.data()[0] = Scalar(val0);
752 m_storage.data()[1] = Scalar(val1);
753 }

◆ _init2() [3/3]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::_init2 ( Index  rows,
Index  cols,
typename internal::enable_if< Base::SizeAtCompileTime!=2, T0 >::type *  = 0 
)
inlineprotectedinherited
739 {
740 EIGEN_STATIC_ASSERT(bool(NumTraits<T0>::IsInteger) &&
741 bool(NumTraits<T1>::IsInteger),
742 FLOATING_POINT_ARGUMENT_PASSED__INTEGER_WAS_EXPECTED)
743 resize(rows,cols);
744 }

◆ _resize_to_match()

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::_resize_to_match ( const EigenBase< OtherDerived > &  other)
inlineprotectedinherited
683 {
684 #ifdef EIGEN_NO_AUTOMATIC_RESIZING
685 eigen_assert((this->size()==0 || (IsVectorAtCompileTime ? (this->size() == other.size())
686 : (rows() == other.rows() && cols() == other.cols())))
687 && "Size mismatch. Automatic resizing is disabled because EIGEN_NO_AUTOMATIC_RESIZING is defined");
689 #else
690 resizeLike(other);
691 #endif
692 }
#define EIGEN_ONLY_USED_FOR_DEBUG(x)
Definition Macros.h:591
#define eigen_assert(x)
Definition Macros.h:579
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resizeLike(const EigenBase< OtherDerived > &_other)
Definition PlainObjectBase.h:362
constexpr auto size(const C &c) -> decltype(c.size())
Definition span.hpp:183

◆ _set()

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::_set ( const DenseBase< OtherDerived > &  other)
inlineprotectedinherited

Copies the value of the expression other into *this with automatic resizing.

*this might be resized to match the dimensions of other. If *this was a null matrix (not already initialized), it will be initialized.

Note that copying a row-vector into a vector (and conversely) is allowed. The resizing, if any, is then done in the appropriate way so that row-vectors remain row-vectors and vectors remain vectors.

See also
operator=(const MatrixBase<OtherDerived>&), _set_noalias()
713 {
714 internal::call_assignment(this->derived(), other.derived());
715 return this->derived();
716 }

◆ _set_noalias()

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::_set_noalias ( const DenseBase< OtherDerived > &  other)
inlineprotectedinherited
726 {
727 // I don't think we need this resize call since the lazyAssign will anyways resize
728 // and lazyAssign will be called by the assign selector.
729 //_resize_to_match(other);
730 // the 'false' below means to enforce lazy evaluation. We don't use lazyAssign() because
731 // it wouldn't allow to copy a row-vector into a column-vector.
732 internal::call_assignment_no_alias(this->derived(), other.derived(), internal::assign_op<Scalar,typename OtherDerived::Scalar>());
733 return this->derived();
734 }

◆ base() [1/2]

template<typename _Scalar , int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
EIGEN_DEVICE_FUNC Base & Eigen::PlainObjectBase< Derived >::base ( )
inline
146{ return *static_cast<Base*>(this); }

◆ base() [2/2]

template<typename _Scalar , int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
EIGEN_DEVICE_FUNC const Base & Eigen::PlainObjectBase< Derived >::base ( ) const
inline
148{ return *static_cast<const Base*>(this); }

◆ coeff() [1/2]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar & Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::coeff ( Index  index) const
inlineinherited

This is an overloaded version of DenseCoeffsBase<Derived,ReadOnlyAccessors>::coeff(Index) const provided to by-pass the creation of an evaluator of the expression, thus saving compilation efforts.

See DenseCoeffsBase<Derived,ReadOnlyAccessors>::coeff(Index) const for details.

174 {
175 return m_storage.data()[index];
176 }
EIGEN_DEVICE_FUNC const T * data() const
Definition DenseStorage.h:215
DenseStorage< Scalar, Base::MaxSizeAtCompileTime, Base::RowsAtCompileTime, Base::ColsAtCompileTime, Options > m_storage
Definition PlainObjectBase.h:139

◆ coeff() [2/2]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar & Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::coeff ( Index  rowId,
Index  colId 
) const
inlineinherited

This is an overloaded version of DenseCoeffsBase<Derived,ReadOnlyAccessors>::coeff(Index,Index) const provided to by-pass the creation of an evaluator of the expression, thus saving compilation efforts.

See DenseCoeffsBase<Derived,ReadOnlyAccessors>::coeff(Index) const for details.

161 {
162 if(Flags & RowMajorBit)
163 return m_storage.data()[colId + rowId * m_storage.cols()];
164 else // column-major
165 return m_storage.data()[rowId + colId * m_storage.rows()];
166 }
static EIGEN_DEVICE_FUNC Index rows(void)
Definition DenseStorage.h:211
static EIGEN_DEVICE_FUNC Index cols(void)
Definition DenseStorage.h:212

◆ coeffRef() [1/4]

template<typename _Scalar , int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & Eigen::PlainObjectBase< Derived >::coeffRef ( Index  index)
inline

This is an overloaded version of DenseCoeffsBase<Derived,WriteAccessors>::coeffRef(Index) const provided to by-pass the creation of an evaluator of the expression, thus saving compilation efforts.

See DenseCoeffsBase<Derived,WriteAccessors>::coeffRef(Index) const for details.

197 {
198 return m_storage.data()[index];
199 }

◆ coeffRef() [2/4]

template<typename _Scalar , int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar & Eigen::PlainObjectBase< Derived >::coeffRef ( Index  index) const
inline

This is the const version of coeffRef(Index) which is thus synonym of coeff(Index). It is provided for convenience.

216 {
217 return m_storage.data()[index];
218 }

◆ coeffRef() [3/4]

template<typename _Scalar , int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & Eigen::PlainObjectBase< Derived >::coeffRef ( Index  rowId,
Index  colId 
)
inline

This is an overloaded version of DenseCoeffsBase<Derived,WriteAccessors>::coeffRef(Index,Index) const provided to by-pass the creation of an evaluator of the expression, thus saving compilation efforts.

See DenseCoeffsBase<Derived,WriteAccessors>::coeffRef(Index,Index) const for details.

184 {
185 if(Flags & RowMajorBit)
186 return m_storage.data()[colId + rowId * m_storage.cols()];
187 else // column-major
188 return m_storage.data()[rowId + colId * m_storage.rows()];
189 }
const unsigned int RowMajorBit
Definition Constants.h:61

Referenced by Eigen::HessenbergDecomposition< _MatrixType >::_compute(), Eigen::FullPivHouseholderQR< _MatrixType >::_solve_impl(), Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::asPermutation(), Eigen::GeneralizedEigenSolver< _MatrixType >::compute(), Eigen::internal::compute_inverse_size3_helper(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::computeRotationScaling(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::computeScalingRotation(), Eigen::RealSchur< _MatrixType >::computeShift(), igl::xml::serialization_xml::deserialize(), Eigen::EigenSolver< _MatrixType >::eigenvectors(), Eigen::internal::kernel_retval< FullPivLU< _MatrixType > >::evalTo(), Eigen::internal::image_retval< FullPivLU< _MatrixType > >::evalTo(), Eigen::internal::FullPivHouseholderQRMatrixQReturnType< MatrixType >::evalTo(), Eigen::RealSchur< _MatrixType >::initFrancisQRStep(), Eigen::RealSchur< _MatrixType >::performFrancisQRStep(), Eigen::ComplexSchur< _MatrixType >::reduceToTriangularForm(), Eigen::internal::compute_inverse_and_det_with_check< MatrixType, ResultType, 3 >::run(), Eigen::internal::compute_inverse< MatrixType, ResultType, 3 >::run(), Eigen::internal::permutation_matrix_product< ExpressionType, Side, Transposed, DenseShape >::run(), Eigen::internal::product_triangular_matrix_matrix< Scalar, Index, Mode, true, LhsStorageOrder, ConjugateLhs, RhsStorageOrder, ConjugateRhs, ColMajor, Version >::run(), Eigen::internal::product_triangular_matrix_matrix< Scalar, Index, Mode, false, LhsStorageOrder, ConjugateLhs, RhsStorageOrder, ConjugateRhs, ColMajor, Version >::run(), Eigen::internal::svd_precondition_2x2_block_to_be_real< MatrixType, QRPreconditioner, true >::run(), igl::slice(), Eigen::RealQZ< _MatrixType >::step(), Eigen::ComplexSchur< _MatrixType >::subdiagonalEntryIsNeglegible(), Eigen::QuaternionBase< Derived >::toRotationMatrix(), and Eigen::AngleAxis< _Scalar >::toRotationMatrix().

+ Here is the caller graph for this function:

◆ coeffRef() [4/4]

template<typename _Scalar , int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar & Eigen::PlainObjectBase< Derived >::coeffRef ( Index  rowId,
Index  colId 
) const
inline

This is the const version of coeffRef(Index,Index) which is thus synonym of coeff(Index,Index). It is provided for convenience.

205 {
206 if(Flags & RowMajorBit)
207 return m_storage.data()[colId + rowId * m_storage.cols()];
208 else // column-major
209 return m_storage.data()[rowId + colId * m_storage.rows()];
210 }

◆ cols()

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::cols ( ) const
inlineinherited
153{ return m_storage.cols(); }

◆ conservativeResize() [1/4]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::conservativeResize ( Index  rows,
Index  cols 
)
inlineinherited

Resizes the matrix to rows x cols while leaving old values untouched.

The method is intended for matrices of dynamic size. If you only want to change the number of rows and/or of columns, you can use conservativeResize(NoChange_t, Index) or conservativeResize(Index, NoChange_t).

Matrices are resized relative to the top-left element. In case values need to be appended to the matrix they will be uninitialized.

391 {
392 internal::conservative_resize_like_impl<Derived>::run(*this, rows, cols);
393 }

◆ conservativeResize() [2/4]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::conservativeResize ( Index  rows,
NoChange_t   
)
inlineinherited

Resizes the matrix to rows x cols while leaving old values untouched.

As opposed to conservativeResize(Index rows, Index cols), this version leaves the number of columns unchanged.

In case the matrix is growing, new rows will be uninitialized.

404 {
405 // Note: see the comment in conservativeResize(Index,Index)
406 conservativeResize(rows, cols());
407 }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void conservativeResize(Index rows, Index cols)
Definition PlainObjectBase.h:390

◆ conservativeResize() [3/4]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::conservativeResize ( Index  size)
inlineinherited

Resizes the vector to size while retaining old values.

\only_for_vectors. This method does not work for partially dynamic matrices when the static dimension is anything other than 1. For example it will not work with Matrix<double, 2, Dynamic>.

When values are appended, they will be uninitialized.

433 {
434 internal::conservative_resize_like_impl<Derived>::run(*this, size);
435 }

◆ conservativeResize() [4/4]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::conservativeResize ( NoChange_t  ,
Index  cols 
)
inlineinherited

Resizes the matrix to rows x cols while leaving old values untouched.

As opposed to conservativeResize(Index rows, Index cols), this version leaves the number of rows unchanged.

In case the matrix is growing, new columns will be uninitialized.

418 {
419 // Note: see the comment in conservativeResize(Index,Index)
420 conservativeResize(rows(), cols);
421 }

◆ conservativeResizeLike()

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::conservativeResizeLike ( const DenseBase< OtherDerived > &  other)
inlineinherited

Resizes the matrix to rows x cols of other, while leaving old values untouched.

The method is intended for matrices of dynamic size. If you only want to change the number of rows and/or of columns, you can use conservativeResize(NoChange_t, Index) or conservativeResize(Index, NoChange_t).

Matrices are resized relative to the top-left element. In case values need to be appended to the matrix they will copied from other.

449 {
450 internal::conservative_resize_like_impl<Derived,OtherDerived>::run(*this, other);
451 }

◆ data() [1/2]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar * Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::data ( )
inlineinherited
Returns
a pointer to the data array of this matrix
260 { return m_storage.data(); }

◆ data() [2/2]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar * Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::data ( ) const
inlineinherited
Returns
a const pointer to the data array of this matrix
256 { return m_storage.data(); }

◆ innerStride()

template<typename _Scalar , int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
EIGEN_DEVICE_FUNC Index Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::innerStride ( ) const
inline
380{ return 1; }

◆ lazyAssign()

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::lazyAssign ( const DenseBase< OtherDerived > &  other)
inlineinherited
See also
MatrixBase::lazyAssign()
466 {
467 _resize_to_match(other);
468 return Base::lazyAssign(other.derived());
469 }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _resize_to_match(const EigenBase< OtherDerived > &other)
Definition PlainObjectBase.h:682

◆ Map() [1/12]

static ConstMapType Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Map ( const Scalar data)
inlinestaticinherited
588 { return ConstMapType(data); }

◆ Map() [2/12]

static StridedConstMapType< Stride< Outer, Inner > >::type Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Map ( const Scalar data,
const Stride< Outer, Inner > &  stride 
)
inlinestaticinherited
615 { return typename StridedConstMapType<Stride<Outer, Inner> >::type(data, stride); }

◆ Map() [3/12]

static ConstMapType Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Map ( const Scalar data,
Index  rows,
Index  cols 
)
inlinestaticinherited
596 { return ConstMapType(data, rows, cols); }

◆ Map() [4/12]

static StridedConstMapType< Stride< Outer, Inner > >::type Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Map ( const Scalar data,
Index  rows,
Index  cols,
const Stride< Outer, Inner > &  stride 
)
inlinestaticinherited
627 { return typename StridedConstMapType<Stride<Outer, Inner> >::type(data, rows, cols, stride); }

◆ Map() [5/12]

static ConstMapType Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Map ( const Scalar data,
Index  size 
)
inlinestaticinherited
592 { return ConstMapType(data, size); }

◆ Map() [6/12]

static StridedConstMapType< Stride< Outer, Inner > >::type Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Map ( const Scalar data,
Index  size,
const Stride< Outer, Inner > &  stride 
)
inlinestaticinherited
621 { return typename StridedConstMapType<Stride<Outer, Inner> >::type(data, size, stride); }

◆ Map() [7/12]

static MapType Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Map ( Scalar data)
inlinestaticinherited
590 { return MapType(data); }
Eigen::Map< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >, Unaligned > MapType
Definition PlainObjectBase.h:123

◆ Map() [8/12]

static StridedMapType< Stride< Outer, Inner > >::type Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Map ( Scalar data,
const Stride< Outer, Inner > &  stride 
)
inlinestaticinherited
618 { return typename StridedMapType<Stride<Outer, Inner> >::type(data, stride); }

◆ Map() [9/12]

static MapType Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Map ( Scalar data,
Index  rows,
Index  cols 
)
inlinestaticinherited
598 { return MapType(data, rows, cols); }

◆ Map() [10/12]

static StridedMapType< Stride< Outer, Inner > >::type Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Map ( Scalar data,
Index  rows,
Index  cols,
const Stride< Outer, Inner > &  stride 
)
inlinestaticinherited
630 { return typename StridedMapType<Stride<Outer, Inner> >::type(data, rows, cols, stride); }

◆ Map() [11/12]

static MapType Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Map ( Scalar data,
Index  size 
)
inlinestaticinherited
594 { return MapType(data, size); }

◆ Map() [12/12]

static StridedMapType< Stride< Outer, Inner > >::type Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Map ( Scalar data,
Index  size,
const Stride< Outer, Inner > &  stride 
)
inlinestaticinherited
624 { return typename StridedMapType<Stride<Outer, Inner> >::type(data, size, stride); }

◆ MapAligned() [1/12]

static ConstAlignedMapType Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::MapAligned ( const Scalar data)
inlinestaticinherited
601 { return ConstAlignedMapType(data); }
const Eigen::Map< const Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >, AlignedMax > ConstAlignedMapType
Definition PlainObjectBase.h:132

◆ MapAligned() [2/12]

static StridedConstAlignedMapType< Stride< Outer, Inner > >::type Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::MapAligned ( const Scalar data,
const Stride< Outer, Inner > &  stride 
)
inlinestaticinherited
634 { return typename StridedConstAlignedMapType<Stride<Outer, Inner> >::type(data, stride); }

◆ MapAligned() [3/12]

static ConstAlignedMapType Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::MapAligned ( const Scalar data,
Index  rows,
Index  cols 
)
inlinestaticinherited
609 { return ConstAlignedMapType(data, rows, cols); }

◆ MapAligned() [4/12]

static StridedConstAlignedMapType< Stride< Outer, Inner > >::type Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::MapAligned ( const Scalar data,
Index  rows,
Index  cols,
const Stride< Outer, Inner > &  stride 
)
inlinestaticinherited
646 { return typename StridedConstAlignedMapType<Stride<Outer, Inner> >::type(data, rows, cols, stride); }

◆ MapAligned() [5/12]

static ConstAlignedMapType Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::MapAligned ( const Scalar data,
Index  size 
)
inlinestaticinherited
605 { return ConstAlignedMapType(data, size); }

◆ MapAligned() [6/12]

static StridedConstAlignedMapType< Stride< Outer, Inner > >::type Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::MapAligned ( const Scalar data,
Index  size,
const Stride< Outer, Inner > &  stride 
)
inlinestaticinherited
640 { return typename StridedConstAlignedMapType<Stride<Outer, Inner> >::type(data, size, stride); }

◆ MapAligned() [7/12]

static AlignedMapType Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::MapAligned ( Scalar data)
inlinestaticinherited
603 { return AlignedMapType(data); }
Eigen::Map< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >, AlignedMax > AlignedMapType
Definition PlainObjectBase.h:131

◆ MapAligned() [8/12]

static StridedAlignedMapType< Stride< Outer, Inner > >::type Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::MapAligned ( Scalar data,
const Stride< Outer, Inner > &  stride 
)
inlinestaticinherited
637 { return typename StridedAlignedMapType<Stride<Outer, Inner> >::type(data, stride); }

◆ MapAligned() [9/12]

static AlignedMapType Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::MapAligned ( Scalar data,
Index  rows,
Index  cols 
)
inlinestaticinherited
611 { return AlignedMapType(data, rows, cols); }

◆ MapAligned() [10/12]

static StridedAlignedMapType< Stride< Outer, Inner > >::type Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::MapAligned ( Scalar data,
Index  rows,
Index  cols,
const Stride< Outer, Inner > &  stride 
)
inlinestaticinherited
649 { return typename StridedAlignedMapType<Stride<Outer, Inner> >::type(data, rows, cols, stride); }

◆ MapAligned() [11/12]

static AlignedMapType Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::MapAligned ( Scalar data,
Index  size 
)
inlinestaticinherited
607 { return AlignedMapType(data, size); }

◆ MapAligned() [12/12]

static StridedAlignedMapType< Stride< Outer, Inner > >::type Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::MapAligned ( Scalar data,
Index  size,
const Stride< Outer, Inner > &  stride 
)
inlinestaticinherited
643 { return typename StridedAlignedMapType<Stride<Outer, Inner> >::type(data, size, stride); }

◆ operator=() [1/6]

template<typename _Scalar , int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix & Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::operator= ( const DenseBase< OtherDerived > &  other)
inline
224 {
225 return Base::_set(other);
226 }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & _set(const DenseBase< OtherDerived > &other)
Copies the value of the expression other into *this with automatic resizing.
Definition PlainObjectBase.h:712

◆ operator=() [2/6]

template<typename _Scalar , int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix & Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::operator= ( const EigenBase< OtherDerived > &  other)
inline

Copies the generic expression other into *this.

The expression must provide a (templated) evalTo(Derived& dst) const function which does the actual job. In practice, this allows any user to write its own special matrix without having to modify MatrixBase

Returns
a reference to *this.
237 {
238 return Base::operator=(other);
239 }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator=(const PlainObjectBase &other)
Definition PlainObjectBase.h:457

◆ operator=() [3/6]

template<typename _Scalar , int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix & Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::operator= ( const Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &  other)
inline

Assigns matrices to each other.

Note
This is a special case of the templated operator=. Its purpose is to prevent a default operator= from hiding the templated operator=.
207 {
208 return Base::_set(other);
209 }

◆ operator=() [4/6]

template<typename _Scalar , int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix & Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::operator= ( const ReturnByValue< OtherDerived > &  func)
inline
244 {
245 return Base::operator=(func);
246 }

◆ operator=() [5/6]

template<typename _Scalar , int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Matrix & Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::operator= ( const RotationBase< OtherDerived, ColsAtCompileTime > &  r)

◆ operator=() [6/6]

template<typename _Scalar , int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Matrix< _Scalar, _Rows, _Cols, _Storage, _MaxRows, _MaxCols > & Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::operator= ( const RotationBase< OtherDerived, ColsAtCompileTime > &  r)

Set a Dim x Dim rotation matrix from the rotation r.

\geometry_module

156{
157 EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(Matrix,int(OtherDerived::Dim),int(OtherDerived::Dim))
158 return *this = r.toRotationMatrix();
159}

References EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE, and Eigen::RotationBase< Derived, _Dim >::toRotationMatrix().

+ Here is the call graph for this function:

◆ outerStride()

template<typename _Scalar , int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
EIGEN_DEVICE_FUNC Index Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::outerStride ( ) const
inline

◆ packet() [1/2]

EIGEN_STRONG_INLINE PacketScalar Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::packet ( Index  index) const
inlineinherited
233 {
234 return internal::ploadt<PacketScalar, LoadMode>(m_storage.data() + index);
235 }

◆ packet() [2/2]

EIGEN_STRONG_INLINE PacketScalar Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::packet ( Index  rowId,
Index  colId 
) const
inlineinherited
223 {
224 return internal::ploadt<PacketScalar, LoadMode>
225 (m_storage.data() + (Flags & RowMajorBit
226 ? colId + rowId * m_storage.cols()
227 : rowId + colId * m_storage.rows()));
228 }

◆ resize() [1/4]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::resize ( Index  rows,
Index  cols 
)
inlineinherited

Resizes *this to a rows x cols matrix.

This method is intended for dynamic-size matrices, although it is legal to call it on any matrix as long as fixed dimensions are left unchanged. If you only want to change the number of rows and/or of columns, you can use resize(NoChange_t, Index), resize(Index, NoChange_t).

If the current number of coefficients of *this exactly matches the product rows * cols, then no memory allocation is performed and the current values are left unchanged. In all other cases, including shrinking, the data is reallocated and all previous values are lost.

Example:

Output:

See also
resize(Index) for vectors, resize(NoChange_t, Index), resize(Index, NoChange_t)
280 {
281 eigen_assert( EIGEN_IMPLIES(RowsAtCompileTime!=Dynamic,rows==RowsAtCompileTime)
282 && EIGEN_IMPLIES(ColsAtCompileTime!=Dynamic,cols==ColsAtCompileTime)
283 && EIGEN_IMPLIES(RowsAtCompileTime==Dynamic && MaxRowsAtCompileTime!=Dynamic,rows<=MaxRowsAtCompileTime)
284 && EIGEN_IMPLIES(ColsAtCompileTime==Dynamic && MaxColsAtCompileTime!=Dynamic,cols<=MaxColsAtCompileTime)
285 && rows>=0 && cols>=0 && "Invalid sizes when resizing a matrix or array.");
286 internal::check_rows_cols_for_overflow<MaxSizeAtCompileTime>::run(rows, cols);
287 #ifdef EIGEN_INITIALIZE_COEFFS
289 bool size_changed = size != this->size();
290 m_storage.resize(size, rows, cols);
292 #else
293 m_storage.resize(rows*cols, rows, cols);
294 #endif
295 }
EIGEN_DEVICE_FUNC void resize(Index, Index, Index)
Definition DenseStorage.h:214

◆ resize() [2/4]

EIGEN_DEVICE_FUNC void Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::resize ( Index  rows,
NoChange_t   
)
inlineinherited

Resizes the matrix, changing only the number of rows. For the parameter of type NoChange_t, just pass the special value NoChange as in the example below.

Example:

Output:

See also
resize(Index,Index)
349 {
350 resize(rows, cols());
351 }

◆ resize() [3/4]

EIGEN_DEVICE_FUNC void Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::resize ( Index  size)
inlineinherited

Resizes *this to a vector of length size

\only_for_vectors. This method does not work for partially dynamic matrices when the static dimension is anything other than 1. For example it will not work with Matrix<double, 2, Dynamic>.

Example:

Output:

See also
resize(Index,Index), resize(NoChange_t, Index), resize(Index, NoChange_t)
310 {
311 EIGEN_STATIC_ASSERT_VECTOR_ONLY(PlainObjectBase)
312 eigen_assert(((SizeAtCompileTime == Dynamic && (MaxSizeAtCompileTime==Dynamic || size<=MaxSizeAtCompileTime)) || SizeAtCompileTime == size) && size>=0);
313 #ifdef EIGEN_INITIALIZE_COEFFS
314 bool size_changed = size != this->size();
315 #endif
316 if(RowsAtCompileTime == 1)
317 m_storage.resize(size, 1, size);
318 else
319 m_storage.resize(size, size, 1);
320 #ifdef EIGEN_INITIALIZE_COEFFS
322 #endif
323 }
#define EIGEN_STATIC_ASSERT_VECTOR_ONLY(TYPE)
Definition StaticAssert.h:139

◆ resize() [4/4]

EIGEN_DEVICE_FUNC void Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::resize ( NoChange_t  ,
Index  cols 
)
inlineinherited

Resizes the matrix, changing only the number of columns. For the parameter of type NoChange_t, just pass the special value NoChange as in the example below.

Example:

Output:

See also
resize(Index,Index)
335 {
336 resize(rows(), cols);
337 }

◆ resizeLike()

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::resizeLike ( const EigenBase< OtherDerived > &  _other)
inlineinherited

Resizes *this to have the same dimensions as other. Takes care of doing all the checking that's needed.

Note that copying a row-vector into a vector (and conversely) is allowed. The resizing, if any, is then done in the appropriate way so that row-vectors remain row-vectors and vectors remain vectors.

363 {
364 const OtherDerived& other = _other.derived();
365 internal::check_rows_cols_for_overflow<MaxSizeAtCompileTime>::run(other.rows(), other.cols());
366 const Index othersize = other.rows()*other.cols();
367 if(RowsAtCompileTime == 1)
368 {
369 eigen_assert(other.rows() == 1 || other.cols() == 1);
370 resize(1, othersize);
371 }
372 else if(ColsAtCompileTime == 1)
373 {
374 eigen_assert(other.rows() == 1 || other.cols() == 1);
375 resize(othersize, 1);
376 }
377 else resize(other.rows(), other.cols());
378 }

◆ rows()

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::rows ( ) const
inlineinherited
151{ return m_storage.rows(); }

◆ setConstant() [1/2]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::setConstant ( Index  rows,
Index  cols,
const Scalar val 
)
inherited

Resizes to the given size, and sets all coefficients in this expression to the given value val.

Parameters
rowsthe new number of rows
colsthe new number of columns
valthe value to which all coefficients are set

Example:

Output:

See also
MatrixBase::setConstant(const Scalar&), setConstant(Index,const Scalar&), class CwiseNullaryOp, MatrixBase::Constant(const Scalar&)
361{
362 resize(rows, cols);
363 return setConstant(val);
364}
EIGEN_DEVICE_FUNC Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & setConstant(Index size, const Scalar &val)
Definition CwiseNullaryOp.h:341

◆ setConstant() [2/2]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::setConstant ( Index  size,
const Scalar val 
)
inherited

Resizes to the given size, and sets all coefficients in this expression to the given value val.

\only_for_vectors

Example:

Output:

See also
MatrixBase::setConstant(const Scalar&), setConstant(Index,Index,const Scalar&), class CwiseNullaryOp, MatrixBase::Constant(const Scalar&)
342{
343 resize(size);
344 return setConstant(val);
345}

◆ setOnes() [1/2]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::setOnes ( Index  rows,
Index  cols 
)
inherited

Resizes to the given size, and sets all coefficients in this expression to one.

Parameters
rowsthe new number of rows
colsthe new number of columns

Example:

Output:

See also
MatrixBase::setOnes(), setOnes(Index), class CwiseNullaryOp, MatrixBase::Ones()
660{
661 resize(rows, cols);
662 return setConstant(Scalar(1));
663}
internal::traits< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::Scalar Scalar
Definition PlainObjectBase.h:106

◆ setOnes() [2/2]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::setOnes ( Index  newSize)
inherited

Resizes to the given newSize, and sets all coefficients in this expression to one.

\only_for_vectors

Example:

Output:

See also
MatrixBase::setOnes(), setOnes(Index,Index), class CwiseNullaryOp, MatrixBase::Ones()
642{
643 resize(newSize);
644 return setConstant(Scalar(1));
645}

◆ setRandom() [1/2]

EIGEN_STRONG_INLINE Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::setRandom ( Index  rows,
Index  cols 
)
inherited

Resizes to the given size, and sets all coefficients in this expression to random values.

Numbers are uniformly spread through their whole definition range for integer types, and in the [-1:1] range for floating point scalar types.

\not_reentrant

Parameters
rowsthe new number of rows
colsthe new number of columns

Example:

Output:

See also
DenseBase::setRandom(), setRandom(Index), class CwiseNullaryOp, DenseBase::Random()
175{
176 resize(rows, cols);
177 return setRandom();
178}
Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & setRandom(Index size)
Definition Random.h:151

◆ setRandom() [2/2]

EIGEN_STRONG_INLINE Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::setRandom ( Index  newSize)
inherited

Resizes to the given newSize, and sets all coefficients in this expression to random values.

Numbers are uniformly spread through their whole definition range for integer types, and in the [-1:1] range for floating point scalar types.

\only_for_vectors \not_reentrant

Example:

Output:

See also
DenseBase::setRandom(), setRandom(Index,Index), class CwiseNullaryOp, DenseBase::Random()
152{
153 resize(newSize);
154 return setRandom();
155}

◆ setZero() [1/2]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::setZero ( Index  rows,
Index  cols 
)
inherited

Resizes to the given size, and sets all coefficients in this expression to zero.

Parameters
rowsthe new number of rows
colsthe new number of columns

Example:

Output:

See also
DenseBase::setZero(), setZero(Index), class CwiseNullaryOp, DenseBase::Zero()
534{
535 resize(rows, cols);
536 return setConstant(Scalar(0));
537}

◆ setZero() [2/2]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::setZero ( Index  newSize)
inherited

Resizes to the given size, and sets all coefficients in this expression to zero.

\only_for_vectors

Example:

Output:

See also
DenseBase::setZero(), setZero(Index,Index), class CwiseNullaryOp, DenseBase::Zero()
516{
517 resize(newSize);
518 return setConstant(Scalar(0));
519}

◆ swap() [1/2]

EIGEN_DEVICE_FUNC void Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::swap ( DenseBase< OtherDerived > &  other)
inlineinherited
887 {
888 enum { SwapPointers = internal::is_same<Derived, OtherDerived>::value && Base::SizeAtCompileTime==Dynamic };
889 internal::matrix_swap_impl<Derived, OtherDerived, bool(SwapPointers)>::run(this->derived(), other.derived());
890 }
friend struct internal::matrix_swap_impl
Definition PlainObjectBase.h:875

◆ swap() [2/2]

EIGEN_DEVICE_FUNC void Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::swap ( DenseBase< OtherDerived > const other)
inlineinherited
898 { Base::swap(other.derived()); }

◆ writePacket() [1/2]

EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::writePacket ( Index  index,
const PacketScalar val 
)
inlineinherited
250 {
251 internal::pstoret<Scalar, PacketScalar, StoreMode>(m_storage.data() + index, val);
252 }

◆ writePacket() [2/2]

EIGEN_STRONG_INLINE void Eigen::PlainObjectBase< Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > >::writePacket ( Index  rowId,
Index  colId,
const PacketScalar val 
)
inlineinherited
240 {
241 internal::pstoret<Scalar, PacketScalar, StoreMode>
242 (m_storage.data() + (Flags & RowMajorBit
243 ? colId + rowId * m_storage.cols()
244 : rowId + colId * m_storage.rows()), val);
245 }

Friends And Related Symbol Documentation

◆ internal::conservative_resize_like_impl

template<typename _Scalar , int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
template<typename Derived , typename OtherDerived , bool IsVector>
friend struct internal::conservative_resize_like_impl
friend

Member Data Documentation

◆ m_storage

template<typename _Scalar , int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
DenseStorage<Scalar, Base::MaxSizeAtCompileTime, Base::RowsAtCompileTime, Base::ColsAtCompileTime, Options> Eigen::PlainObjectBase< Derived >::m_storage
protected

The documentation for this class was generated from the following files: