Public Member Functions
fmatvec::Matrix< GeneralBand, AT > Class Template Reference

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

#include <band_matrix.h>

List of all members.

Public Member Functions

 Matrix ()
 Standard constructor.
 Matrix (int n_, int kl_, int ku_)
 Regular Constructor.
 Matrix (int n_, int kl_, int ku_, Initialization ini, const AT &a=0)
 Regular Constructor.
 Matrix (const Matrix< GeneralBand, AT > &A)
 Copy Constructor.
 Matrix (int n_, int kl_, int ku_, AT *ele_)
 Regular Constructor.
 ~Matrix ()
 Destructor.
Matrix< GeneralBand, AT > & resize (int n_, int kl_, int ku_)
 Matrix resizing.
Matrix< GeneralBand, AT > & resize (int n_, int kl_, int ku_, Initialization ini, const AT &a=0)
 Matrix resizing.
Matrix< GeneralBand, AT > & operator= (const Matrix< GeneralBand, AT > &A)
 Assignment operator.
Matrix< GeneralBand, AT > & operator<< (const Matrix< GeneralBand, AT > &A)
 Copy operator.
Matrix< GeneralBand, AT > & operator>> (const Matrix< GeneralBand, AT > &A)
 Reference operator.
const AT & operator() (int i, int j) const
 Element operator.
AT * operator() ()
 Pointer operator.
const AT * operator() () const
 Pointer operator.
int size () const
 Size.
int rows () const
 Number of rows.
int cols () const
 Number of columns.
const CBLAS_ORDER blasOrder () const
 Storage convention.
const Vector< AT > operator() (int i) const
 Diagonal operator.
Vector< AT > operator() (int i)
 Diagonal operator.
Matrix< GeneralBand, AT > & resize ()
 Matrix unsizing.
Matrix< GeneralBand, AT > copy () const
 Matrix duplicating.
Matrix< GeneralBand, AT > & init (const AT &a)
 Initialization.
 operator std::vector< std::vector< AT > > ()
 Cast to std::vector<std::vector<AT> >.

Detailed Description

template<class AT>
class fmatvec::Matrix< GeneralBand, 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

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

Standard constructor.

Constructs a band matrix with no size.

template<class AT >
fmatvec::Matrix< GeneralBand, AT >::Matrix ( int  n_,
int  kl_,
int  ku_ 
)
inline

Regular Constructor.

Constructs a band matrix of size n x n.

Parameters:
n_The number of rows and columns.
kl_The number of subdiagonals.
ku_The number of superdiagonals.
Remarks:
The matrix will be initialised to zero by default. This default behavior can be changed by defining FMATVEC_NO_INITIALIZATION.
template<class AT >
fmatvec::Matrix< GeneralBand, AT >::Matrix ( int  n_,
int  kl_,
int  ku_,
Initialization  ini,
const AT &  a = 0 
)
inline

Regular Constructor.

Constructs a band matrix of size n x n. The matrix will be initialized to the value given by a (default 0), if ini is set to INIT. If init is set to NONINIT, the matrix will not be initialized.

Parameters:
n_The number of rows and columns.
kl_The number of subdiagonals.
ku_The number of superdiagonals.
Remarks:
The matrix will be initialised to
Parameters:
iniINIT means initialization, NONINIT means no initialization.
aThe value, the matrix will be initialized with (default 0)
template<class AT >
fmatvec::Matrix< GeneralBand, AT >::Matrix ( const Matrix< GeneralBand, AT > &  A)
inline

Copy Constructor.

Constructs a reference to the band matrix A.

Attention:
The physical memory of the matrix A will not be copied, only referenced.
Parameters:
AThe matrix that will be referenced.
template<class AT >
fmatvec::Matrix< GeneralBand, AT >::Matrix ( int  n_,
int  kl_,
int  ku_,
AT *  ele_ 
)
inline

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

template<class AT >
const CBLAS_ORDER fmatvec::Matrix< GeneralBand, 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.
template<class AT >
int fmatvec::Matrix< GeneralBand, AT >::cols ( ) const
inline

Number of columns.

Returns:
The number of columns of the matrix

Referenced by operator<<().

template<class AT >
Matrix< GeneralBand, AT > fmatvec::Matrix< GeneralBand, AT >::copy ( ) const

Matrix duplicating.

The calling matrix returns a deep copy of itself.

Returns:
The duplicate.
template<class AT >
Matrix< GeneralBand, AT > & fmatvec::Matrix< GeneralBand, AT >::init ( const AT &  a)

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<class AT >
fmatvec::Matrix< GeneralBand, AT >::operator std::vector< std::vector< AT > > ( )

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

Returns:
The std::vector<std::vector<AT> > representation of the matrix
template<class AT >
const AT& fmatvec::Matrix< GeneralBand, 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 by default. To change this behavior, define FMATVEC_NO_BOUNDS_CHECK.
See also:
operator()(int,int) const
template<class AT >
AT* fmatvec::Matrix< GeneralBand, AT >::operator() ( )
inline

Pointer operator.

Returns the pointer to the first element.

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

Pointer operator.

see operator()()

template<class AT >
const Vector< AT > fmatvec::Matrix< GeneralBand, AT >::operator() ( int  i) const

Diagonal operator.

See operator()(int)

template<class AT >
Vector< AT > fmatvec::Matrix< GeneralBand, AT >::operator() ( int  i)

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.
template<class AT >
Matrix< GeneralBand, AT > & fmatvec::Matrix< GeneralBand, AT >::operator<< ( const Matrix< GeneralBand, AT > &  A)

Copy operator.

Copies the band matrix given by A.

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

References cols(), resize(), and rows().

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

Assignment operator.

Copies the band matrix given by A by calling operator<<().

Parameters:
AThe matrix to be assigned.
Returns:
A reference to the calling matrix.
Remarks:
To call operator>>() by default, define FMATVEC_NO_DEEP_ASSIGNMENT
See also:
operator<<(), operator>>()

References fmatvec::operator<<(), and fmatvec::operator>>().

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

Reference operator.

References the band matrix given by A.

Parameters:
AThe matrix to be referenced.
Returns:
A reference to the calling matrix.
template<class AT >
Matrix<GeneralBand, AT>& fmatvec::Matrix< GeneralBand, AT >::resize ( int  n_,
int  kl_,
int  ku_ 
)
inline

Matrix resizing.

Resizes the matrix to size n x n.

Parameters:
n_The number of rows and columns.
kl_The number of subdiagonals.
ku_The number of superdiagonals.
Returns:
A reference to the calling matrix.
Remarks:
The matrix will be initialised to zero by default. To change this behavior, define FMATVEC_NO_INITIALIZATION.

References resize().

Referenced by operator<<(), and resize().

template<class AT >
Matrix<GeneralBand, AT>& fmatvec::Matrix< GeneralBand, AT >::resize ( int  n_,
int  kl_,
int  ku_,
Initialization  ini,
const AT &  a = 0 
)
inline

Matrix resizing.

Resizes the matrix to size m x n. The matrix will be initialized to the value given by a (default 0), if ini is set to INIT. If init is set to NONINIT, the matrix will not be initialized.

Parameters:
n_The number of rows and columns.
kl_The number of subdiagonals.
ku_The number of superdiagonals.
iniINIT means initialization, NONINIT means no initialization.
aThe value, the matrix will be initialized with (default 0)
Returns:
A reference to the calling matrix.

References resize().

template<class AT >
Matrix<GeneralBand, AT>& fmatvec::Matrix< GeneralBand, AT >::resize ( )
inline

Matrix unsizing.

Resizes the matrix to size zero.

Returns:
A reference to the calling matrix.
template<class AT >
int fmatvec::Matrix< GeneralBand, AT >::rows ( ) const
inline

Number of rows.

Returns:
The number of rows of the matrix

Referenced by operator<<().

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

Size.

Returns:
The size of the matrix

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