Public Types | Public Member Functions | Public Attributes | List of all members
ML::SimpleSparseMat< T, I > Struct Template Reference

#include <sparse.hpp>

Inheritance diagram for ML::SimpleSparseMat< T, I >:
Inheritance graph
Collaboration diagram for ML::SimpleSparseMat< T, I >:
Collaboration graph

Public Types

typedef SimpleMat< T > Super
 

Public Member Functions

 SimpleSparseMat ()
 
 SimpleSparseMat (T *values, I *cols, I *row_ids, I nnz, int m, int n)
 
void print (std::ostream &oss) const override
 
void operator= (const SimpleSparseMat< T, I > &other)=delete
 
void gemmb (const raft::handle_t &handle, const T alpha, const SimpleDenseMat< T > &A, const bool transA, const bool transB, const T beta, SimpleDenseMat< T > &C, cudaStream_t stream) const override
 
- Public Member Functions inherited from ML::SimpleMat< T >
 SimpleMat (int m, int n)
 
void operator= (const SimpleMat< T > &other)=delete
 

Public Attributes

T * values
 
I * cols
 
I * row_ids
 
nnz
 
- Public Attributes inherited from ML::SimpleMat< T >
int m
 
int n
 

Detailed Description

template<typename T, typename I = int>
struct ML::SimpleSparseMat< T, I >

Sparse matrix in CSR format.

Note, we use cuSPARSE to manimulate matrices, and it guarantees:

  1. row_ids[m] == nnz
  2. cols are sorted within rows.

However, when the data comes from the outside, we cannot guarantee that.

Member Typedef Documentation

◆ Super

template<typename T , typename I = int>
typedef SimpleMat<T> ML::SimpleSparseMat< T, I >::Super

Constructor & Destructor Documentation

◆ SimpleSparseMat() [1/2]

template<typename T , typename I = int>
ML::SimpleSparseMat< T, I >::SimpleSparseMat ( )
inline

◆ SimpleSparseMat() [2/2]

template<typename T , typename I = int>
ML::SimpleSparseMat< T, I >::SimpleSparseMat ( T *  values,
I *  cols,
I *  row_ids,
nnz,
int  m,
int  n 
)
inline

Member Function Documentation

◆ gemmb()

template<typename T , typename I = int>
void ML::SimpleSparseMat< T, I >::gemmb ( const raft::handle_t &  handle,
const T  alpha,
const SimpleDenseMat< T > &  A,
const bool  transA,
const bool  transB,
const T  beta,
SimpleDenseMat< T > &  C,
cudaStream_t  stream 
) const
inlineoverridevirtual

GEMM assigning to C where this refers to B.

C <- alpha * A^transA * (*this)^transB + beta * C

Implements ML::SimpleMat< T >.

◆ operator=()

template<typename T , typename I = int>
void ML::SimpleSparseMat< T, I >::operator= ( const SimpleSparseMat< T, I > &  other)
delete

◆ print()

template<typename T , typename I = int>
void ML::SimpleSparseMat< T, I >::print ( std::ostream &  oss) const
inlineoverridevirtual

Implements ML::SimpleMat< T >.

Member Data Documentation

◆ cols

template<typename T , typename I = int>
I* ML::SimpleSparseMat< T, I >::cols

◆ nnz

template<typename T , typename I = int>
I ML::SimpleSparseMat< T, I >::nnz

◆ row_ids

template<typename T , typename I = int>
I* ML::SimpleSparseMat< T, I >::row_ids

◆ values

template<typename T , typename I = int>
T* ML::SimpleSparseMat< T, I >::values

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