yat  0.18pre
Public Member Functions | Related Functions | List of all members
theplu::yat::utility::DiagonalMatrix Class Reference

Diagonal Matrix. More...

#include <yat/utility/DiagonalMatrix.h>

Public Member Functions

 DiagonalMatrix (void)
 Default constructor.
 
 DiagonalMatrix (size_t row, size_t column, double x=0.0)
 
 DiagonalMatrix (const VectorBase &diagonal)
 
 DiagonalMatrix (const Matrix &m)
 
size_t rows (void) const
 
size_t columns (void) const
 
const double operator() (size_t row, size_t col) const
 
double & operator() (size_t i)
 

Related Functions

(Note that these are not member functions.)

DiagonalMatrix operator* (const DiagonalMatrix &lhs, const DiagonalMatrix &rhs)
 
template<class T >
expression::DiagonalMatrixMatrix< T > operator* (const DiagonalMatrix &lhs, const BasicMatrix< T > &rhs)
 matrix matrix multiplication More...
 
template<class T >
expression::MatrixDiagonalMatrix< T > operator* (const BasicMatrix< T > &lhs, const DiagonalMatrix &rhs)
 matrix matrix multiplication More...
 
DiagonalMatrix operator+ (const DiagonalMatrix &lhs, const DiagonalMatrix &rhs)
 matrix matrix addition More...
 
template<class T >
expression::DiagonalMatrix< DiagonalMatrix, BasicMatrix< T >, expression::Plusoperator+ (const DiagonalMatrix &lhs, const BasicMatrix< T > &rhs)
 matrix matrix addition More...
 
template<class T >
expression::DiagonalMatrix< BasicMatrix< T >, DiagonalMatrix, expression::Plusoperator+ (const BasicMatrix< T > &lhs, const DiagonalMatrix &rhs)
 matrix matrix addition More...
 
DiagonalMatrix operator- (const DiagonalMatrix &lhs, const DiagonalMatrix &rhs)
 matrix matrix subtraction More...
 
template<class T >
expression::DiagonalMatrix< DiagonalMatrix, BasicMatrix< T >, expression::Minusoperator- (const DiagonalMatrix &lhs, const BasicMatrix< T > &rhs)
 matrix matrix subtraction More...
 
template<class T >
expression::DiagonalMatrix< BasicMatrix< T >, DiagonalMatrix, expression::Minusoperator- (const BasicMatrix< T > &lhs, const DiagonalMatrix &rhs)
 matrix matrix subtraction More...
 
template<class T >
expression::DiagonalMatrixVector< T > operator* (const DiagonalMatrix &lhs, const BasicVector< T > &rhs)
 matrix vector multiplication More...
 
template<class T >
expression::DiagonalMatrixVector< T > operator* (const BasicVector< T > &lhs, const DiagonalMatrix &rhs)
 vector matrix multiplication More...
 

Detailed Description

Diagonal Matrix.

All off-diagonal elements are zero by definition, which can be used to speed up some calculation.

Since
New in yat 0.15

Constructor & Destructor Documentation

theplu::yat::utility::DiagonalMatrix::DiagonalMatrix ( size_t  row,
size_t  column,
double  x = 0.0 
)

Construct a row x column Matrix with all elements set to x

theplu::yat::utility::DiagonalMatrix::DiagonalMatrix ( const VectorBase diagonal)
explicit

Construct a square matrix in which diagonal is set to diagonal

theplu::yat::utility::DiagonalMatrix::DiagonalMatrix ( const Matrix m)
explicit

Construct a diagonal matrix from m. All non-diagonal elements are set to zero.

Member Function Documentation

size_t theplu::yat::utility::DiagonalMatrix::columns ( void  ) const
Returns
number of columns
const double theplu::yat::utility::DiagonalMatrix::operator() ( size_t  row,
size_t  col 
) const

access element at row row and column column

double& theplu::yat::utility::DiagonalMatrix::operator() ( size_t  i)

access element at row i and column i

Elements outside diagnonal are only accessible as const

size_t theplu::yat::utility::DiagonalMatrix::rows ( void  ) const
Returns
number of rows

Friends And Related Function Documentation

DiagonalMatrix operator* ( const DiagonalMatrix lhs,
const DiagonalMatrix rhs 
)
related

Multiplication of two diagonal matrices

Diagonal elements are calculated as lhs(i,i) * rhs(i,i)

Since
new in yat 0.15
template<class T >
expression::DiagonalMatrixMatrix< T > operator* ( const DiagonalMatrix lhs,
const BasicMatrix< T > &  rhs 
)
related

matrix matrix multiplication

Since
new in yat 0.15
template<class T >
expression::MatrixDiagonalMatrix< T > operator* ( const BasicMatrix< T > &  lhs,
const DiagonalMatrix rhs 
)
related

matrix matrix multiplication

Since
new in yat 0.15
template<class T >
expression::DiagonalMatrixVector< T > operator* ( const DiagonalMatrix lhs,
const BasicVector< T > &  rhs 
)
related

matrix vector multiplication

Since
new in yat 0.15
template<class T >
expression::DiagonalMatrixVector< T > operator* ( const BasicVector< T > &  lhs,
const DiagonalMatrix rhs 
)
related

vector matrix multiplication

Since
new in yat 0.15
DiagonalMatrix operator+ ( const DiagonalMatrix lhs,
const DiagonalMatrix rhs 
)
related

matrix matrix addition

Since
new in yat 0.15
template<class T >
expression::DiagonalMatrix< DiagonalMatrix, BasicMatrix< T >, expression::Plus > operator+ ( const DiagonalMatrix lhs,
const BasicMatrix< T > &  rhs 
)
related

matrix matrix addition

Since
new in yat 0.15
template<class T >
expression::DiagonalMatrix< BasicMatrix< T >, DiagonalMatrix, expression::Plus > operator+ ( const BasicMatrix< T > &  lhs,
const DiagonalMatrix rhs 
)
related

matrix matrix addition

Since
new in yat 0.15
DiagonalMatrix operator- ( const DiagonalMatrix lhs,
const DiagonalMatrix rhs 
)
related

matrix matrix subtraction

Since
new in yat 0.15
template<class T >
expression::DiagonalMatrix< DiagonalMatrix, BasicMatrix< T >, expression::Minus > operator- ( const DiagonalMatrix lhs,
const BasicMatrix< T > &  rhs 
)
related

matrix matrix subtraction

Since
new in yat 0.15
template<class T >
expression::DiagonalMatrix< BasicMatrix< T >, DiagonalMatrix, expression::Minus > operator- ( const BasicMatrix< T > &  lhs,
const DiagonalMatrix rhs 
)
related

matrix matrix subtraction

Since
new in yat 0.15

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

Generated on Sun Sep 27 2020 02:26:14 for yat by  doxygen 1.8.11