Skylark (Sketching Library)  0.1
Public Types | Public Member Functions
skylark::base::sparse_matrix_t< ValueType > Struct Template Reference

#include <sparse_matrix.hpp>

List of all members.

Public Types

typedef int index_type
typedef ValueType value_type
typedef boost::tuple
< index_type, index_type,
value_type
coord_tuple_t
typedef std::vector
< coord_tuple_t
coords_t

Public Member Functions

 sparse_matrix_t ()
 sparse_matrix_t (sparse_matrix_t< ValueType > &&A)
 ~sparse_matrix_t ()
bool struct_updated () const
void reset_update_flag ()
template<typename IdxType , typename ValType >
void detach (IdxType *indptr, IdxType *indices, ValType *values) const
void attach (const index_type *indptr, const index_type *indices, double *values, int nnz, int n_rows, int n_cols, bool _own=false)
void attach (const index_type *indptr, const index_type *indices, double *values, int nnz, int n_rows, int n_cols, bool ownindptr, bool ownindices, bool ownvalues)
void set (coords_t coords, int n_rows=0, int n_cols=0)
int height () const
int width () const
int nonzeros () const
const index_typeindptr () const
const index_typeindices () const
value_typevalues ()
const value_typelocked_values () const
bool operator== (const sparse_matrix_t &rhs) const

Detailed Description

template<typename ValueType = double>
struct skylark::base::sparse_matrix_t< ValueType >

This implements a very crude CSC sparse matrix container only intended to hold local sparse matrices.

Row indices are not sorted. Structure is always constants, and can only be attached by Attached. Values of non-zeros can be modified.

Definition at line 20 of file sparse_matrix.hpp.


Member Typedef Documentation

template<typename ValueType = double>
typedef boost::tuple<index_type, index_type, value_type> skylark::base::sparse_matrix_t< ValueType >::coord_tuple_t

Definition at line 25 of file sparse_matrix.hpp.

template<typename ValueType = double>
typedef std::vector<coord_tuple_t> skylark::base::sparse_matrix_t< ValueType >::coords_t

Definition at line 26 of file sparse_matrix.hpp.

template<typename ValueType = double>
typedef int skylark::base::sparse_matrix_t< ValueType >::index_type

Definition at line 22 of file sparse_matrix.hpp.

template<typename ValueType = double>
typedef ValueType skylark::base::sparse_matrix_t< ValueType >::value_type

Definition at line 23 of file sparse_matrix.hpp.


Constructor & Destructor Documentation

template<typename ValueType = double>
skylark::base::sparse_matrix_t< ValueType >::sparse_matrix_t ( ) [inline]

Definition at line 28 of file sparse_matrix.hpp.

template<typename ValueType = double>
skylark::base::sparse_matrix_t< ValueType >::sparse_matrix_t ( sparse_matrix_t< ValueType > &&  A) [inline]

Definition at line 35 of file sparse_matrix.hpp.

template<typename ValueType = double>
skylark::base::sparse_matrix_t< ValueType >::~sparse_matrix_t ( ) [inline]

Definition at line 46 of file sparse_matrix.hpp.


Member Function Documentation

template<typename ValueType = double>
void skylark::base::sparse_matrix_t< ValueType >::attach ( const index_type indptr,
const index_type indices,
double *  values,
int  nnz,
int  n_rows,
int  n_cols,
bool  _own = false 
) [inline]
template<typename ValueType = double>
void skylark::base::sparse_matrix_t< ValueType >::attach ( const index_type indptr,
const index_type indices,
double *  values,
int  nnz,
int  n_rows,
int  n_cols,
bool  ownindptr,
bool  ownindices,
bool  ownvalues 
) [inline]

Attach new structure and values.

Definition at line 79 of file sparse_matrix.hpp.

References skylark::base::sparse_matrix_t< ValueType >::indices(), skylark::base::sparse_matrix_t< ValueType >::indptr(), and skylark::base::sparse_matrix_t< ValueType >::values().

Here is the call graph for this function:

template<typename ValueType = double>
template<typename IdxType , typename ValType >
void skylark::base::sparse_matrix_t< ValueType >::detach ( IdxType *  indptr,
IdxType *  indices,
ValType *  values 
) const [inline]

Copy data to external buffers.

Definition at line 57 of file sparse_matrix.hpp.

template<typename ValueType = double>
int skylark::base::sparse_matrix_t< ValueType >::height ( ) const [inline]
template<typename ValueType = double>
const index_type* skylark::base::sparse_matrix_t< ValueType >::indices ( ) const [inline]
template<typename ValueType = double>
const index_type* skylark::base::sparse_matrix_t< ValueType >::indptr ( ) const [inline]
template<typename ValueType = double>
const value_type* skylark::base::sparse_matrix_t< ValueType >::locked_values ( ) const [inline]
template<typename ValueType = double>
int skylark::base::sparse_matrix_t< ValueType >::nonzeros ( ) const [inline]

Definition at line 164 of file sparse_matrix.hpp.

Referenced by skylark::base::Transpose().

template<typename ValueType = double>
bool skylark::base::sparse_matrix_t< ValueType >::operator== ( const sparse_matrix_t< ValueType > &  rhs) const [inline]
template<typename ValueType = double>
void skylark::base::sparse_matrix_t< ValueType >::reset_update_flag ( ) [inline]

Definition at line 51 of file sparse_matrix.hpp.

template<typename ValueType = double>
void skylark::base::sparse_matrix_t< ValueType >::set ( coords_t  coords,
int  n_rows = 0,
int  n_cols = 0 
) [inline]
template<typename ValueType = double>
bool skylark::base::sparse_matrix_t< ValueType >::struct_updated ( ) const [inline]

Definition at line 50 of file sparse_matrix.hpp.

template<typename ValueType = double>
value_type* skylark::base::sparse_matrix_t< ValueType >::values ( ) [inline]
template<typename ValueType = double>
int skylark::base::sparse_matrix_t< ValueType >::width ( ) const [inline]

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