linbox
CSF< _Field > Class Template Reference

Space efficient representation of sparse matrices. More...

#include <csf.h>

+ Inheritance diagram for CSF< _Field >:

Data Structures

class  sort_data_by_col
 

Public Types

enum  csformat { csr , csc }
 
typedef size_t Index
 
typedef CSF< _Field > Self_t
 
typedef _Field Field
 
typedef _Field::Element Element
 
typedef std::vector< IndexIndexVector
 
typedef std::vector< ElementElementVector
 
typedef IndexVector PtrVector
 
typedef std::pair< Index, IndexIndexPair
 
typedef std::pair< IndexPair, ElementTriple
 
typedef std::vector< TripleData
 
typedef MatrixCategories::BlackboxTag MatrixCategory
 

Public Member Functions

 CSF ()
 
 ~CSF ()
 
 CSF (const Field &F)
 
 CSF (Field &F, Index *rowP, Index *colP, Element *valP, Index rows, Index cols, Index nnz)
 
 CSF (MatrixStream< Field > &ms)
 
 CSF (const CSF< Field > &A)
 
template<class OutVector, class InVector>
OutVector & apply (OutVector &y, const InVector &x) const
 
template<class OutVector, class InVector>
OutVector & applyTranspose (OutVector &y, const InVector &x) const
 
ElementgetEntry (Element &x, Index i, Index j)
 
ElementsetEntry (Index i, Index j, Element &x)
 
void finalize ()
 
double & d00norm (double &norm)
 
void read (MatrixStream< Field > &ms)
 Read the matrix from a matrix stream.
 
size_t rowdim () const
 
size_t coldim () const
 
IndexVectorgetRows ()
 
IndexVectorgetCols ()
 
ElementVectorgetVals ()
 
std::ostream & write_summary (std::ostream &out=std::cout) const
 
std::ostream & write_sms (std::ostream &out=std::cout) const
 
std::ostream & write (std::ostream &out=std::cout) const
 
const Fieldfield () const
 
size_t nnz () const
 

Protected Member Functions

void init (Data &d)
 

Protected Attributes

const Field_field
 
IndexVector _inds
 
ElementVector _vals
 
PtrVector _ptrs
 
size_t _rowdim
 
size_t _coldim
 
Data _data
 
bool sorted
 
bool isCSR
 

Detailed Description

template<class _Field>
class LinBox::CSF< _Field >

Space efficient representation of sparse matrices.

Compressed Sparse Row/Column (CSR/C) involves two arrays of length NNZ (number of non-zeros) One of column indices and another of matrix values. A third array contains pointers indicating the division of the two NNZ arrays into rows. (or vice versa w/r/t rows & columns)

Member Typedef Documentation

◆ Index

template<class _Field>
typedef size_t Index

◆ Self_t

template<class _Field>
typedef CSF<_Field> Self_t

◆ Field

template<class _Field>
typedef _Field Field

◆ Element

template<class _Field>
typedef _Field::Element Element

◆ IndexVector

template<class _Field>
typedef std::vector<Index> IndexVector

◆ ElementVector

template<class _Field>
typedef std::vector<Element> ElementVector

◆ PtrVector

template<class _Field>
typedef IndexVector PtrVector

◆ IndexPair

template<class _Field>
typedef std::pair<Index, Index> IndexPair

◆ Triple

template<class _Field>
typedef std::pair<IndexPair, Element> Triple

◆ Data

template<class _Field>
typedef std::vector<Triple> Data

◆ MatrixCategory

template<class _Field>
typedef MatrixCategories::BlackboxTag MatrixCategory

Member Enumeration Documentation

◆ csformat

template<class _Field>
enum csformat
Enumerator
csr 
csc 

Constructor & Destructor Documentation

◆ CSF() [1/5]

template<class _Field>
CSF ( )
inline

◆ ~CSF()

template<class _Field>
~CSF ( )
inline

◆ CSF() [2/5]

template<class _Field>
CSF ( const Field & F)
inline

◆ CSF() [3/5]

template<class _Field>
CSF ( Field & F,
Index * rowP,
Index * colP,
Element * valP,
Index rows,
Index cols,
Index nnz )
inline

◆ CSF() [4/5]

template<class _Field>
CSF ( MatrixStream< Field > & ms)
inline

◆ CSF() [5/5]

template<class _Field>
CSF ( const CSF< Field > & A)
inline

Member Function Documentation

◆ apply()

template<class Field>
template<class OutVector, class InVector>
OutVector & apply ( OutVector & y,
const InVector & x ) const
inline

◆ applyTranspose()

template<class _Field>
template<class OutVector, class InVector>
OutVector & applyTranspose ( OutVector & y,
const InVector & x ) const
inline

◆ getEntry()

template<class _Field>
Element & getEntry ( Element & x,
Index i,
Index j )
inline

◆ setEntry()

template<class _Field>
Element & setEntry ( Index i,
Index j,
Element & x )
inline

◆ finalize()

template<class _Field>
void finalize ( )
inline

◆ d00norm()

template<class _Field>
double & d00norm ( double & norm)
inline

◆ read()

template<class _Field>
void read ( MatrixStream< Field > & ms)
inline

Read the matrix from a matrix stream.

Parameters
msStream from which to read the matrix

◆ rowdim()

template<class _Field>
size_t rowdim ( ) const
inline

◆ coldim()

template<class _Field>
size_t coldim ( ) const
inline

◆ getRows()

template<class _Field>
IndexVector & getRows ( )
inline

◆ getCols()

template<class _Field>
IndexVector & getCols ( )
inline

◆ getVals()

template<class _Field>
ElementVector & getVals ( )
inline

◆ write_summary()

template<class _Field>
std::ostream & write_summary ( std::ostream & out = std::cout) const
inline

◆ write_sms()

template<class _Field>
std::ostream & write_sms ( std::ostream & out = std::cout) const
inline

◆ write()

template<class _Field>
std::ostream & write ( std::ostream & out = std::cout) const
inline

◆ field()

template<class _Field>
const Field & field ( ) const
inline

◆ nnz()

template<class _Field>
size_t nnz ( ) const
inline

◆ init()

template<class _Field>
void init ( Data & d)
inlineprotected

Field Documentation

◆ _field

template<class _Field>
const Field* _field
protected

◆ _inds

template<class _Field>
IndexVector _inds
protected

◆ _vals

template<class _Field>
ElementVector _vals
protected

◆ _ptrs

template<class _Field>
PtrVector _ptrs
protected

◆ _rowdim

template<class _Field>
size_t _rowdim
protected

◆ _coldim

template<class _Field>
size_t _coldim
protected

◆ _data

template<class _Field>
Data _data
protected

◆ sorted

template<class _Field>
bool sorted
protected

◆ isCSR

template<class _Field>
bool isCSR
protected

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