fmatvec  0.0.0
Fast Matrix/Vector Library
Public Types | Public Member Functions | Static Public Attributes | List of all members
fmatvec::Matrix< Symmetric, Var, Var, AT > Class Template Reference

This is a matrix class for symmetric matrices. More...

#include <var_symmetric_matrix.h>

Public Types

typedef AT value_type
 
typedef Symmetric shape_type
 

Public Member Functions

 Matrix ()
 Standard constructor. More...
 
 Matrix (int m, Noinit)
 
 Matrix (int m, Init ini=INIT, const AT &a=AT())
 
 Matrix (int m, Eye ini, const AT &a=1)
 
 Matrix (int m, int n, Noinit)
 
 Matrix (int m, int n, Init ini=INIT, const AT &a=AT())
 
 Matrix (int m, int n, Eye ini, const AT &a=1)
 
 Matrix (Matrix< Symmetric, Var, Var, AT > &&src)
 
Matrix< Symmetric, Var, Var, AT > & operator= (Matrix< Symmetric, Var, Var, AT > &&src)
 
 Matrix (const Matrix< Symmetric, Var, Var, AT > &A)
 Copy Constructor. More...
 
template<class Row >
 Matrix (const Matrix< Symmetric, Row, Row, AT > &A)
 Copy Constructor. More...
 
template<class Type , class Row , class Col >
 Matrix (const Matrix< Type, Row, Col, AT > &A)
 Copy Constructor. More...
 
 ~Matrix ()
 Destructor.
 
Matrix< Symmetric, Var, Var, AT > & resize (int m, Noinit)
 
Matrix< Symmetric, Var, Var, AT > & resize (int m, Init ini=INIT, const AT &a=AT())
 
Matrix< Symmetric, Var, Var, AT > & resize (int m, Eye ini, const AT &a=1)
 
Matrix< Symmetric, Var, Var, AT > & operator= (const Matrix< Symmetric, Var, Var, AT > &A)
 Assignment operator. More...
 
template<class Type , class Row , class Col >
Matrix< Symmetric, Var, Var, AT > & operator= (const Matrix< Type, Row, Col, AT > &A)
 Assignment operator. More...
 
template<class Type , class Row , class Col >
Matrix< Symmetric, Var, Var, AT > & operator<<= (const Matrix< Type, Row, Col, AT > &A)
 Matrix assignment. More...
 
template<class Type , class Row , class Col >
Matrix< Symmetric, Var, Var, AT > & operator<<= (Matrix< Type, Row, Col, AT > &&src)
 
void resize (int n, int m)
 
AT & operator() (int i, int j)
 Element operator. More...
 
const AT & operator() (int i, int j) const
 Element operator. More...
 
AT & ei (int i, int j)
 
const AT & ei (int i, int j) const
 
AT & ej (int i, int j)
 
const AT & ej (int i, int j) const
 
AT & e (int i, int j)
 
const AT & e (int i, int j) const
 
AT * operator() ()
 Pointer operator. More...
 
const AT * operator() () const
 Pointer operator. More...
 
constexpr int size () const
 Size. More...
 
constexpr int rows () const
 Number of rows. More...
 
constexpr int cols () const
 Number of columns. More...
 
int ldim () const
 Leading dimension. More...
 
const CBLAS_ORDER blasOrder () const
 Storage convention. More...
 
const CBLAS_UPLO blasUplo () const
 Symmetry convention. More...
 
Matrix< Symmetric, Var, Var, AT > & init (const AT &val=AT())
 Initialization. More...
 
Matrix< Symmetric, Var, Var, AT > & init (Init, const AT &a=AT())
 
Matrix< Symmetric, Var, Var, AT > & init (Eye eye, const AT &val=1)
 
Matrix< Symmetric, Var, Var, AT > & init (Noinit, const AT &a=AT())
 
 operator std::vector< std::vector< AT >> () const
 Cast to std::vector<std::vector<AT>>. More...
 
int countElements () const
 

Static Public Attributes

static constexpr bool isVector {false}
 

Detailed Description

template<class AT>
class fmatvec::Matrix< Symmetric, Var, Var, AT >

This is a matrix class for symmetric matrices.

Template class Matrix of shape type SymmetricVar. The template parameter AT defines the atomic type of the matrix. Valid types are int, float, double, complex<float> and complex<double>

Constructor & Destructor Documentation

◆ Matrix() [1/4]

template<class AT >
fmatvec::Matrix< Symmetric, Var, Var, AT >::Matrix ( )
inlineexplicit

Standard constructor.

Constructs a matrix with no size.

◆ Matrix() [2/4]

template<class AT >
fmatvec::Matrix< Symmetric, Var, Var, AT >::Matrix ( const Matrix< Symmetric, Var, Var, AT > &  A)
inline

Copy Constructor.

Constructs a copy of the matrix A.

Parameters
AThe matrix that will be copied.

◆ Matrix() [3/4]

template<class AT >
template<class Row >
fmatvec::Matrix< Symmetric, Var, Var, AT >::Matrix ( const Matrix< Symmetric, Row, Row, AT > &  A)
inline

Copy Constructor.

Constructs a copy of the matrix A.

Parameters
AThe matrix that will be copied.

◆ Matrix() [4/4]

template<class AT >
template<class Type , class Row , class Col >
fmatvec::Matrix< Symmetric, Var, Var, AT >::Matrix ( const Matrix< Type, Row, Col, AT > &  A)
inlineexplicit

Copy Constructor.

Constructs a copy of the matrix A.

Parameters
AThe matrix that will be copied.

Member Function Documentation

◆ blasOrder()

template<class AT >
const CBLAS_ORDER fmatvec::Matrix< Symmetric, Var, Var, AT >::blasOrder ( ) const
inline

Storage convention.

Returns the blas-conform storage convention. The elements are stored in columnmajor form, i.e. the elements are stored columnwise.

Returns
CblasRowMajor.

◆ blasUplo()

template<class AT >
const CBLAS_UPLO fmatvec::Matrix< Symmetric, Var, Var, AT >::blasUplo ( ) const
inline

Symmetry convention.

Returns the blas-conform symmetry convention. The elements are stored in the lower triangular part of the array,

Returns
CblasLower.

◆ cols()

template<class AT >
constexpr int fmatvec::Matrix< Symmetric, Var, Var, AT >::cols ( ) const
inline

Number of columns.

Returns
The number of columns of the matrix

◆ init()

template<class AT >
Matrix< Symmetric, Var, Var, AT > & fmatvec::Matrix< Symmetric, Var, Var, AT >::init ( const AT &  val = AT())
inline

Initialization.

Initializes all elements of the calling matrix with the value given by a.

Parameters
aValue all elements will be initialized with.
Returns
A reference to the calling matrix.

◆ ldim()

template<class AT >
int fmatvec::Matrix< Symmetric, Var, Var, AT >::ldim ( ) const
inline

Leading dimension.

Returns
The leading dimension of the matrix

◆ operator std::vector< std::vector< AT >>()

template<class AT >
fmatvec::Matrix< Symmetric, Var, Var, AT >::operator std::vector< std::vector< AT >> ( ) const
inlineexplicit

Cast to std::vector<std::vector<AT>>.

Returns
The std::vector<std::vector<AT>> representation of the matrix

◆ operator()() [1/4]

template<class AT >
AT& fmatvec::Matrix< Symmetric, Var, Var, AT >::operator() ( int  i,
int  j 
)
inline

Element operator.

Returns a reference to the element in the i-th row and the j-th column.

Parameters
iThe i-th row of the matrix
jThe j-th column of the matrix
Returns
A reference to the element A(i,j).
Remarks
The bounds are checked in debug mode.
See also
operator()(int,int) const

◆ operator()() [2/4]

template<class AT >
const AT& fmatvec::Matrix< Symmetric, Var, Var, AT >::operator() ( int  i,
int  j 
) const
inline

Element operator.

See operator()(int,int)

◆ operator()() [3/4]

template<class AT >
AT* fmatvec::Matrix< Symmetric, Var, Var, AT >::operator() ( )
inline

Pointer operator.

Returns the pointer to the first element.

Returns
The pointer to the first element.

◆ operator()() [4/4]

template<class AT >
const AT* fmatvec::Matrix< Symmetric, Var, Var, AT >::operator() ( ) const
inline

Pointer operator.

See operator()()

◆ operator<<=()

template<class AT >
template<class Type , class Row , class Col >
Matrix<Symmetric,Var,Var,AT>& fmatvec::Matrix< Symmetric, Var, Var, AT >::operator<<= ( const Matrix< Type, Row, Col, AT > &  A)
inline

Matrix assignment.

Copies the matrix given by A.

Parameters
AThe matrix to be copied.
Returns
A reference to the calling matrix.

◆ operator=() [1/2]

template<class AT >
Matrix<Symmetric,Var,Var,AT>& fmatvec::Matrix< Symmetric, Var, Var, AT >::operator= ( const Matrix< Symmetric, Var, Var, AT > &  A)
inline

Assignment operator.

Copies the symmetric matrix given by A.

Parameters
AThe matrix to be assigned.
Returns
A reference to the calling matrix.

◆ operator=() [2/2]

template<class AT >
template<class Type , class Row , class Col >
Matrix<Symmetric,Var,Var,AT>& fmatvec::Matrix< Symmetric, Var, Var, AT >::operator= ( const Matrix< Type, Row, Col, AT > &  A)
inline

Assignment operator.

Copies the symmetric matrix given by A.

Parameters
AThe matrix to be assigned.
Returns
A reference to the calling matrix.

◆ resize()

template<class AT >
void fmatvec::Matrix< Symmetric, Var, Var, AT >::resize ( int  n,
int  m 
)
inline

Resize a var symmetric matrix. Throw if the dimension does not match or resize to this dimension

◆ rows()

template<class AT >
constexpr int fmatvec::Matrix< Symmetric, Var, Var, AT >::rows ( ) const
inline

Number of rows.

Returns
The number of rows of the matrix

◆ size()

template<class AT >
constexpr int fmatvec::Matrix< Symmetric, Var, Var, AT >::size ( ) const
inline

Size.

Returns
The number of rows and columns of the matrix

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