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

This is a matrix class for general band matrices. More...

#include <band_matrix.h>

Public Types

typedef AT value_type
 
typedef GeneralBand shape_type
 

Public Member Functions

 Matrix ()
 Standard constructor. More...
 
 Matrix (int n_, int kl_, int ku_, Noinit)
 
 Matrix (int n_, int kl_, int ku_, Init ini=INIT, const AT &a=AT())
 
 Matrix (int n_, int kl_, int ku_, Eye ini, const AT &a=1)
 
 Matrix (int m_, int n_, int kl_, int ku_, Noinit)
 
 Matrix (int m_, int n_, int kl_, int ku_, Init ini=INIT, const AT &a=AT())
 
 Matrix (int m_, int n_, int kl_, int ku_, Eye ini, const AT &a=1)
 
 Matrix (const Matrix< GeneralBand, Ref, Ref, AT > &A)
 Copy Constructor. More...
 
template<class Type , class Row , class Col >
 Matrix (const Matrix< Type, Row, Col, AT > &A)
 Copy Constructor. More...
 
 Matrix (int n_, int kl_, int ku_, AT *ele_)
 Regular Constructor. More...
 
 ~Matrix ()=default
 Destructor.
 
Matrix< GeneralBand, Ref, Ref, AT > & resize (int n_, int kl_, int ku_, Noinit)
 
Matrix< GeneralBand, Ref, Ref, AT > & resize (int n, int kl, int ku=0, Init ini=INIT, const AT &a=AT())
 
Matrix< GeneralBand, Ref, Ref, AT > & resize (int n, int kl, int ku, Eye ini, const AT &a=1)
 
Matrix< GeneralBand, Ref, Ref, AT > & operator= (const Matrix< GeneralBand, Ref, Ref, AT > &A)
 Assignment operator. More...
 
template<class Type , class Row , class Col >
Matrix< GeneralBand, Ref, Ref, AT > & operator= (const Matrix< Type, Row, Col, AT > &A)
 Assignment operator. More...
 
Matrix< GeneralBand, Ref, Ref, AT > & operator&= (Matrix< GeneralBand, Ref, Ref, AT > &A)
 Reference operator. More...
 
template<class Type , class Row , class Col >
Matrix< GeneralBand, Ref, Ref, AT > & operator<<= (const Matrix< Type, Row, Col, AT > &A)
 Matrix assignment. More...
 
const AT & operator() (int i, int j) const
 Element operator. More...
 
AT * operator() ()
 Pointer operator. More...
 
const AT * operator() () const
 Pointer operator. More...
 
int size () const
 Size. More...
 
int rows () const
 Number of rows. More...
 
int cols () const
 Number of columns. More...
 
const CBLAS_ORDER blasOrder () const
 Storage convention. More...
 
Matrix< GeneralBand, Ref, Ref, AT > & init (const AT &val=AT())
 Diagonal operator. More...
 
Matrix< GeneralBand, Ref, Ref, AT > & init (Init, const AT &a=AT())
 
Matrix< GeneralBand, Ref, Ref, AT > & init (Eye, const AT &val=1)
 
Matrix< GeneralBand, Ref, Ref, AT > & init (Noinit, const AT &a=AT())
 
 operator std::vector< std::vector< AT >> () const
 Cast to std::vector<std::vector<AT>>. More...
 

Static Public Attributes

static constexpr bool isVector {false}
 

Detailed Description

template<class AT>
class fmatvec::Matrix< GeneralBand, Ref, Ref, AT >

This is a matrix class for general band matrices.

Template class Matrix with shape type GeneralBand and atomic type AT. 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< GeneralBand, Ref, Ref, AT >::Matrix ( )
inlineexplicit

Standard constructor.

Constructs a band matrix with no size.

◆ Matrix() [2/4]

template<class AT >
fmatvec::Matrix< GeneralBand, Ref, Ref, AT >::Matrix ( const Matrix< GeneralBand, Ref, Ref, AT > &  A)
inline

Copy Constructor.

Constructs a copy of the band matrix A.

Parameters
AThe matrix that will be copied.

◆ Matrix() [3/4]

template<class AT >
template<class Type , class Row , class Col >
fmatvec::Matrix< GeneralBand, Ref, Ref, 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.

◆ Matrix() [4/4]

template<class AT >
fmatvec::Matrix< GeneralBand, Ref, Ref, AT >::Matrix ( int  n_,
int  kl_,
int  ku_,
AT *  ele_ 
)
inlineexplicit

Regular Constructor.

Constructs a band matrix of size n x n with the pyhsical memory given by ele_.

Parameters
n_The number of rows and columns.
kl_The number of subdiagonals.
ku_The number of superdiagonals.
ele_The physical memory the matrix will point to.

Member Function Documentation

◆ blasOrder()

template<class AT >
const CBLAS_ORDER fmatvec::Matrix< GeneralBand, Ref, Ref, 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
CblasColMajor.

◆ cols()

template<class AT >
int fmatvec::Matrix< GeneralBand, Ref, Ref, AT >::cols ( ) const
inline

Number of columns.

Returns
The number of columns of the matrix

◆ init()

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

Diagonal operator.

See operator()(int)

Diagonal operator

If i<0, the i-th subdiagonal is returned. Otherwise the i-th superdiagonal is returned.

Parameters
iThe i-th super- and subdiagonal, respectively.

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.

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

template<class AT >
fmatvec::Matrix< GeneralBand, Ref, Ref, 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&=()

template<class AT >
Matrix<GeneralBand,Ref,Ref,AT>& fmatvec::Matrix< GeneralBand, Ref, Ref, AT >::operator&= ( Matrix< GeneralBand, Ref, Ref, AT > &  A)
inline

Reference operator.

References the band matrix given by A.

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

◆ operator()() [1/3]

template<class AT >
const AT& fmatvec::Matrix< GeneralBand, Ref, Ref, AT >::operator() ( int  i,
int  j 
) const
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/3]

template<class AT >
AT* fmatvec::Matrix< GeneralBand, Ref, Ref, AT >::operator() ( )
inline

Pointer operator.

Returns the pointer to the first element.

Returns
The pointer to the first element.

◆ operator()() [3/3]

template<class AT >
const AT* fmatvec::Matrix< GeneralBand, Ref, Ref, AT >::operator() ( ) const
inline

Pointer operator.

see operator()()

◆ operator<<=()

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

Matrix assignment.

Copies the band matrix given by A.

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

◆ operator=() [1/2]

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

Assignment operator.

Copies the band 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<GeneralBand,Ref,Ref,AT>& fmatvec::Matrix< GeneralBand, Ref, Ref, AT >::operator= ( const Matrix< Type, Row, Col, AT > &  A)
inline

Assignment operator.

Copies the band matrix given by A.

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

◆ rows()

template<class AT >
int fmatvec::Matrix< GeneralBand, Ref, Ref, AT >::rows ( ) const
inline

Number of rows.

Returns
The number of rows of the matrix

◆ size()

template<class AT >
int fmatvec::Matrix< GeneralBand, Ref, Ref, AT >::size ( ) const
inline

Size.

Returns
The size of the matrix

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