ergo
SparsePattern Class Reference

A way to store sparse matrix patterns. More...

#include <sparse_pattern.h>

Classes

struct  Column
 
struct  Interval
 ranges are upper-exclusive: involve i: lo <= i < hi. More...
 

Public Types

typedef std::vector< IntervalIntervalList
 

Public Member Functions

 SparsePattern (const BasisInfoStruct &bis_)
 
 ~SparsePattern ()
 
void add (int nRanges, const int(*range)[2])
 marks specified ranges as used. More...
 
void save (FILE *f) const
 Save itself to the specified stream. More...
 
void load (FILE *f)
 Load itself from the specified stream. More...
 
const Columnoperator[] (int column) const
 
int getColumnSize (int col) const
 returns the number of stored elements for specified column. More...
 
int size () const
 Returns the dimension of the pattern. More...
 
int sizeTotal () const
 returns the total number of nonzero elements. More...
 

Private Attributes

const BasisInfoStructbis
 
Columnranges
 

Detailed Description

A way to store sparse matrix patterns.

Member Typedef Documentation

◆ IntervalList

typedef std::vector<Interval> SparsePattern::IntervalList

Constructor & Destructor Documentation

◆ SparsePattern()

SparsePattern::SparsePattern ( const BasisInfoStruct bis_)
inlineexplicit

◆ ~SparsePattern()

SparsePattern::~SparsePattern ( )
inline

Member Function Documentation

◆ add()

void SparsePattern::add ( int  nRanges,
const int(*)  range[2] 
)

◆ getColumnSize()

int SparsePattern::getColumnSize ( int  col) const
inline

returns the number of stored elements for specified column.

References SparsePattern::Column::size().

Referenced by load(), save(), sizeTotal(), and SparseMatrix::SparseMatrix().

◆ load()

void SparsePattern::load ( FILE *  f)

Load itself from the specified stream.

References bis, getColumnSize(), SparsePattern::Column::list, BasisInfoStruct::noOfBasisFuncs, and ranges.

◆ operator[]()

const Column& SparsePattern::operator[] ( int  column) const
inline

◆ save()

void SparsePattern::save ( FILE *  f) const

◆ size()

int SparsePattern::size ( ) const
inline

Returns the dimension of the pattern.

Auxiliary function.

References BasisInfoStruct::noOfBasisFuncs.

Referenced by SparseMatrix::createOffsets().

◆ sizeTotal()

int SparsePattern::sizeTotal ( ) const

returns the total number of nonzero elements.

References bis, getColumnSize(), and BasisInfoStruct::noOfBasisFuncs.

Member Data Documentation

◆ bis

const BasisInfoStruct& SparsePattern::bis
private

◆ ranges

Column* SparsePattern::ranges
private

Referenced by add(), load(), and save().


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