sym-ildl  1.2
Incomplete LDL' factorizations of indefinite symmetric and skew-symmetric matrices.
Public Types | Public Member Functions | Public Attributes | Friends | List of all members
lil_sparse_matrix< el_type > Class Template Referenceabstract

The abstract parent of all sparse matrices. More...

#include <lil_sparse_matrix.h>

Inheritance diagram for lil_sparse_matrix< el_type >:
Inheritance graph
[legend]
Collaboration diagram for lil_sparse_matrix< el_type >:
Collaboration graph
[legend]

Public Types

typedef vector< int > idx_vector_type
 
typedef vector< el_type > elt_vector_type
 

Public Member Functions

 lil_sparse_matrix (int n_rows, int n_cols)
 Default constructor for an abstract matrix. This constructor will be extended by base classes depending on the representation of the matrix (LIL-C or LIL-R).
 
int n_rows () const
 
int n_cols () const
 
int nnz () const
 
virtual el_type coeff (const int &i, const int &j, int offset=0) const =0
 Returns A_ij (zero-indexed). This function should be extended by subclasses as it is dependent on the matrix storage type. More...
 
virtual std::string to_string () const =0
 
virtual ~lil_sparse_matrix ()
 

Public Attributes

int m_n_rows
 Number of rows in the matrix.
 
int m_n_cols
 Number of cols in the matrix.
 
int nnz_count
 Number of nonzeros in the matrix.
 
el_type eps
 Machine epsilon for el_type.
 
vector< idx_vector_type > m_idx
 The row/col indices. The way m_idx is used depends on whether the matrix is in LIL-C or LIL-R.
 
vector< elt_vector_type > m_x
 The values of the nonzeros in the matrix.
 

Friends

std::ostream & operator<< (std::ostream &os, const lil_sparse_matrix &A)
 Allows outputting the contents of the matrix via << operators.
 

Detailed Description

template<class el_type>
class lil_sparse_matrix< el_type >

The abstract parent of all sparse matrices.

Constructor & Destructor Documentation

template<class el_type >
virtual lil_sparse_matrix< el_type >::~lil_sparse_matrix ( )
inlinevirtual

Generic class destructor.

Member Function Documentation

template<class el_type >
virtual el_type lil_sparse_matrix< el_type >::coeff ( const int &  i,
const int &  j,
int  offset = 0 
) const
pure virtual

Returns A_ij (zero-indexed). This function should be extended by subclasses as it is dependent on the matrix storage type.

Parameters
ithe row of the (i,j)th element (zero-indexed).
jthe col of the (i,j)th element (zero-indexed).
offsetan optional search offset for use in linear search (start at offset instead of 0).
Returns
The (i,j)th element of the matrix.

Implemented in lilc_matrix< el_type >.

template<class el_type >
int lil_sparse_matrix< el_type >::n_cols ( ) const
inline
Returns
Number of cols in the matrix.
template<class el_type >
int lil_sparse_matrix< el_type >::n_rows ( ) const
inline
Returns
Number of rows in the matrix.
template<class el_type >
int lil_sparse_matrix< el_type >::nnz ( ) const
inline
Returns
Number of nonzeros in the matrix.
template<class el_type >
virtual std::string lil_sparse_matrix< el_type >::to_string ( ) const
pure virtual
Returns
A string reprepsentation of this matrix.

Implemented in lilc_matrix< el_type >.


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