SparseMatrixLine< T > Class Template Reference

An auxiliary class: Lines of a sparse matrix. More...

#include <SparseMatrix.hpp>

Collaboration diagram for SparseMatrixLine< T >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void Reset (long data_len, long n_offsets)
 Sets the new sizes (the contents are lost).
void ReSize (long data_len, long n_offsets)
 Resizes the arrays and copies the first entries.
long NEntries () const
 Returns the number of nonzero entries in the line.
long RefOffset (long i) const
 Returns the raw index of a referenced block in the src. vec.
void SetZero ()
 Sets the line to zero.
const T & Data (long i) const
 Returns a const-reference to the entry of 'data' for index i.
T & Data (long i)
 Returns a reference to the entry of 'data' for index i.

Friends

class Array< SparseMatrixLine< T > >
class SparseMatrix< T >

Detailed Description

template<typename T>
class SparseMatrixLine< T >

An auxiliary class: Lines of a sparse matrix.

Objects of this class stores entries of a matrix line associated with a grid position. The entries a kept in a compact ('Harwell-Boeing'-like) format.

The template depends on a type T. This type should satisfy the conditions listed in 'small_matrix.hpp' for small matrices.

Note:
The user should not created objects of this class. Its constructors are private and can be called only from the friend class SparseMatrix<T>. But the user can declare and use references and pointers to the objects stored in SparseMatrix<T>-objects.


Member Function Documentation

template<typename T>
void SparseMatrixLine< T >::Reset ( long  data_len,
long  n_offsets 
) [inline]

Sets the new sizes (the contents are lost).

Parameters:
[in] data_len The new number of T-objects in the line
[in] n_offsets The new number of the offsets in the line

template<typename T>
void SparseMatrixLine< T >::ReSize ( long  data_len,
long  n_offsets 
) [inline]

Resizes the arrays and copies the first entries.

Parameters:
[in] data_len The new number of T-objects in the line
[in] n_offsets The new number of the offsets in the line

template<typename T>
long SparseMatrixLine< T >::NEntries (  )  const [inline]

Returns the number of nonzero entries in the line.

template<typename T>
long SparseMatrixLine< T >::RefOffset ( long  i  )  const [inline]

Returns the raw index of a referenced block in the src. vec.

Parameters:
[in] i Index of the matrix entry in the line

template<typename T>
void SparseMatrixLine< T >::SetZero (  )  [inline]

Sets the line to zero.

template<typename T>
const T& SparseMatrixLine< T >::Data ( long  i  )  const [inline]

Returns a const-reference to the entry of 'data' for index i.

template<typename T>
T& SparseMatrixLine< T >::Data ( long  i  )  [inline]

Returns a reference to the entry of 'data' for index i.


Friends And Related Function Documentation

template<typename T>
friend class Array< SparseMatrixLine< T > > [friend]

template<typename T>
friend class SparseMatrix< T > [friend]


The documentation for this class was generated from the following file:
Generated on Fri Sep 21 12:34:41 2007 for SG2 by  doxygen 1.5.2