Eigen  3.4.90 (git rev 9589cc4e7fd8e4538bedef80dd36c7738977a8be)
 
Loading...
Searching...
No Matches
Eigen::Matrix< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > Class Template Reference

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

Detailed Description

template<typename Scalar_, int Rows_, int Cols_, int Options_ = AutoAlign | ((Rows_ == 1 && Cols_ != 1) ? Eigen::RowMajor : (Cols_ == 1 && Rows_ != 1) ? Eigen::ColMajor : EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION), int MaxRows_ = Rows_, int MaxCols_ = Cols_>
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
Scalar_Numeric type, e.g. float, double, int or std::complex<float>. User defined scalar types are supported as well (see here).
Rows_Number of rows, or Dynamic
Cols_Number of columns, or Dynamic

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

Template Parameters
Options_A 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.
MaxRows_Maximum number of rows. Defaults to Rows_ (note).
MaxCols_Maximum number of columns. Defaults to Cols_ (note).

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

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

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

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;
Matrix< int, Dynamic, Dynamic > MatrixXi
Dynamic×Dynamic matrix of type int.
Definition Matrix.h:477
Matrix< double, Dynamic, 1 > VectorXd
Dynamic×1 vector of type double.
Definition Matrix.h:479

This class can be extended with the help of the plugin mechanism described on the page Extending MatrixBase (and other classes) 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 at 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 at 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
constexpr Matrix()=default
Default constructor.
struct {
T *data; // with (size_t(data)%EIGEN_MAX_ALIGN_BYTES)==0
Eigen::Index rows, cols;
};
constexpr const Scalar * data() const
Definition PlainObjectBase.h:247
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:82
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
Eigen::Index rows, cols;
};

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 API methods for matrices, The class hierarchy, Storage orders
+ Inheritance diagram for Eigen::Matrix< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >:

Public Types

typedef PlainObjectBase< MatrixBase
 Base class typedef.
 

Public Member Functions

constexpr Scalar & coeffRef (Index index)
 
constexpr const Scalar & coeffRef (Index index) const
 
constexpr Scalar & coeffRef (Index rowId, Index colId)
 
constexpr const Scalar & coeffRef (Index rowId, Index colId) const
 
constexpr Matrix ()=default
 Default constructor.
 
template<typename OtherDerived>
 Matrix (const EigenBase< OtherDerived > &other)
 Copy constructor for generic expressions.
 
constexpr Matrix (const Matrix &)=default
 Copy constructor.
 
template<typename OtherDerived>
 Matrix (const RotationBase< OtherDerived, ColsAtCompileTime > &r)
 Constructs a Dim x Dim rotation matrix from the rotation r.
 
template<typename... ArgTypes>
 Matrix (const Scalar &a0, const Scalar &a1, const Scalar &a2, const Scalar &a3, const ArgTypes &... args)
 Construct a row of column vector with fixed size from an arbitrary number of coefficients.
 
 Matrix (const Scalar &x)
 Constructs an initialized 1x1 matrix with the given coefficient.
 
 Matrix (const Scalar &x, const Scalar &y)
 Constructs an initialized 2D vector with given coefficients.
 
 Matrix (const Scalar &x, const Scalar &y, const Scalar &z)
 Constructs an initialized 3D vector with given coefficients.
 
 Matrix (const Scalar &x, const Scalar &y, const Scalar &z, const Scalar &w)
 Constructs an initialized 4D vector with given coefficients.
 
 Matrix (const Scalar *data)
 Constructs a fixed-sized matrix initialized with coefficients starting at data.
 
constexpr Matrix (const std::initializer_list< std::initializer_list< Scalar > > &list)
 Constructs a Matrix and initializes it from the coefficients given as initializer-lists grouped by row. [c++11] .
 
 Matrix (Index dim)
 Constructs a vector or row-vector with given dimension. This is only for vectors (either row-vectors or column-vectors), i.e. matrices which are known at compile-time to have either one row or one column.
 
 Matrix (Index rows, Index cols)
 Constructs an uninitialized matrix with rows rows and cols columns.
 
constexpr Matrix (Matrix &&)=default
 Move constructor.
 
template<typename OtherDerived>
Matrixoperator= (const EigenBase< OtherDerived > &other)
 Copies the generic expression other into *this.
 
constexpr Matrixoperator= (const Matrix &other)
 Assigns matrices to each other.
 
template<typename OtherDerived>
Matrix< Scalar_, Rows_, Cols_, Storage_, MaxRows_, MaxCols_ > & operator= (const RotationBase< OtherDerived, ColsAtCompileTime > &r)
 Set a Dim x Dim rotation matrix from the rotation r.
 
constexpr Matrixoperator= (Matrix &&other) EIGEN_NOEXCEPT_IF(std
 Moves the matrix into the other one.
 
- Public Member Functions inherited from Eigen::PlainObjectBase< Derived >
constexpr const Scalar & coeff (Index index) const
 
constexpr const Scalar & coeff (Index rowId, Index colId) const
 
constexpr Scalar & coeffRef (Index index)
 
constexpr const Scalar & coeffRef (Index index) const
 
constexpr Scalar & coeffRef (Index rowId, Index colId)
 
constexpr const Scalar & coeffRef (Index rowId, Index colId) const
 
void conservativeResize (Index rows, Index cols)
 
void conservativeResize (Index rows, NoChange_t)
 
void conservativeResize (Index size)
 
void conservativeResize (NoChange_t, Index cols)
 
template<typename OtherDerived>
void conservativeResizeLike (const DenseBase< OtherDerived > &other)
 
constexpr Scalar * data ()
 
constexpr const Scalar * data () const
 
template<typename OtherDerived>
Derived & lazyAssign (const DenseBase< OtherDerived > &other)
 
template<typename OtherDerived>
Derived & operator= (const EigenBase< OtherDerived > &other)
 Copies the generic expression other into *this.
 
constexpr Derived & operator= (const PlainObjectBase &other)
 
constexpr void resize (Index rows, Index cols)
 
constexpr void resize (Index rows, NoChange_t)
 
constexpr void resize (Index size)
 
constexpr void resize (NoChange_t, Index cols)
 
template<typename OtherDerived>
void resizeLike (const EigenBase< OtherDerived > &_other)
 
Derived & setConstant (Index rows, Index cols, const Scalar &val)
 
Derived & setConstant (Index rows, NoChange_t, const Scalar &val)
 
Derived & setConstant (Index size, const Scalar &val)
 
Derived & setConstant (NoChange_t, Index cols, const Scalar &val)
 
Derived & setOnes (Index rows, Index cols)
 
Derived & setOnes (Index rows, NoChange_t)
 
Derived & setOnes (Index size)
 
Derived & setOnes (NoChange_t, Index cols)
 
Derived & setRandom (Index rows, Index cols)
 
Derived & setRandom (Index rows, NoChange_t)
 
Derived & setRandom (Index size)
 
Derived & setRandom (NoChange_t, Index cols)
 
Derived & setZero (Index rows, Index cols)
 
Derived & setZero (Index rows, NoChange_t)
 
Derived & setZero (Index size)
 
Derived & setZero (NoChange_t, Index cols)
 

Additional Inherited Members

- Protected Member Functions inherited from Eigen::PlainObjectBase< Derived >
template<typename OtherDerived>
constexpr Derived & _set (const DenseBase< OtherDerived > &other)
 Copies the value of the expression other into *this with automatic resizing.
 
constexpr PlainObjectBaseoperator= (PlainObjectBase &&other) EIGEN_NOEXCEPT
 Move assignment operator.
 
template<typename OtherDerived>
 PlainObjectBase (const DenseBase< OtherDerived > &other)
 
template<typename OtherDerived>
 PlainObjectBase (const EigenBase< OtherDerived > &other)
 
constexpr PlainObjectBase (const PlainObjectBase &)=default
 
template<typename OtherDerived>
 PlainObjectBase (const ReturnByValue< OtherDerived > &other)
 Copy constructor with in-place evaluation.
 
template<typename... ArgTypes>
 PlainObjectBase (const Scalar &a0, const Scalar &a1, const Scalar &a2, const Scalar &a3, const ArgTypes &... args)
 Construct a row of column vector with fixed size from an arbitrary number of coefficients.
 
constexpr PlainObjectBase (const std::initializer_list< std::initializer_list< Scalar > > &list)
 Constructs a Matrix or Array and initializes it by elements given by an initializer list of initializer lists.
 
constexpr PlainObjectBase (PlainObjectBase &&)=default
 Move constructor.
 

Member Typedef Documentation

◆ Base

template<typename Scalar_, int Rows_, int Cols_, int Options_ = AutoAlign | ((Rows_ == 1 && Cols_ != 1) ? Eigen::RowMajor : (Cols_ == 1 && Rows_ != 1) ? Eigen::ColMajor : EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION), int MaxRows_ = Rows_, int MaxCols_ = Cols_>
typedef PlainObjectBase<Matrix> Eigen::Matrix< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::Base

Base class typedef.

See also
PlainObjectBase

Constructor & Destructor Documentation

◆ Matrix() [1/11]

template<typename Scalar_, int Rows_, int Cols_, int Options_ = AutoAlign | ((Rows_ == 1 && Cols_ != 1) ? Eigen::RowMajor : (Cols_ == 1 && Rows_ != 1) ? Eigen::ColMajor : EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION), int MaxRows_ = Rows_, int MaxCols_ = Cols_>
Eigen::Matrix< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::Matrix ( )
inlineconstexprdefault

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)

◆ Matrix() [2/11]

template<typename Scalar_, int Rows_, int Cols_, int Options_ = AutoAlign | ((Rows_ == 1 && Cols_ != 1) ? Eigen::RowMajor : (Cols_ == 1 && Rows_ != 1) ? Eigen::ColMajor : EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION), int MaxRows_ = Rows_, int MaxCols_ = Cols_>
template<typename... ArgTypes>
Eigen::Matrix< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::Matrix ( const Scalar & a0,
const Scalar & a1,
const Scalar & a2,
const Scalar & a3,
const ArgTypes &... args )
inline

Construct a row of column vector with fixed size from an arbitrary number of coefficients.

This is only for vectors (either row-vectors or column-vectors), i.e. matrices which are known at compile-time to have either one row or one column.

This constructor is for 1D array or vectors with more than 4 coefficients.

Warning
To construct a column (resp. row) vector of fixed length, the number of values passed to this constructor must match the the fixed number of rows (resp. columns) of *this.

Example:

Matrix<int, 1, 6> a(1, 2, 3, 4, 5, 6);
Matrix<int, 3, 1> b{1, 2, 3};
cout << a << "\n\n" << b << endl;

Output:

1 2 3 4 5 6

1
2
3
See also
Matrix(const std::initializer_list<std::initializer_list<Scalar>>&)

◆ Matrix() [3/11]

template<typename Scalar_, int Rows_, int Cols_, int Options_ = AutoAlign | ((Rows_ == 1 && Cols_ != 1) ? Eigen::RowMajor : (Cols_ == 1 && Rows_ != 1) ? Eigen::ColMajor : EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION), int MaxRows_ = Rows_, int MaxCols_ = Cols_>
Eigen::Matrix< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::Matrix ( const std::initializer_list< std::initializer_list< Scalar > > & list)
inlineexplicitconstexpr

Constructs a Matrix and initializes it from the coefficients given as initializer-lists grouped by row. [c++11] .

In the general case, the constructor takes a list of rows, each row being represented as a list of coefficients:

Example:

MatrixXd m{{1, 2, 3}, {4, 5, 6}};
cout << m << endl;
Matrix< double, Dynamic, Dynamic > MatrixXd
Dynamic×Dynamic matrix of type double.
Definition Matrix.h:479

Output:

1 2 3
4 5 6

Each of the inner initializer lists must contain the exact same number of elements, otherwise an assertion is triggered.

In the case of a compile-time column vector, implicit transposition from a single row is allowed. Therefore VectorXd{{1,2,3,4,5}} is legal and the more verbose syntax RowVectorXd{{1},{2},{3},{4},{5}} can be avoided:

Example:

VectorXi v{{1, 2}};
cout << v << endl;
Matrix< int, Dynamic, 1 > VectorXi
Dynamic×1 vector of type int.
Definition Matrix.h:477

Output:

1
2

In the case of fixed-sized matrices, the initializer list sizes must exactly match the matrix sizes, and implicit transposition is allowed for compile-time vectors only.

See also
Matrix(const Scalar& a0, const Scalar& a1, const Scalar& a2, const Scalar& a3, const ArgTypes&... args)

◆ Matrix() [4/11]

template<typename Scalar_, int Rows_, int Cols_, int Options_ = AutoAlign | ((Rows_ == 1 && Cols_ != 1) ? Eigen::RowMajor : (Cols_ == 1 && Rows_ != 1) ? Eigen::ColMajor : EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION), int MaxRows_ = Rows_, int MaxCols_ = Cols_>
Eigen::Matrix< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::Matrix ( Index dim)
inlineexplicit

Constructs a vector or row-vector with given dimension. This is only for vectors (either row-vectors or column-vectors), i.e. matrices which are known at compile-time to have either one row or one column.

This is useful for dynamic-size vectors. For fixed-size vectors, it is redundant to pass these parameters, so one should use the default constructor Matrix() instead.

Warning
This constructor is disabled for fixed-size 1x1 matrices. For instance, calling Matrix<double,1,1>(1) will call the initialization constructor: Matrix(const Scalar&). For fixed-size 1x1 matrices it is therefore recommended to use the default constructor Matrix() instead, especially when using one of the non standard EIGEN_INITIALIZE_MATRICES_BY_{ZERO,NAN} macros (see Preprocessor directives).

◆ Matrix() [5/11]

template<typename Scalar_, int Rows_, int Cols_, int Options_ = AutoAlign | ((Rows_ == 1 && Cols_ != 1) ? Eigen::RowMajor : (Cols_ == 1 && Rows_ != 1) ? Eigen::ColMajor : EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION), int MaxRows_ = Rows_, int MaxCols_ = Cols_>
Eigen::Matrix< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::Matrix ( const Scalar & x)

Constructs an initialized 1x1 matrix with the given coefficient.

See also
Matrix(const Scalar&, const Scalar&, const Scalar&, const Scalar&, const ArgTypes&...)

◆ Matrix() [6/11]

template<typename Scalar_, int Rows_, int Cols_, int Options_ = AutoAlign | ((Rows_ == 1 && Cols_ != 1) ? Eigen::RowMajor : (Cols_ == 1 && Rows_ != 1) ? Eigen::ColMajor : EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION), int MaxRows_ = Rows_, int MaxCols_ = Cols_>
Eigen::Matrix< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::Matrix ( Index rows,
Index cols )

Constructs an uninitialized matrix with rows rows and cols columns.

This is useful for dynamic-size matrices. For fixed-size matrices, it is redundant to pass these parameters, so one should use the default constructor Matrix() instead.

Warning
This constructor is disabled for fixed-size 1x2 and 2x1 vectors. For instance, calling Matrix2f(2,1) will call the initialization constructor: Matrix(const Scalar& x, const Scalar& y). For fixed-size 1x2 or 2x1 vectors it is therefore recommended to use the default constructor Matrix() instead, especially when using one of the non standard EIGEN_INITIALIZE_MATRICES_BY_{ZERO,NAN} macros (see Preprocessor directives).

◆ Matrix() [7/11]

template<typename Scalar_, int Rows_, int Cols_, int Options_ = AutoAlign | ((Rows_ == 1 && Cols_ != 1) ? Eigen::RowMajor : (Cols_ == 1 && Rows_ != 1) ? Eigen::ColMajor : EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION), int MaxRows_ = Rows_, int MaxCols_ = Cols_>
Eigen::Matrix< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::Matrix ( const Scalar & x,
const Scalar & y )

Constructs an initialized 2D vector with given coefficients.

See also
Matrix(const Scalar&, const Scalar&, const Scalar&, const Scalar&, const ArgTypes&...)

◆ Matrix() [8/11]

template<typename Scalar_, int Rows_, int Cols_, int Options_ = AutoAlign | ((Rows_ == 1 && Cols_ != 1) ? Eigen::RowMajor : (Cols_ == 1 && Rows_ != 1) ? Eigen::ColMajor : EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION), int MaxRows_ = Rows_, int MaxCols_ = Cols_>
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.

See also
Matrix(const Scalar&, const Scalar&, const Scalar&, const Scalar&, const ArgTypes&...)

◆ Matrix() [9/11]

template<typename Scalar_, int Rows_, int Cols_, int Options_ = AutoAlign | ((Rows_ == 1 && Cols_ != 1) ? Eigen::RowMajor : (Cols_ == 1 && Rows_ != 1) ? Eigen::ColMajor : EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION), int MaxRows_ = Rows_, int MaxCols_ = Cols_>
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.

See also
Matrix(const Scalar&, const Scalar&, const Scalar&, const Scalar&, const ArgTypes&...)

◆ Matrix() [10/11]

template<typename Scalar_, int Rows_, int Cols_, int Options_ = AutoAlign | ((Rows_ == 1 && Cols_ != 1) ? Eigen::RowMajor : (Cols_ == 1 && Rows_ != 1) ? Eigen::ColMajor : EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION), int MaxRows_ = Rows_, int MaxCols_ = Cols_>
template<typename OtherDerived>
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>&)

◆ Matrix() [11/11]

template<typename Scalar_, int Rows_, int Cols_, int Storage_, int MaxRows_, int MaxCols_>
template<typename OtherDerived>
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.

This is defined in the Geometry module.

#include <Eigen/Geometry>

Member Function Documentation

◆ coeffRef() [1/4]

template<typename Scalar_, int Rows_, int Cols_, int Options_ = AutoAlign | ((Rows_ == 1 && Cols_ != 1) ? Eigen::RowMajor : (Cols_ == 1 && Rows_ != 1) ? Eigen::ColMajor : EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION), int MaxRows_ = Rows_, int MaxCols_ = Cols_>
Scalar & Eigen::PlainObjectBase< Matrix >::coeffRef ( Index index)
inlineconstexpr

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.

◆ coeffRef() [2/4]

template<typename Scalar_, int Rows_, int Cols_, int Options_ = AutoAlign | ((Rows_ == 1 && Cols_ != 1) ? Eigen::RowMajor : (Cols_ == 1 && Rows_ != 1) ? Eigen::ColMajor : EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION), int MaxRows_ = Rows_, int MaxCols_ = Cols_>
const Scalar & Eigen::PlainObjectBase< Matrix >::coeffRef ( Index index) const
inlineconstexpr

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

◆ coeffRef() [3/4]

template<typename Scalar_, int Rows_, int Cols_, int Options_ = AutoAlign | ((Rows_ == 1 && Cols_ != 1) ? Eigen::RowMajor : (Cols_ == 1 && Rows_ != 1) ? Eigen::ColMajor : EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION), int MaxRows_ = Rows_, int MaxCols_ = Cols_>
Scalar & Eigen::PlainObjectBase< Matrix >::coeffRef ( Index rowId,
Index colId )
inlineconstexpr

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.

◆ coeffRef() [4/4]

template<typename Scalar_, int Rows_, int Cols_, int Options_ = AutoAlign | ((Rows_ == 1 && Cols_ != 1) ? Eigen::RowMajor : (Cols_ == 1 && Rows_ != 1) ? Eigen::ColMajor : EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION), int MaxRows_ = Rows_, int MaxCols_ = Cols_>
const Scalar & Eigen::PlainObjectBase< Matrix >::coeffRef ( Index rowId,
Index colId ) const
inlineconstexpr

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

◆ operator=() [1/3]

template<typename Scalar_, int Rows_, int Cols_, int Options_ = AutoAlign | ((Rows_ == 1 && Cols_ != 1) ? Eigen::RowMajor : (Cols_ == 1 && Rows_ != 1) ? Eigen::ColMajor : EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION), int MaxRows_ = Rows_, int MaxCols_ = Cols_>
template<typename OtherDerived>
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.

◆ operator=() [2/3]

template<typename Scalar_, int Rows_, int Cols_, int Options_ = AutoAlign | ((Rows_ == 1 && Cols_ != 1) ? Eigen::RowMajor : (Cols_ == 1 && Rows_ != 1) ? Eigen::ColMajor : EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION), int MaxRows_ = Rows_, int MaxCols_ = Cols_>
Matrix & Eigen::Matrix< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::operator= ( const Matrix< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > & other)
inlineconstexpr

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=.

◆ operator=() [3/3]

template<typename Scalar_, int Rows_, int Cols_, int Options_ = AutoAlign | ((Rows_ == 1 && Cols_ != 1) ? Eigen::RowMajor : (Cols_ == 1 && Rows_ != 1) ? Eigen::ColMajor : EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION), int MaxRows_ = Rows_, int MaxCols_ = Cols_>
template<typename OtherDerived>
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.

This is defined in the Geometry module.

#include <Eigen/Geometry>

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