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

This is a matrix class for sparse quadratic matrices. More...

#include <sparse_matrix.h>

List of all members.

Public Member Functions

 Matrix ()
 Standard constructor.
 Matrix (int n_)
 Regular Constructor.
 Matrix (int n_, int k_)
 Regular Constructor.
 Matrix (const Matrix< Sparse, AT > &A)
 Copy Constructor.
 ~Matrix ()
 Destructor.
Matrix< Sparse, AT > & operator<< (const Matrix< Sparse, AT > &A)
 Copy operator.
Matrix< Sparse, AT > & operator>> (const Matrix< Sparse, AT > &A)
 Reference operator.
Matrix< Sparse, AT > & operator<< (const SquareMatrix< AT > &A)
 Element operator.
Matrix< Sparse, AT > & operator= (const Matrix< Sparse, AT > &A)
 Assignment operator.
const AT * operator() () const
 Pointer operator.
AT * operator() ()
 Pointer operator.
const int * Ip () const
 Pointer operator.
int * Ip ()
 Pointer operator.
const int * Jp () const
 Pointer operator.
int * Jp ()
 Pointer operator.
int rows () const
 Number of rows.
int cols () const
 Number of columns.
Matrix< Sparse, AT > copy () const
 Matrix duplicating.
Matrix< Sparse, AT > & resize ()
 Matrix unsizing.
Matrix< Sparse, AT > & resize (int n_, int k_)
 Matrix resizing.
Matrix< Sparse, AT > & init (const AT &a)
 Initialization.

Detailed Description

template<class AT>
class fmatvec::Matrix< Sparse, AT >

This is a matrix class for sparse quadratic matrices.

Template class Matrix with shape type Sparse and atomic type AT. The matrix ist stored in compressed row-wise skyline format, BUT the diagonal elements are ALWAYS stored (even if they are zero) as the FIRST entry of each row. 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< Sparse, AT >::Matrix ( )
inline

Standard constructor.

Constructs a matrix with no size.

template<class AT >
fmatvec::Matrix< Sparse, AT >::Matrix ( int  n_)
inline

Regular Constructor.

Constructs a matrix of size n x n.

Parameters:
n_The number of columns/rows.
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< Sparse, AT >::Matrix ( int  n_,
int  k_ 
)
inline

Regular Constructor.

Constructs a matrix of size n x n.

Parameters:
n_The number of columns/rows.
k_The number of nonzero elements.
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< Sparse, AT >::Matrix ( const Matrix< Sparse, AT > &  A)
inline

Copy Constructor.

Constructs a reference to the matrix A.

Attention:
The physical memory of the matrix A will not be copied, only referenced.
Parameters:
AThe matrix that will be referenced.

Member Function Documentation

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

Number of columns.

Returns:
The number of columns of the matrix

Referenced by fmatvec::operator*(), and operator<<().

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

Matrix duplicating.

The calling matrix returns a deep copy of itself.

Returns:
The duplicate.
template<class AT >
Matrix< Sparse, AT > & fmatvec::Matrix< Sparse, 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 >
const int* fmatvec::Matrix< Sparse, AT >::Ip ( ) const
inline

Pointer operator.

See Ip()

Referenced by fmatvec::operator*().

template<class AT >
int* fmatvec::Matrix< Sparse, AT >::Ip ( )
inline

Pointer operator.

Todo:
Docu
template<class AT >
const int* fmatvec::Matrix< Sparse, AT >::Jp ( ) const
inline

Pointer operator.

See Jp()

Referenced by fmatvec::operator*().

template<class AT >
int* fmatvec::Matrix< Sparse, AT >::Jp ( )
inline

Pointer operator.

Todo:
Docu
template<class AT >
const AT* fmatvec::Matrix< Sparse, AT >::operator() ( ) const
inline

Pointer operator.

See operator()()

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

Pointer operator.

Returns the pointer to the first element.

Returns:
The pointer to the first element.
template<class AT >
Matrix< Sparse, AT > & fmatvec::Matrix< Sparse, AT >::operator<< ( const Matrix< Sparse, AT > &  A)

Copy operator.

Copies the sparse 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< Sparse, AT > & fmatvec::Matrix< Sparse, AT >::operator<< ( const SquareMatrix< AT > &  A)
template<class AT >
Matrix<Sparse, AT>& fmatvec::Matrix< Sparse, AT >::operator= ( const Matrix< Sparse, AT > &  A)
inline

Assignment operator.

Copies the sparse 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< Sparse, AT > & fmatvec::Matrix< Sparse, AT >::operator>> ( const Matrix< Sparse, AT > &  A)

Reference operator.

References the sparse matrix given by A.

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

Matrix unsizing.

Resizes the matrix to size zero.

Returns:
A reference to the calling matrix.

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

template<class AT >
Matrix<Sparse, AT>& fmatvec::Matrix< Sparse, AT >::resize ( int  n_,
int  k_ 
)
inline

Matrix resizing.

Resizes the matrix to 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 columns/rows.
k_The number of nonzero elements.
Returns:
A reference to the calling matrix.

References resize().

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

Number of rows.

Returns:
The number of rows of the matrix

Referenced by fmatvec::operator*(), and operator<<().


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