Eigen  3.4.90 (git rev 5a9f66fb35d03a4da9ef8976e67a61b30aa16dcf)
 
Loading...
Searching...
No Matches
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.

Template Parameters
Scalar_the 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 DiagonalBase, class DiagonalWrapper
+ Inheritance diagram for Eigen::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.
 
 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 (DiagonalVectorType &&diag)
 Constructs a DiagonalMatrix from an r-value diagonal vector type.
 
 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)
 
- Public Member Functions inherited from Eigen::DiagonalBase< DiagonalMatrix< Scalar_, SizeAtCompileTime, MaxSizeAtCompileTime > >
Scalar coeff (Index row, Index col) const
 
EIGEN_CONSTEXPR Index cols () const
 
DiagonalMatrix< Scalar_, SizeAtCompileTime, MaxSizeAtCompileTime > & derived ()
 
const DiagonalMatrix< Scalar_, SizeAtCompileTime, MaxSizeAtCompileTime > & derived () const
 
DiagonalVectorType & diagonal ()
 
const DiagonalVectorType & diagonal () const
 
const DiagonalInverseReturnType inverse () const
 
const DiagonalProductReturnType< OtherDerived > operator* (const DiagonalBase< OtherDerived > &other) const
 
const Product< DiagonalMatrix< Scalar_, SizeAtCompileTime, MaxSizeAtCompileTime >, MatrixDerived, LazyProduct > operator* (const MatrixBase< MatrixDerived > &matrix) const
 
const DiagonalScaleReturnType operator* (const Scalar &scalar) const
 
const DiagonalSumReturnType< OtherDerived > operator+ (const DiagonalBase< OtherDerived > &other) const
 
const DiagonalDifferenceReturnType< OtherDerived > operator- (const DiagonalBase< OtherDerived > &other) const
 
EIGEN_CONSTEXPR Index rows () const
 
DenseMatrixType toDenseMatrix () const
 
- Public Member Functions inherited from Eigen::EigenBase< DiagonalMatrix< Scalar_, SizeAtCompileTime, MaxSizeAtCompileTime > >
EIGEN_CONSTEXPR Index cols () const EIGEN_NOEXCEPT
 
DiagonalMatrix< Scalar_, SizeAtCompileTime, MaxSizeAtCompileTime > & derived ()
 
const DiagonalMatrix< Scalar_, SizeAtCompileTime, MaxSizeAtCompileTime > & derived () const
 
EIGEN_CONSTEXPR Index rows () const EIGEN_NOEXCEPT
 
EIGEN_CONSTEXPR Index size () const EIGEN_NOEXCEPT
 

Static Public Member Functions

static const InitializeReturnType Identity ()
 
static const InitializeReturnType Identity (Index size)
 
static const InitializeReturnType Zero ()
 
static const InitializeReturnType Zero (Index size)
 

Additional Inherited Members

- Public Types inherited from Eigen::EigenBase< DiagonalMatrix< Scalar_, SizeAtCompileTime, MaxSizeAtCompileTime > >
typedef Eigen::Index Index
 The interface type of indices.
 

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.

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().

◆ Identity() [1/2]

template<typename Scalar_ , int SizeAtCompileTime, int MaxSizeAtCompileTime>
static const InitializeReturnType Eigen::DiagonalMatrix< Scalar_, SizeAtCompileTime, MaxSizeAtCompileTime >::Identity ( )
inlinestatic

Initializes a identity matrix of size SizeAtCompileTime

◆ Identity() [2/2]

template<typename Scalar_ , int SizeAtCompileTime, int MaxSizeAtCompileTime>
static const InitializeReturnType Eigen::DiagonalMatrix< Scalar_, SizeAtCompileTime, MaxSizeAtCompileTime >::Identity ( Index size)
inlinestatic

Initializes a identity matrix of size dim

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

◆ Zero() [1/2]

template<typename Scalar_ , int SizeAtCompileTime, int MaxSizeAtCompileTime>
static const InitializeReturnType Eigen::DiagonalMatrix< Scalar_, SizeAtCompileTime, MaxSizeAtCompileTime >::Zero ( )
inlinestatic

Initializes a diagonal matrix of size SizeAtCompileTime with coefficients set to zero

◆ Zero() [2/2]

template<typename Scalar_ , int SizeAtCompileTime, int MaxSizeAtCompileTime>
static const InitializeReturnType Eigen::DiagonalMatrix< Scalar_, SizeAtCompileTime, MaxSizeAtCompileTime >::Zero ( Index size)
inlinestatic

Initializes a diagonal matrix of size dim with coefficients set to zero


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