fmatvec  0.0.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends Pages
fmatvec::Matrix< Symmetric, Fixed< M >, Fixed< M >, AT > Class Template Reference

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

#include <fixed_symmetric_matrix.h>

Public Types

using value_type = AT
 
using shape_type = Symmetric
 

Public Member Functions

 Matrix (Noinit ini)
 
 Matrix (Init ini=INIT, const AT &a=AT())
 
 Matrix (Eye ini, const AT &a=1)
 
 Matrix (int m, int n, Noinit ini)
 
 Matrix (int m, int n, Init ini, const AT &a=AT())
 
 Matrix (int m, int n, Eye ini, const AT &a=1)
 
 Matrix (const Matrix< Symmetric, Fixed< M >, Fixed< M >, AT > &A)=default
 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< Symmetric, Fixed< M >
, Fixed< M >, AT > & 
operator= (const Matrix< Symmetric, Fixed< M >, Fixed< M >, AT > &A)=default
 Assignment operator. More...
 
template<class Type , class Row , class Col >
Matrix< Symmetric, Fixed< M >
, Fixed< M >, AT > & 
operator= (const Matrix< Type, Row, Col, AT > &A)
 Assignment operator. More...
 
template<class Type , class Row , class Col >
Matrix< Symmetric, Fixed< M >
, Fixed< M >, AT > & 
operator<<= (const Matrix< Type, Row, Col, AT > &A)
 Matrix assignment. More...
 
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, Fixed< M >
, Fixed< M >, AT > & 
init (const AT &val=AT())
 Initialization. More...
 
Matrix< Symmetric, Fixed< M >
, Fixed< M >, AT > & 
init (Init, const AT &a=AT())
 
Matrix< Symmetric, Fixed< M >
, Fixed< M >, AT > & 
init (Eye, const AT &val=1)
 
Matrix< Symmetric, Fixed< M >
, Fixed< M >, AT > & 
init (Noinit, const AT &a=AT())
 
 operator std::vector< std::vector< AT >> () const
 Cast to std::vector<std::vector<AT>>. More...
 
 Matrix (const std::vector< std::vector< AT >> &m)
 std::vector<std::vector<AT>> Constructor. Constructs and initializes a matrix with a std::vector<std::vector<AT>> object. An FMATVEC_ASSERT checks for constant length of each row. More...
 

Static Public Attributes

static constexpr bool isVector {false}
 

Detailed Description

template<int M, class AT>
class fmatvec::Matrix< Symmetric, Fixed< M >, Fixed< M >, AT >

This is a matrix class for symmetric matrices.

Template class Matrix of shape type SymmetricFixed. 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

template<int M, class AT >
fmatvec::Matrix< Symmetric, Fixed< M >, Fixed< M >, AT >::Matrix ( const Matrix< Symmetric, Fixed< M >, Fixed< M >, AT > &  A)
default

Copy Constructor.

Constructs a copy of the matrix A.

Parameters
AThe matrix that will be copied.
template<int M, class AT >
template<class Row >
fmatvec::Matrix< Symmetric, Fixed< M >, Fixed< M >, 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.
template<int M, class AT >
template<class Type , class Row , class Col >
fmatvec::Matrix< Symmetric, Fixed< M >, Fixed< M >, 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.
template<int M, class AT >
fmatvec::Matrix< Symmetric, Fixed< M >, Fixed< M >, AT >::Matrix ( const std::vector< std::vector< AT >> &  m)
inlineexplicit

std::vector<std::vector<AT>> Constructor. Constructs and initializes a matrix with a std::vector<std::vector<AT>> object. An FMATVEC_ASSERT checks for constant length of each row.

Parameters
mThe std::vector<std::vector<AT>> the matrix will be initialized with.

Member Function Documentation

template<int M, class AT >
const CBLAS_ORDER fmatvec::Matrix< Symmetric, Fixed< M >, Fixed< M >, 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.
template<int M, class AT >
const CBLAS_UPLO fmatvec::Matrix< Symmetric, Fixed< M >, Fixed< M >, 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.
template<int M, class AT >
constexpr int fmatvec::Matrix< Symmetric, Fixed< M >, Fixed< M >, AT >::cols ( ) const
inline

Number of columns.

Returns
The number of columns of the matrix
template<int M, class AT >
Matrix< Symmetric, Fixed< M >, Fixed< M >, AT > & fmatvec::Matrix< Symmetric, Fixed< M >, Fixed< M >, 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.
template<int M, class AT >
int fmatvec::Matrix< Symmetric, Fixed< M >, Fixed< M >, AT >::ldim ( ) const
inline

Leading dimension.

Returns
The leading dimension of the matrix
template<int M, class AT >
fmatvec::Matrix< Symmetric, Fixed< M >, Fixed< M >, 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
template<int M, class AT >
AT& fmatvec::Matrix< Symmetric, Fixed< M >, Fixed< M >, 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
template<int M, class AT >
const AT& fmatvec::Matrix< Symmetric, Fixed< M >, Fixed< M >, AT >::operator() ( int  i,
int  j 
) const
inline

Element operator.

See operator()(int,int)

template<int M, class AT >
AT* fmatvec::Matrix< Symmetric, Fixed< M >, Fixed< M >, AT >::operator() ( )
inline

Pointer operator.

Returns the pointer to the first element.

Returns
The pointer to the first element.
template<int M, class AT >
const AT* fmatvec::Matrix< Symmetric, Fixed< M >, Fixed< M >, AT >::operator() ( ) const
inline

Pointer operator.

See operator()()

template<int M, class AT >
template<class Type , class Row , class Col >
Matrix<Symmetric,Fixed<M>,Fixed<M>,AT>& fmatvec::Matrix< Symmetric, Fixed< M >, Fixed< M >, 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.
template<int M, class AT >
Matrix<Symmetric,Fixed<M>,Fixed<M>,AT>& fmatvec::Matrix< Symmetric, Fixed< M >, Fixed< M >, AT >::operator= ( const Matrix< Symmetric, Fixed< M >, Fixed< M >, AT > &  A)
inlinedefault

Assignment operator.

Copies the symmetric matrix given by A.

Parameters
AThe matrix to be assigned.
Returns
A reference to the calling matrix.
template<int M, class AT >
template<class Type , class Row , class Col >
Matrix<Symmetric,Fixed<M>,Fixed<M>,AT>& fmatvec::Matrix< Symmetric, Fixed< M >, Fixed< M >, 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.
template<int M, class AT >
void fmatvec::Matrix< Symmetric, Fixed< M >, Fixed< M >, AT >::resize ( int  n,
int  m 
)
inline

Resize a fixed matrix Do nothing for the fixed dimension and throw for any other dimension.

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

Number of rows.

Returns
The number of rows of the matrix
template<int M, class AT >
constexpr int fmatvec::Matrix< Symmetric, Fixed< M >, Fixed< M >, 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: