HMLP: High-performance Machine Learning Primitives
hmlp::SparseData< T, Allocator > Class Template Reference

#include <Data.hpp>

Inheritance diagram for hmlp::SparseData< T, Allocator >:
hmlp::ReadWrite

Public Member Functions

 SparseData (size_t m=0, size_t n=0, size_t nnz=0, bool issymmetric=true)
 
void Resize (size_t m, size_t n, size_t nnz, bool issymmetric)
 
void fromCSC (size_t m, size_t n, size_t nnz, bool issymmetric, const T *val, const size_t *row_ind, const size_t *col_ptr)
 
operator() (size_t i, size_t j) const
 
Data< T > operator() (const vector< size_t > &I, const vector< size_t > &J) const
 
size_t ColPtr (size_t j)
 
size_t RowInd (size_t offset)
 
Value (size_t offset)
 
pair< T, size_t > ImportantSample (size_t j)
 
void Print ()
 
template<bool LOWERTRIANGULAR, bool ISZEROBASE, bool IJONLY = false>
void readmtx (string &filename)
 Read matrix market format (ijv) format. Only lower triangular part is stored.
 
size_t row ()
 
size_t col ()
 
template<typename TINDEX >
double flops (TINDEX na, TINDEX nb)
 
- Public Member Functions inherited from hmlp::ReadWrite
 ReadWrite ()
 
void DependencyAnalysis (ReadWriteType type, Task *task)
 This is the key function that encode the dependency. More...
 
void DependencyCleanUp ()
 

Additional Inherited Members

- Public Attributes inherited from hmlp::ReadWrite
deque< Task * > read
 
deque< Task * > write
 

Detailed Description

template<typename T, class Allocator = std::allocator<T>>
class hmlp::SparseData< T, Allocator >

end class Data

Constructor & Destructor Documentation

template<typename T , class Allocator = std::allocator<T>>
hmlp::SparseData< T, Allocator >::SparseData ( size_t  m = 0,
size_t  n = 0,
size_t  nnz = 0,
bool  issymmetric = true 
)
inline

(Default) constructor.

Member Function Documentation

template<typename T , class Allocator = std::allocator<T>>
size_t hmlp::SparseData< T, Allocator >::ColPtr ( size_t  j)
inline

end operator ()

template<typename T , class Allocator = std::allocator<T>>
void hmlp::SparseData< T, Allocator >::fromCSC ( size_t  m,
size_t  n,
size_t  nnz,
bool  issymmetric,
const T *  val,
const size_t *  row_ind,
const size_t *  col_ptr 
)
inline

end Resize() Construct from three arrays: val[ nnz ],row_ind[ nnz ], and col_ptr[ n + 1 ].

template<typename T , class Allocator = std::allocator<T>>
T hmlp::SparseData< T, Allocator >::operator() ( size_t  i,
size_t  j 
) const
inline

end fromCSC() Retrive an element K( i, j ).

Early return if there is no nonzero entry in this column.

Search (BST) for row indices.

If the lower bound matches, then return the value.

Otherwise, return 0.

template<typename T , class Allocator = std::allocator<T>>
Data<T> hmlp::SparseData< T, Allocator >::operator() ( const vector< size_t > &  I,
const vector< size_t > &  J 
) const
inline

end operator () Retrive a subblock K( I, J ).

Evaluate Kij element by element.

Return submatrix KIJ.

template<typename T , class Allocator = std::allocator<T>>
void hmlp::SparseData< T, Allocator >::Resize ( size_t  m,
size_t  n,
size_t  nnz,
bool  issymmetric 
)
inline

Adjust the storage size.


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