Skylark (Sketching Library)
0.1
|
#include <sparse_matrix.hpp>
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_type * | indptr () const |
const index_type * | indices () const |
value_type * | values () |
const value_type * | locked_values () const |
bool | operator== (const sparse_matrix_t &rhs) const |
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.
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.
typedef std::vector<coord_tuple_t> skylark::base::sparse_matrix_t< ValueType >::coords_t |
Definition at line 26 of file sparse_matrix.hpp.
typedef int skylark::base::sparse_matrix_t< ValueType >::index_type |
Definition at line 22 of file sparse_matrix.hpp.
typedef ValueType skylark::base::sparse_matrix_t< ValueType >::value_type |
Definition at line 23 of file sparse_matrix.hpp.
skylark::base::sparse_matrix_t< ValueType >::sparse_matrix_t | ( | ) | [inline] |
Definition at line 28 of file sparse_matrix.hpp.
skylark::base::sparse_matrix_t< ValueType >::sparse_matrix_t | ( | sparse_matrix_t< ValueType > && | A | ) | [inline] |
Definition at line 35 of file sparse_matrix.hpp.
skylark::base::sparse_matrix_t< ValueType >::~sparse_matrix_t | ( | ) | [inline] |
Definition at line 46 of file sparse_matrix.hpp.
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] |
Attach new structure and values.
Definition at line 71 of file sparse_matrix.hpp.
Referenced by skylark::base::ColumnView(), read_libsvm(), skylark::base::sparse_matrix_t< ValueType >::set(), sl_wrap_raw_sp_matrix(), and skylark::base::Transpose().
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().
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.
int skylark::base::sparse_matrix_t< ValueType >::height | ( | ) | const [inline] |
Definition at line 156 of file sparse_matrix.hpp.
Referenced by skylark::base::ColumnView(), skylark::base::Height(), and skylark::base::Transpose().
const index_type* skylark::base::sparse_matrix_t< ValueType >::indices | ( | ) | const [inline] |
const index_type* skylark::base::sparse_matrix_t< ValueType >::indptr | ( | ) | const [inline] |
const value_type* skylark::base::sparse_matrix_t< ValueType >::locked_values | ( | ) | const [inline] |
Definition at line 180 of file sparse_matrix.hpp.
Referenced by skylark::base::sparse_matrix_t< ValueType >::operator==(), and skylark::base::Transpose().
int skylark::base::sparse_matrix_t< ValueType >::nonzeros | ( | ) | const [inline] |
Definition at line 164 of file sparse_matrix.hpp.
Referenced by skylark::base::Transpose().
bool skylark::base::sparse_matrix_t< ValueType >::operator== | ( | const sparse_matrix_t< ValueType > & | rhs | ) | const [inline] |
Definition at line 184 of file sparse_matrix.hpp.
References skylark::base::sparse_matrix_t< ValueType >::indices(), skylark::base::sparse_matrix_t< ValueType >::indptr(), skylark::base::sparse_matrix_t< ValueType >::locked_values(), skylark::base::sparse_matrix_t< ValueType >::values(), and skylark::base::sparse_matrix_t< ValueType >::width().
void skylark::base::sparse_matrix_t< ValueType >::reset_update_flag | ( | ) | [inline] |
Definition at line 51 of file sparse_matrix.hpp.
void skylark::base::sparse_matrix_t< ValueType >::set | ( | coords_t | coords, |
int | n_rows = 0 , |
||
int | n_cols = 0 |
||
) | [inline] |
Definition at line 101 of file sparse_matrix.hpp.
References skylark::base::sparse_matrix_t< ValueType >::attach(), skylark::base::sparse_matrix_t< ValueType >::indices(), skylark::base::sparse_matrix_t< ValueType >::indptr(), max(), and skylark::base::sparse_matrix_t< ValueType >::values().
bool skylark::base::sparse_matrix_t< ValueType >::struct_updated | ( | ) | const [inline] |
Definition at line 50 of file sparse_matrix.hpp.
value_type* skylark::base::sparse_matrix_t< ValueType >::values | ( | ) | [inline] |
Definition at line 176 of file sparse_matrix.hpp.
Referenced by skylark::base::sparse_matrix_t< ValueType >::attach(), skylark::base::ColumnView(), skylark::base::sparse_matrix_t< ValueType >::operator==(), and skylark::base::sparse_matrix_t< ValueType >::set().
int skylark::base::sparse_matrix_t< ValueType >::width | ( | ) | const [inline] |
Definition at line 160 of file sparse_matrix.hpp.
Referenced by skylark::base::sparse_matrix_t< ValueType >::operator==(), skylark::base::Transpose(), and skylark::base::Width().