Ravelin
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Ravelin::SPARSEMATRIXN Class Reference

A sparse matrix. More...

#include <SparseMatrixNd.h>

Public Types

enum  StorageType { eCSR, eCSC, eCSR, eCSC }
 
enum  StorageType { eCSR, eCSC, eCSR, eCSC }
 

Public Member Functions

 SPARSEMATRIXN (StorageType s)
 
 SPARSEMATRIXN (StorageType s, unsigned m, unsigned n, const std::map< std::pair< unsigned, unsigned >, REAL > &values)
 
 SPARSEMATRIXN (StorageType s, unsigned m, unsigned n, boost::shared_array< unsigned > ptr, boost::shared_array< unsigned > indices, boost::shared_array< REAL > data)
 
 SPARSEMATRIXN (const MATRIXN &m, REAL tol=EPS)
 
 SPARSEMATRIXN (StorageType s, const MATRIXN &m, REAL tol=EPS)
 
REAL norm_inf () const
 
VECTORNmult (const VECTORN &x, VECTORN &result) const
 
VECTORNtranspose_mult (const VECTORN &x, VECTORN &result) const
 
MATRIXNmult (const MATRIXN &m, MATRIXN &result) const
 
MATRIXNmult_transpose (const MATRIXN &m, MATRIXN &result) const
 
MATRIXNtranspose_mult (const MATRIXN &m, MATRIXN &result) const
 
MATRIXNtranspose_mult_transpose (const MATRIXN &m, MATRIXN &result) const
 
unsigned rows () const
 
unsigned columns () const
 
SPARSEMATRIXN get_sub_mat (unsigned rstart, unsigned rend, unsigned cstart, unsigned cend) const
 
SPARSEVECTORNget_row (unsigned i, SPARSEVECTORN &row) const
 
SPARSEVECTORNget_column (unsigned i, SPARSEVECTORN &column) const
 
VECTORNget_row (unsigned i, VECTORN &row) const
 
VECTORNget_column (unsigned i, VECTORN &column) const
 
const unsigned * get_indices () const
 
const unsigned * get_ptr () const
 
const REAL * get_data () const
 
void set_row (unsigned i, const VECTORN &v)
 
void set_column (unsigned i, const VECTORN &v)
 
SPARSEMATRIXNoperator= (const SPARSEMATRIXN &m)
 
SPARSEMATRIXNoperator-= (const SPARSEMATRIXN &m)
 
SPARSEMATRIXNoperator+= (const SPARSEMATRIXN &m)
 
SPARSEMATRIXNoperator*= (REAL scalar)
 
SPARSEMATRIXNnegate ()
 
MATRIXNto_dense (MATRIXN &m) const
 
void set_capacities (unsigned nnz_capacity, unsigned ptr_capacity, bool preserve)
 
void get_values (std::map< std::pair< unsigned, unsigned >, REAL > &values) const
 
StorageType get_storage_type () const
 Gets the storage type.
 
unsigned * get_indices ()
 Gets the column (row, if CSC) indices of the nonzeros (sized get_nnz()
 
unsigned * get_ptr ()
 Gets the row (column, if CSC) pointers.
 
REAL * get_data ()
 Gets the array of nonzeros (sized get_nnz())
 
unsigned get_nnz () const
 Gets the number of nonzeros.
 
 SPARSEMATRIXN (StorageType s)
 
 SPARSEMATRIXN (StorageType s, unsigned m, unsigned n, const std::map< std::pair< unsigned, unsigned >, REAL > &values)
 
 SPARSEMATRIXN (StorageType s, unsigned m, unsigned n, boost::shared_array< unsigned > ptr, boost::shared_array< unsigned > indices, boost::shared_array< REAL > data)
 
 SPARSEMATRIXN (const MATRIXN &m, REAL tol=EPS)
 
 SPARSEMATRIXN (StorageType s, const MATRIXN &m, REAL tol=EPS)
 
REAL norm_inf () const
 
VECTORNmult (const VECTORN &x, VECTORN &result) const
 
VECTORNtranspose_mult (const VECTORN &x, VECTORN &result) const
 
MATRIXNmult (const MATRIXN &m, MATRIXN &result) const
 
MATRIXNmult_transpose (const MATRIXN &m, MATRIXN &result) const
 
MATRIXNtranspose_mult (const MATRIXN &m, MATRIXN &result) const
 
MATRIXNtranspose_mult_transpose (const MATRIXN &m, MATRIXN &result) const
 
unsigned rows () const
 
unsigned columns () const
 
SPARSEMATRIXN get_sub_mat (unsigned rstart, unsigned rend, unsigned cstart, unsigned cend) const
 
SPARSEVECTORNget_row (unsigned i, SPARSEVECTORN &row) const
 
SPARSEVECTORNget_column (unsigned i, SPARSEVECTORN &column) const
 
VECTORNget_row (unsigned i, VECTORN &row) const
 
VECTORNget_column (unsigned i, VECTORN &column) const
 
const unsigned * get_indices () const
 
const unsigned * get_ptr () const
 
const REAL * get_data () const
 
void set_row (unsigned i, const VECTORN &v)
 
void set_column (unsigned i, const VECTORN &v)
 
SPARSEMATRIXNoperator= (const SPARSEMATRIXN &m)
 
SPARSEMATRIXNoperator-= (const SPARSEMATRIXN &m)
 
SPARSEMATRIXNoperator+= (const SPARSEMATRIXN &m)
 
SPARSEMATRIXNoperator*= (REAL scalar)
 
SPARSEMATRIXNnegate ()
 
MATRIXNto_dense (MATRIXN &m) const
 
void set_capacities (unsigned nnz_capacity, unsigned ptr_capacity, bool preserve)
 
void get_values (std::map< std::pair< unsigned, unsigned >, REAL > &values) const
 
StorageType get_storage_type () const
 Gets the storage type.
 
unsigned * get_indices ()
 Gets the column (row, if CSC) indices of the nonzeros (sized get_nnz()
 
unsigned * get_ptr ()
 Gets the row (column, if CSC) pointers.
 
REAL * get_data ()
 Gets the array of nonzeros (sized get_nnz())
 
unsigned get_nnz () const
 Gets the number of nonzeros.
 

Static Public Member Functions

static SPARSEMATRIXN identity (unsigned n)
 
static SPARSEMATRIXN identity (StorageType stype, unsigned n)
 
static SPARSEMATRIXNouter_square (const VECTORN &g, SPARSEMATRIXN &result)
 
static SPARSEMATRIXNouter_square (const SPARSEVECTORN &v, SPARSEMATRIXN &result)
 
static SPARSEMATRIXN identity (unsigned n)
 
static SPARSEMATRIXN identity (StorageType stype, unsigned n)
 
static SPARSEMATRIXNouter_square (const VECTORN &g, SPARSEMATRIXN &result)
 
static SPARSEMATRIXNouter_square (const SPARSEVECTORN &v, SPARSEMATRIXN &result)
 

Protected Member Functions

 SPARSEMATRIXN (StorageType stype, unsigned m, unsigned n)
 
 SPARSEMATRIXN (StorageType stype, unsigned m, unsigned n)
 

Protected Attributes

boost::shared_array< unsigned > _indices
 
boost::shared_array< unsigned > _ptr
 
boost::shared_array< REAL > _data
 
unsigned _nnz
 
unsigned _rows
 
unsigned _columns
 
unsigned _nnz_capacity
 
unsigned _ptr_capacity
 
StorageType _stype
 

Detailed Description

A sparse matrix.


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