CMSparseMatrix Class Template Reference

A column-major sparse matrix class. More...

#include <SparseMatrix.h>

Inheritance diagram for CMSparseMatrix::

SparseMatrix List of all members.

Public Methods

 CMSparseMatrix (void)
 Empty constructor.

 CMSparseMatrix (int nrow, int ncol, int nnzero)
 Construct the matrix and resize the internal data.

 CMSparseMatrix (CMSparseMatrix< Ereal< T > > &mat)
 ~CMSparseMatrix ()
 Dummy virtual destructor.

void initialize (int nrow, int ncol, int nnzero)
 Setup a SparseMatrix that will be filled in later.

T & operator() (const int row, const int col)
 Returns the value of the element at the row-th row and col-th column.

const T & operator() (const int row, const int col) const
 Returns the value of the element at the row-th row and col-th column.

int adjoinColumn (int count, int *rowPosition, T *value)
 Add a column to the matrix.

int write (ostream &ostr) const
 Write out the matrix to an output stream.

int read (istream &istr)
 Read in the matrix from an input stream.

void convert (const RMSparseMatrix< T > &rowmajor)
 Convert a row-major matrix to a column-major matrix.

void delete_row (const int i)
 Delete the i-th row.

void delete_col (const int i)
 Delete the i-th column.

void delete_element (const int row, const int col)
 Delete the (row,col)-th element.


Public Attributes

friend RMSparseMatrix<T>

Detailed Description

template<class T>
class CMSparseMatrix< T >

A column-major sparse matrix class.

Adapted from the CMatrix class of Kalyan S. Perumalla and Jeff T. Linderoth.


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