Eigen  5.0.1
 
Loading...
Searching...
No Matches
Eigen::DiagonalMatrix< Scalar_, SizeAtCompileTime, MaxSizeAtCompileTime > Class Template Reference

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

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

constexpr DiagonalVectorType & diagonal ()
 
constexpr const DiagonalVectorType & diagonal () const
 
constexpr DiagonalMatrix ()
 
template<typename OtherDerived>
constexpr DiagonalMatrix (const DiagonalBase< OtherDerived > &other)
 
template<typename OtherDerived>
constexpr DiagonalMatrix (const MatrixBase< OtherDerived > &other)
 
template<typename... ArgTypes>
constexpr 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.
 
constexpr DiagonalMatrix (const Scalar &x, const Scalar &y)
 
constexpr 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.
 
constexpr DiagonalMatrix (DiagonalMatrix &&)=default
 
constexpr DiagonalMatrix (DiagonalVectorType &&diag)
 Constructs a DiagonalMatrix from an r-value diagonal vector type.
 
constexpr DiagonalMatrix (Index dim)
 
template<typename OtherDerived>
DiagonalMatrix & operator= (const DiagonalBase< OtherDerived > &other)
 
constexpr DiagonalMatrix & operator= (DiagonalMatrix &&other) noexcept(DiagonalVectorType::MaxSizeAtCompileTime==Dynamic &&std::is_nothrow_move_assignable< DiagonalVectorType >::value)
 
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 > >
const AdjointReturnType adjoint () const
 
Scalar coeff (Index row, Index col) const
 
constexpr Index cols () const
 
const ConjugateReturnType conjugate () 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
 
constexpr Index rows () const
 
DenseMatrixType toDenseMatrix () const
 
const TransposeReturnType transpose () const
 
- Public Member Functions inherited from Eigen::EigenBase< DiagonalMatrix< Scalar_, SizeAtCompileTime, MaxSizeAtCompileTime > >
constexpr Index cols () const noexcept
 
constexpr DiagonalMatrix< Scalar_, SizeAtCompileTime, MaxSizeAtCompileTime > & derived ()
 
constexpr const DiagonalMatrix< Scalar_, SizeAtCompileTime, MaxSizeAtCompileTime > & derived () const
 
constexpr Index rows () const noexcept
 
constexpr Index size () const noexcept
 

Static Public Member Functions

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

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ DiagonalMatrix() [1/8]

template<typename Scalar_, int SizeAtCompileTime, int MaxSizeAtCompileTime>
Eigen::DiagonalMatrix< Scalar_, SizeAtCompileTime, MaxSizeAtCompileTime >::DiagonalMatrix ( )
inlineconstexpr

Default constructor without initialization

◆ DiagonalMatrix() [2/8]

template<typename Scalar_, int SizeAtCompileTime, int MaxSizeAtCompileTime>
Eigen::DiagonalMatrix< Scalar_, SizeAtCompileTime, MaxSizeAtCompileTime >::DiagonalMatrix ( Index dim)
inlineexplicitconstexpr

Constructs a diagonal matrix with given dimension

◆ DiagonalMatrix() [3/8]

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

2D constructor.

◆ DiagonalMatrix() [4/8]

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

3D constructor.

◆ DiagonalMatrix() [5/8]

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 )
inlineconstexpr

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/8]

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

Copy constructor.

◆ DiagonalMatrix() [7/8]

template<typename Scalar_, int SizeAtCompileTime, int MaxSizeAtCompileTime>
Eigen::DiagonalMatrix< Scalar_, SizeAtCompileTime, MaxSizeAtCompileTime >::DiagonalMatrix ( DiagonalMatrix< Scalar_, SizeAtCompileTime, MaxSizeAtCompileTime > && )
constexprdefault

Move constructor. Moves the stored diagonal vector.

◆ DiagonalMatrix() [8/8]

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

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

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 an 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 an identity matrix of size dim

◆ operator=() [1/2]

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

Copy operator.

◆ operator=() [2/2]

template<typename Scalar_, int SizeAtCompileTime, int MaxSizeAtCompileTime>
DiagonalMatrix & Eigen::DiagonalMatrix< Scalar_, SizeAtCompileTime, MaxSizeAtCompileTime >::operator= ( DiagonalMatrix< Scalar_, SizeAtCompileTime, MaxSizeAtCompileTime > && other)
inlineconstexprnoexcept

Move assignment operator. Transfers dynamic storage and copies inline storage.

◆ 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 ZeroInitializeReturnType 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 ZeroInitializeReturnType 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: