SCIRun  5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
SparseRowMatrixGeneric< T > Class Template Reference

#include <MatrixFwd.h>

Inheritance diagram for SparseRowMatrixGeneric< T >:
Matrix< T > MatrixBase MatrixInterface< T > PropertyManager Persistent

Classes

class  Builder
 
class  Data
 

Public Types

typedef boost::shared_array
< index_type
Rows
 
typedef boost::shared_array
< index_type
Columns
 
typedef boost::shared_array< T > Storage
 
- Public Types inherited from Matrix< T >
typedef T element_type
 

Public Member Functions

bool validate ()
 
void order_columns ()
 
 SparseRowMatrixGeneric (size_type r, size_type c, const Data &data, size_type nnz, bool sort_columns=false)
 Constructors. More...
 
 SparseRowMatrixGeneric (const SparseRowMatrixGeneric &)
 
virtual SparseRowMatrixGenericclone () const
 Make a duplicate, needed to support detach from LockingHandle. More...
 
SparseRowMatrixGenericoperator= (const SparseRowMatrixGeneric &)
 
virtual ~SparseRowMatrixGeneric ()
 Destructor. More...
 
virtual DenseMatrixdense ()
 Convert this matrix to the specified type. More...
 
virtual SparseRowMatrixGenericsparse ()
 
virtual ColumnMatrixcolumn ()
 
virtual DenseColMajMatrixdense_col_maj ()
 
virtual T * get_data_pointer () const
 
virtual size_type get_data_size () const
 
index_type getIdx (index_type, index_type)
 
size_type get_nnz () const
 
T * get_vals ()
 
const T * get_vals () const
 
index_typeget_rows ()
 
index_typeget_cols ()
 
const index_typeget_rows () const
 
const index_typeget_cols () const
 
index_type get_row (index_type i) const
 
index_type get_col (index_type i) const
 
get_value (index_type i) const
 
bool is_valid () const
 
virtual bool is_zero () const
 
T & operator() (index_type r, index_type c)
 
const T & operator() (index_type r, index_type c) const
 
virtual void zero ()
 
virtual T get (index_type, index_type) const
 
virtual void put (index_type row, index_type col, T val)
 
virtual void add (index_type row, index_type col, T val)
 
virtual T min ()
 
virtual T max ()
 
virtual int compute_checksum ()
 
virtual void getRowNonzerosNoCopy (index_type r, size_type &size, size_type &stride, index_type *&cols, T *&vals)
 
virtual SparseRowMatrixGenericmake_transpose () const
 
virtual void mult (const ColumnMatrix &x, ColumnMatrix &b, index_type beg=-1, index_type end=-1, int spVec=0) const
 
virtual void mult_transpose (const ColumnMatrix &x, ColumnMatrix &b, index_type beg=-1, index_type end=-1, int spVec=0) const
 
virtual void scalar_multiply (T s)
 
virtual MatrixHandle submatrix (index_type r1, index_type c1, index_type r2, index_type c2)
 
virtual void print (std::string &) const
 
virtual std::string dynamic_type_name () const
 Persistent representation... More...
 
virtual void io (Piostream &)
 
- Public Member Functions inherited from Matrix< T >
virtual ~Matrix ()
 
size_type nrows () const
 
size_type ncols () const
 
virtual bool invert ()
 return false if not invertible. More...
 
T * begin () const
 
T * end () const
 
size_type number_of_nonzero_elements () const
 
- Public Member Functions inherited from MatrixBase
 MatrixBase ()
 
void set_raw (bool v)
 
bool get_raw () const
 
void set_raw_filename (const std::string &f)
 
const std::string get_raw_filename () const
 
- Public Member Functions inherited from PropertyManager
 PropertyManager ()
 
 PropertyManager (const PropertyManager &copy)
 
virtual ~PropertyManager ()
 
PropertyManageroperator= (const PropertyManager &pm)
 
void copy_properties (const PropertyManager *src)
 
bool operator== (const PropertyManager &pm)
 
bool operator!= (const PropertyManager &pm)
 
template<class T >
void set_property (const std::string &, const T &, bool is_transient)
 
template<class T >
bool get_property (const std::string &, T &)
 
bool is_property (const std::string &)
 
std::string get_property_name (size_t index)
 
virtual void freeze ()
 – mutability – More...
 
virtual void thaw ()
 thaw will remove all transient properties from the PropertyManager. More...
 
bool is_frozen () const
 query frozen state of a PropertyManager. More...
 
void remove_property (const std::string &)
 
size_t nproperties () const
 
const std::map< std::string,
PropertyBase * > & 
properties () const
 
void set_name (const std::string &name)
 
std::string get_name ()
 
- Public Member Functions inherited from Persistent
virtual ~Persistent ()
 
- Public Member Functions inherited from MatrixInterface< T >
virtual ~MatrixInterface ()
 

Static Public Member Functions

static SparseRowMatrixGenericidentity (size_type size)
 
static PersistentSparseRowMatrixGenericMaker ()
 
- Static Public Member Functions inherited from Persistent
static PersistentTypeIDPtr find_derived (const std::string &classname, const std::string &basename)
 
static bool is_base_of (const std::string &parent, const std::string &type)
 
static void add_class (const std::string &type, const std::string &parent, Persistent *(*maker)(), Persistent *(*bc_maker1)()=0, Persistent *(*bc_maker2)()=0)
 
static void add_mesh_class (const std::string &type, Persistent *(*maker)(), Persistent *(*bc_maker1)()=0, Persistent *(*bc_maker2)()=0)
 
static void add_field_class (const std::string &type, Persistent *(*maker)(), Persistent *(*bc_maker1)()=0, Persistent *(*bc_maker2)()=0)
 

Static Public Attributes

static PersistentTypeID type_id
 
- Static Public Attributes inherited from Matrix< T >
static PersistentTypeID type_id
 
- Static Public Attributes inherited from MatrixBase
static PersistentTypeID type_id
 
- Static Public Attributes inherited from PropertyManager
static PersistentTypeID type_id
 

Additional Inherited Members

- Protected Member Functions inherited from Matrix< T >
 Matrix (size_type nrows=0, size_type ncols=0)
 
- Protected Member Functions inherited from PropertyManager
void clear_transient ()
 A frozen PropertyManager may store transient data. More...
 
- Protected Attributes inherited from Matrix< T >
size_type nrows_
 
size_type ncols_
 
- Protected Attributes inherited from MatrixBase
bool separate_raw_
 
std::string raw_filename_
 
- Protected Attributes inherited from PropertyManager
bool frozen_
 
Core::Thread::Mutex lock
 

Member Typedef Documentation

typedef boost::shared_array<index_type> Columns
typedef boost::shared_array<index_type> Rows
typedef boost::shared_array<T> Storage

Constructor & Destructor Documentation

SparseRowMatrixGeneric ( size_type  r,
size_type  c,
const Data data,
size_type  nnz,
bool  sort_columns = false 
)

Constructors.

~SparseRowMatrixGeneric ( )
virtual

Destructor.

Member Function Documentation

void add ( index_type  row,
index_type  col,
val 
)
virtual

Implements Matrix< T >.

SparseRowMatrixGeneric< T > * clone ( ) const
virtual

Make a duplicate, needed to support detach from LockingHandle.

Implements Matrix< T >.

ColumnMatrix * column ( )
virtual

Implements Matrix< T >.

int compute_checksum ( )
virtual

Implements Matrix< T >.

DenseMatrix * dense ( )
virtual

Convert this matrix to the specified type.

Implements Matrix< T >.

DenseColMajMatrix * dense_col_maj ( )
virtual

Implements Matrix< T >.

virtual std::string dynamic_type_name ( ) const
inlinevirtual

Persistent representation...

Reimplemented from Matrix< T >.

T get ( index_type  i,
index_type  j 
) const
virtual

Implements Matrix< T >.

index_type get_col ( index_type  i) const
inline
index_type* get_cols ( )
inline
const index_type* get_cols ( ) const
inline
T * get_data_pointer ( ) const
virtual

Implements Matrix< T >.

size_type get_data_size ( ) const
virtual

Implements Matrix< T >.

size_type get_nnz ( ) const
inline
index_type get_row ( index_type  i) const
inline
index_type* get_rows ( )
inline
const index_type* get_rows ( ) const
inline
T* get_vals ( )
inline
const T* get_vals ( ) const
inline
T get_value ( index_type  i) const
inline
index_type getIdx ( index_type  i,
index_type  j 
)
void getRowNonzerosNoCopy ( index_type  r,
size_type size,
size_type stride,
index_type *&  cols,
T *&  vals 
)
virtual

Implements Matrix< T >.

SparseRowMatrixGeneric< T > * identity ( size_type  size)
static
void io ( Piostream stream)
virtual

Reimplemented from MatrixBase.

bool is_valid ( ) const
inline
virtual bool is_zero ( ) const
inlinevirtual

Reimplemented from Matrix< T >.

SparseRowMatrixGeneric< T > * make_transpose ( ) const
virtual

Implements Matrix< T >.

T max ( )
virtual

Implements Matrix< T >.

T min ( )
virtual

Implements Matrix< T >.

void mult ( const ColumnMatrix x,
ColumnMatrix b,
index_type  beg = -1,
index_type  end = -1,
int  spVec = 0 
) const
virtual

Implements Matrix< T >.

void mult_transpose ( const ColumnMatrix x,
ColumnMatrix b,
index_type  beg = -1,
index_type  end = -1,
int  spVec = 0 
) const
virtual

Implements Matrix< T >.

T& operator() ( index_type  r,
index_type  c 
)
inline
const T& operator() ( index_type  r,
index_type  c 
) const
inline
SparseRowMatrixGeneric< T > & operator= ( const SparseRowMatrixGeneric< T > &  copy)
void order_columns ( )

This code should reorder the columns of a sparse matrix so they are in ascending order. This code will purge duplicates as well by merging them together.

Calculate the size of the buffer we need to reorder the data This way we can use the stl sorting algorithm

Sorting columns and removing duplicates

void print ( std::string &  str) const
virtual

Reimplemented from MatrixBase.

void put ( index_type  row,
index_type  col,
val 
)
virtual

Implements Matrix< T >.

void scalar_multiply ( s)
virtual
Todo:
: replace with for_each

Reimplemented from Matrix< T >.

SparseRowMatrixGeneric< T > * sparse ( )
virtual

Implements Matrix< T >.

Persistent * SparseRowMatrixGenericMaker ( )
static
MatrixHandle submatrix ( index_type  r1,
index_type  c1,
index_type  r2,
index_type  c2 
)
virtual

Implements Matrix< T >.

bool validate ( )
void zero ( )
virtual

Implements Matrix< T >.

Member Data Documentation

PersistentTypeID type_id
static

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