Please, help us to better know about our user community by answering the following short survey: https://forms.gle/wpyrxWi18ox9Z5ae9
Eigen  3.4.99 (git rev 10c77b0ff44d0b9cb0b252cfa0ccaaa39d3c5da4)
Eigen::DiagonalMatrix< _Scalar, SizeAtCompileTime, MaxSizeAtCompileTime > Class Template Reference

Detailed Description

template<typename _Scalar, int SizeAtCompileTime, int MaxSizeAtCompileTime>
class Eigen::DiagonalMatrix< _Scalar, SizeAtCompileTime, MaxSizeAtCompileTime >

Represents a diagonal matrix with its storage.

Parameters
_Scalarthe type of coefficients
SizeAtCompileTimethe dimension of the matrix, or Dynamic
MaxSizeAtCompileTimethe dimension of the matrix, or Dynamic. This parameter is optional and defaults to SizeAtCompileTime. Most of the time, you do not need to specify it.
See also
class DiagonalWrapper

Inherits DiagonalBase< DiagonalMatrix< _Scalar, SizeAtCompileTime, MaxSizeAtCompileTime > >.

Public Member Functions

DiagonalVectorType & diagonal ()
 
const DiagonalVectorType & diagonal () const
 
 DiagonalMatrix ()
 
template<typename OtherDerived >
 DiagonalMatrix (const DiagonalBase< OtherDerived > &other)
 
template<typename OtherDerived >
 DiagonalMatrix (const MatrixBase< OtherDerived > &other)
 
template<typename... ArgTypes>
 DiagonalMatrix (const Scalar &a0, const Scalar &a1, const Scalar &a2, const ArgTypes &... args)
 Construct a diagonal matrix with fixed size from an arbitrary number of coefficients. [c++11] More...
 
 DiagonalMatrix (const Scalar &x, const Scalar &y)
 
 DiagonalMatrix (const Scalar &x, const Scalar &y, const Scalar &z)
 
 DiagonalMatrix (const std::initializer_list< std::initializer_list< Scalar >> &list)
 Constructs a DiagonalMatrix and initializes it by elements given by an initializer list of initializer lists [c++11]
 
 DiagonalMatrix (Index dim)
 
template<typename OtherDerived >
DiagonalMatrixoperator= (const DiagonalBase< OtherDerived > &other)
 
void resize (Index size)
 
void setIdentity ()
 
void setIdentity (Index size)
 
void setZero ()
 
void setZero (Index size)
 

Constructor & Destructor Documentation

◆ DiagonalMatrix() [1/7]

template<typename _Scalar , int SizeAtCompileTime, int MaxSizeAtCompileTime>
Eigen::DiagonalMatrix< _Scalar, SizeAtCompileTime, MaxSizeAtCompileTime >::DiagonalMatrix ( )
inline

Default constructor without initialization

◆ DiagonalMatrix() [2/7]

template<typename _Scalar , int SizeAtCompileTime, int MaxSizeAtCompileTime>
Eigen::DiagonalMatrix< _Scalar, SizeAtCompileTime, MaxSizeAtCompileTime >::DiagonalMatrix ( Index  dim)
inlineexplicit

Constructs a diagonal matrix with given dimension

◆ DiagonalMatrix() [3/7]

template<typename _Scalar , int SizeAtCompileTime, int MaxSizeAtCompileTime>
Eigen::DiagonalMatrix< _Scalar, SizeAtCompileTime, MaxSizeAtCompileTime >::DiagonalMatrix ( const Scalar &  x,
const Scalar &  y 
)
inline

2D constructor.

◆ DiagonalMatrix() [4/7]

template<typename _Scalar , int SizeAtCompileTime, int MaxSizeAtCompileTime>
Eigen::DiagonalMatrix< _Scalar, SizeAtCompileTime, MaxSizeAtCompileTime >::DiagonalMatrix ( const Scalar &  x,
const Scalar &  y,
const Scalar &  z 
)
inline

3D constructor.

◆ DiagonalMatrix() [5/7]

template<typename _Scalar , int SizeAtCompileTime, int MaxSizeAtCompileTime>
template<typename... ArgTypes>
Eigen::DiagonalMatrix< _Scalar, SizeAtCompileTime, MaxSizeAtCompileTime >::DiagonalMatrix ( const Scalar &  a0,
const Scalar &  a1,
const Scalar &  a2,
const ArgTypes &...  args 
)
inline

Construct a diagonal matrix with fixed size from an arbitrary number of coefficients. [c++11]

There exists C++98 anologue constructors for fixed-size diagonal matrices having 2 or 3 coefficients.

Warning
To construct a diagonal matrix of fixed size, the number of values passed to this constructor must match the fixed dimension of *this.
See also
DiagonalMatrix(const Scalar&, const Scalar&)
DiagonalMatrix(const Scalar&, const Scalar&, const Scalar&)

◆ DiagonalMatrix() [6/7]

template<typename _Scalar , int SizeAtCompileTime, int MaxSizeAtCompileTime>
template<typename OtherDerived >
Eigen::DiagonalMatrix< _Scalar, SizeAtCompileTime, MaxSizeAtCompileTime >::DiagonalMatrix ( const DiagonalBase< OtherDerived > &  other)
inline

Copy constructor.

◆ DiagonalMatrix() [7/7]

template<typename _Scalar , int SizeAtCompileTime, int MaxSizeAtCompileTime>
template<typename OtherDerived >
Eigen::DiagonalMatrix< _Scalar, SizeAtCompileTime, MaxSizeAtCompileTime >::DiagonalMatrix ( const MatrixBase< OtherDerived > &  other)
inlineexplicit

generic constructor from expression of the diagonal coefficients

Member Function Documentation

◆ diagonal() [1/2]

template<typename _Scalar , int SizeAtCompileTime, int MaxSizeAtCompileTime>
DiagonalVectorType& Eigen::DiagonalMatrix< _Scalar, SizeAtCompileTime, MaxSizeAtCompileTime >::diagonal ( )
inline
Returns
a reference to the stored vector of diagonal coefficients.

◆ diagonal() [2/2]

template<typename _Scalar , int SizeAtCompileTime, int MaxSizeAtCompileTime>
const DiagonalVectorType& Eigen::DiagonalMatrix< _Scalar, SizeAtCompileTime, MaxSizeAtCompileTime >::diagonal ( ) const
inline

const version of diagonal().

◆ operator=()

template<typename _Scalar , int SizeAtCompileTime, int MaxSizeAtCompileTime>
template<typename OtherDerived >
DiagonalMatrix& Eigen::DiagonalMatrix< _Scalar, SizeAtCompileTime, MaxSizeAtCompileTime >::operator= ( const DiagonalBase< OtherDerived > &  other)
inline

Copy operator.

◆ resize()

template<typename _Scalar , int SizeAtCompileTime, int MaxSizeAtCompileTime>
void Eigen::DiagonalMatrix< _Scalar, SizeAtCompileTime, MaxSizeAtCompileTime >::resize ( Index  size)
inline

Resizes to given size.

◆ setIdentity() [1/2]

template<typename _Scalar , int SizeAtCompileTime, int MaxSizeAtCompileTime>
void Eigen::DiagonalMatrix< _Scalar, SizeAtCompileTime, MaxSizeAtCompileTime >::setIdentity ( )
inline

Sets this matrix to be the identity matrix of the current size.

◆ setIdentity() [2/2]

template<typename _Scalar , int SizeAtCompileTime, int MaxSizeAtCompileTime>
void Eigen::DiagonalMatrix< _Scalar, SizeAtCompileTime, MaxSizeAtCompileTime >::setIdentity ( Index  size)
inline

Sets this matrix to be the identity matrix of the given size.

◆ setZero() [1/2]

template<typename _Scalar , int SizeAtCompileTime, int MaxSizeAtCompileTime>
void Eigen::DiagonalMatrix< _Scalar, SizeAtCompileTime, MaxSizeAtCompileTime >::setZero ( )
inline

Sets all coefficients to zero.

◆ setZero() [2/2]

template<typename _Scalar , int SizeAtCompileTime, int MaxSizeAtCompileTime>
void Eigen::DiagonalMatrix< _Scalar, SizeAtCompileTime, MaxSizeAtCompileTime >::setZero ( Index  size)
inline

Resizes and sets all coefficients to zero.


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