monolish  0.14.0
MONOlithic LIner equation Solvers for Highly-parallel architecture
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
monolish::matrix::COO< Float > Class Template Reference

Coodinate (COO) format Matrix (need to sort) More...

#include <monolish_coo.hpp>

Collaboration diagram for monolish::matrix::COO< Float >:
Collaboration graph

Public Member Functions

Float at (const size_t i, const size_t j)
 Get matrix element (A(i,j)) More...
 
Float at (const size_t i, const size_t j) const
 Get matrix element (A(i,j)) More...
 
void col (const size_t c, vector< Float > &vec) const
 get column vector More...
 
void col (const size_t c, view1D< matrix::Dense< Float >, Float > &vec) const
 
void col (const size_t c, view1D< vector< Float >, Float > &vec) const
 
void convert (const matrix::CRS< Float > &crs)
 Create COO matrix from CRS matrix. More...
 
void convert (const matrix::Dense< Float > &dense)
 Create COO matrix from Dense matrix. More...
 
void convert (const matrix::LinearOperator< Float > &linearoperator)
 
 COO ()
 
 COO (const matrix::COO< Float > &coo)
 Create COO matrix from COO matrix. More...
 
 COO (const matrix::CRS< Float > &crs)
 Create COO matrix from CRS matrix. More...
 
 COO (const matrix::Dense< Float > &dense)
 Create COO matrix from Dense matrix. More...
 
 COO (const matrix::LinearOperator< Float > &linearoperator)
 
 COO (const size_t M, const size_t N)
 Initialize M x N COO matrix. More...
 
 COO (const size_t M, const size_t N, const size_t NNZ, const int *row, const int *col, const Float *value)
 Create COO matrix from array. More...
 
 COO (const size_t M, const size_t N, const size_t NNZ, const int *row, const int *col, const Float *value, const size_t origin)
 Create COO matrix from n-origin array. More...
 
 COO (const size_t M, const size_t N, const size_t NNZ, const std::vector< int > &row, const std::vector< int > &col, const std::vector< Float > &value)
 Create COO matrix from std::vector. More...
 
 COO (const size_t M, const size_t N, const size_t NNZ, const std::vector< int > &row, const std::vector< int > &col, const std::vector< Float > &value, const size_t origin)
 Create COO matrix from n-origin array. More...
 
 COO (const size_t M, const size_t N, const size_t NNZ, const std::vector< int > &row, const std::vector< int > &col, const vector< Float > &value)
 Create COO matrix from monolish::vector. More...
 
 COO (const std::string filename)
 Create COO matrix from MatrixMatrket format file (only real general) (MatrixMarket format: https://math.nist.gov/MatrixMarket/formats.html) More...
 
void device_free () const
 free data on GPU More...
 
void diag (vector< Float > &vec) const
 get diag. vector More...
 
void diag (view1D< matrix::Dense< Float >, Float > &vec) const
 
void diag (view1D< vector< Float >, Float > &vec) const
 
bool equal (const COO< Float > &mat, bool compare_cpu_and_device=false) const
 Comparing matricies (A == mat) More...
 
void fill (Float value)
 fill matrix elements with a scalar value More...
 
size_t get_col () const
 get # of col More...
 
std::vector< int > & get_col_ind ()
 get column index More...
 
const std::vector< int > & get_col_ind () const
 get column index More...
 
double get_data_size () const
 Memory data space required by the matrix. More...
 
bool get_device_mem_stat () const
 false; // true: sended, false: not send More...
 
size_t get_nnz () const
 get # of non-zeros More...
 
size_t get_row () const
 get # of row More...
 
std::vector< int > & get_row_ptr ()
 get row index More...
 
const std::vector< int > & get_row_ptr () const
 get row index More...
 
std::vector< Float > & get_val_ptr ()
 get value More...
 
const std::vector< Float > & get_val_ptr () const
 get value More...
 
void input_mm (const std::string filename)
 Create COO matrix from MatrixMatrket format file (only real general) (MatrixMarket format: https://math.nist.gov/MatrixMarket/formats.html) More...
 
void insert (const size_t m, const size_t n, const Float val)
 insert element to (m, n) More...
 
bool operator!= (const COO< Float > &mat) const
 Comparing matricies (A != mat) More...
 
void operator= (const COO< Float > &mat)
 matrix copy More...
 
bool operator== (const COO< Float > &mat) const
 Comparing matricies (A == mat) More...
 
void output_mm (const std::string filename) const
 output matrix elements in MatrixMarket format (MatrixMarket format: https://math.nist.gov/MatrixMarket/formats.html) More...
 
void print_all (bool force_cpu=false) const
 print all elements to standard I/O More...
 
void print_all (const std::string filename) const
 print all elements to file More...
 
void recv () const
 recv data from GPU More...
 
void row (const size_t r, vector< Float > &vec) const
 get row vector More...
 
void row (const size_t r, view1D< matrix::Dense< Float >, Float > &vec) const
 
void row (const size_t r, view1D< vector< Float >, Float > &vec) const
 
void send () const
 send data to GPU More...
 
void set_col (const size_t N)
 Set col number. More...
 
void set_nnz (const size_t NNZ)
 Set # of non-zero elements. More...
 
void set_ptr (const size_t rN, const size_t cN, const std::vector< int > &r, const std::vector< int > &c, const std::vector< Float > &v)
 Set COO array from std::vector. More...
 
void set_row (const size_t M)
 Set row number. More...
 
void sort (bool merge)
 sort COO matrix elements (and merge elements) More...
 
COOtranspose ()
 get transposed matrix (A^T) More...
 
void transpose (COO &B) const
 create transposed matrix from COO matrix (A = B^T) More...
 
std::string type () const
 get format name "COO" More...
 
 ~COO ()
 ; free gpu mem. More...
 

Public Attributes

std::vector< int > col_index
 Coodinate format column index, which stores column numbers of the non-zero elements (size nnz) More...
 
std::vector< int > row_index
 Coodinate format row index, which stores row numbers of the non-zero elements (size nnz) More...
 
std::vector< Float > val
 Coodinate format value array, which stores values of the non-zero elements (size nnz) More...
 

Private Member Functions

void _q_sort (int lo, int hi)
 

Private Attributes

size_t colN
 # of col More...
 
bool gpu_status = false
 true: sended, false: not send More...
 
size_t nnz
 # of non-zero element More...
 
size_t rowN
 # of row More...
 

Detailed Description

template<typename Float>
class monolish::matrix::COO< Float >

Coodinate (COO) format Matrix (need to sort)

Note
  • Multi-threading: true
  • GPU acceleration: false

Definition at line 38 of file monolish_coo.hpp.

Constructor & Destructor Documentation

◆ COO() [1/12]

template<typename Float >
monolish::matrix::COO< Float >::COO ( )
inline

Definition at line 79 of file monolish_coo.hpp.

Here is the caller graph for this function:

◆ COO() [2/12]

template<typename Float >
monolish::matrix::COO< Float >::COO ( const size_t  M,
const size_t  N 
)
inline

Initialize M x N COO matrix.

Parameters
M# of row
N# of col
Note
  • # of computation: 0
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 92 of file monolish_coo.hpp.

◆ COO() [3/12]

template<typename Float >
monolish::matrix::COO< Float >::COO ( const size_t  M,
const size_t  N,
const size_t  NNZ,
const int *  row,
const int *  col,
const Float *  value 
)

Create COO matrix from array.

Parameters
M# of row
N# of col
NNZ# of non-zero elements
rowrow index, which stores the row numbers of the non-zero elements (size nnz)
colcol index, which stores the column numbers of the non-zero elements (size nnz)
valuevalue index, which stores the non-zero elements (size nnz)
Note
  • # of computation: 3nnz
  • Multi-threading: false
  • GPU acceleration: false

◆ COO() [4/12]

template<typename Float >
monolish::matrix::COO< Float >::COO ( const size_t  M,
const size_t  N,
const size_t  NNZ,
const std::vector< int > &  row,
const std::vector< int > &  col,
const std::vector< Float > &  value 
)
inline

Create COO matrix from std::vector.

Parameters
M# of row
N# of col
NNZ# of non-zero elements
rowrow index, which stores the row numbers of the non-zero elements (size nnz)
colcol index, which stores the column numbers of the non-zero elements (size nnz)
valuevalue index, which stores the non-zero elements (size nnz)
Note
  • # of computation: 3nnz
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 129 of file monolish_coo.hpp.

Here is the call graph for this function:

◆ COO() [5/12]

template<typename Float >
monolish::matrix::COO< Float >::COO ( const size_t  M,
const size_t  N,
const size_t  NNZ,
const std::vector< int > &  row,
const std::vector< int > &  col,
const vector< Float > &  value 
)
inline

Create COO matrix from monolish::vector.

Parameters
M# of row
N# of col
NNZ# of non-zero elements
rowrow index, which stores the row numbers of the non-zero elements (size nnz)
colcol index, which stores the column numbers of the non-zero elements (size nnz)
valuevalue index, which stores the non-zero elements (size nnz)
Note
  • # of computation: 3nnz
  • Multi-threading: false
  • GPU acceleration: false
Warning
gpu_status of input vectors must be false

Definition at line 152 of file monolish_coo.hpp.

Here is the call graph for this function:

◆ COO() [6/12]

template<typename Float >
monolish::matrix::COO< Float >::COO ( const size_t  M,
const size_t  N,
const size_t  NNZ,
const int *  row,
const int *  col,
const Float *  value,
const size_t  origin 
)

Create COO matrix from n-origin array.

Parameters
M# of row
N# of col
NNZ# of non-zero elements
rown-origin row index, which stores the row numbers of the non-zero elements (size nnz)
coln-origin col index, which stores the column numbers of the non-zero elements (size nnz)
valuen-origin value index, which stores the non-zero elements (size nnz)
originn-origin
Note
  • # of computation: 3nnz + 2nnz(adjust possition using origin)
  • Multi-threading: true
  • GPU acceleration: false

◆ COO() [7/12]

template<typename Float >
monolish::matrix::COO< Float >::COO ( const size_t  M,
const size_t  N,
const size_t  NNZ,
const std::vector< int > &  row,
const std::vector< int > &  col,
const std::vector< Float > &  value,
const size_t  origin 
)
inline

Create COO matrix from n-origin array.

Parameters
M# of row
N# of col
NNZ# of non-zero elements
rown-origin row index, which stores the row numbers of the non-zero elements (size nnz)
coln-origin col index, which stores the column numbers of the non-zero elements (size nnz)
valuen-origin value index, which stores the non-zero elements (size nnz)
originn-origin
Note
  • # of computation: 3nnz + 2nnz(adjust possition using origin)
  • Multi-threading: true
  • GPU acceleration: false

Definition at line 196 of file monolish_coo.hpp.

Here is the call graph for this function:

◆ COO() [8/12]

template<typename Float >
monolish::matrix::COO< Float >::COO ( const matrix::COO< Float > &  coo)

Create COO matrix from COO matrix.

Parameters
cooinput COO matrix
Note
  • # of computation: 3nnz
  • Multi-threading: false
  • GPU acceleration: false

◆ COO() [9/12]

template<typename Float >
monolish::matrix::COO< Float >::COO ( const matrix::CRS< Float > &  crs)
inline

Create COO matrix from CRS matrix.

Parameters
crsinput COO matrix
Note
  • # of computation: 3nnz
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 230 of file monolish_coo.hpp.

Here is the call graph for this function:

◆ COO() [10/12]

template<typename Float >
monolish::matrix::COO< Float >::COO ( const matrix::Dense< Float > &  dense)
inline

Create COO matrix from Dense matrix.

Parameters
denseinput Dense matrix (size M x N)
Note
  • # of computation: 3NM
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 250 of file monolish_coo.hpp.

Here is the call graph for this function:

◆ COO() [11/12]

template<typename Float >
monolish::matrix::COO< Float >::COO ( const matrix::LinearOperator< Float > &  linearoperator)
inline

Definition at line 254 of file monolish_coo.hpp.

Here is the call graph for this function:

◆ ~COO()

template<typename Float >
monolish::matrix::COO< Float >::~COO ( )
inline

; free gpu mem.

Warning
COO format can not use GPU function

Definition at line 328 of file monolish_coo.hpp.

Here is the call graph for this function:

◆ COO() [12/12]

template<typename Float >
monolish::matrix::COO< Float >::COO ( const std::string  filename)
inline

Create COO matrix from MatrixMatrket format file (only real general) (MatrixMarket format: https://math.nist.gov/MatrixMarket/formats.html)

Parameters
filenameMatrixMarket format file name
Note
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 355 of file monolish_coo.hpp.

Here is the call graph for this function:

Member Function Documentation

◆ _q_sort()

template<typename T >
template void monolish::matrix::COO< Float >::_q_sort ( int  lo,
int  hi 
)
private

Definition at line 48 of file at_insert_sort_coo.cpp.

◆ at() [1/2]

template<typename Float >
Float monolish::matrix::COO< Float >::at ( const size_t  i,
const size_t  j 
)
inline

Get matrix element (A(i,j))

Note
  • # of computation: i*M+j
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 403 of file monolish_coo.hpp.

Here is the call graph for this function:

◆ at() [2/2]

template<typename T >
template float monolish::matrix::COO< Float >::at ( const size_t  i,
const size_t  j 
) const

Get matrix element (A(i,j))

Note
  • # of computation: i*M+j
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 9 of file at_insert_sort_coo.cpp.

Here is the caller graph for this function:

◆ col() [1/3]

template<typename Float >
void monolish::matrix::COO< Float >::col ( const size_t  c,
vector< Float > &  vec 
) const

get column vector

Parameters
ccolumn number
veccolumn vector
Note
  • # of computation: nnz
  • Multi-threading: false
  • GPU acceleration: false
Here is the caller graph for this function:

◆ col() [2/3]

template<typename Float >
void monolish::matrix::COO< Float >::col ( const size_t  c,
view1D< matrix::Dense< Float >, Float > &  vec 
) const

◆ col() [3/3]

template<typename Float >
void monolish::matrix::COO< Float >::col ( const size_t  c,
view1D< vector< Float >, Float > &  vec 
) const

◆ convert() [1/3]

template<typename Float >
void monolish::matrix::COO< Float >::convert ( const matrix::CRS< Float > &  crs)

Create COO matrix from CRS matrix.

Parameters
crsinput COO matrix
Note
  • # of computation: 3nnz
  • Multi-threading: false
  • GPU acceleration: false
Here is the caller graph for this function:

◆ convert() [2/3]

template<typename Float >
void monolish::matrix::COO< Float >::convert ( const matrix::Dense< Float > &  dense)

Create COO matrix from Dense matrix.

Parameters
denseinput Dense matrix (size M x N)
Note
  • # of computation: 3NM
  • Multi-threading: false
  • GPU acceleration: false

◆ convert() [3/3]

template<typename Float >
void monolish::matrix::COO< Float >::convert ( const matrix::LinearOperator< Float > &  linearoperator)

◆ device_free()

template<typename Float >
void monolish::matrix::COO< Float >::device_free ( ) const
inline

free data on GPU

Warning
COO format can not use GPU function

Definition at line 313 of file monolish_coo.hpp.

Here is the caller graph for this function:

◆ diag() [1/3]

template<typename Float >
void monolish::matrix::COO< Float >::diag ( vector< Float > &  vec) const

get diag. vector

Parameters
vecdiag. vector
Note
  • # of computation: nnz
  • Multi-threading: false
  • GPU acceleration: false

◆ diag() [2/3]

template<typename Float >
void monolish::matrix::COO< Float >::diag ( view1D< matrix::Dense< Float >, Float > &  vec) const

◆ diag() [3/3]

template<typename Float >
void monolish::matrix::COO< Float >::diag ( view1D< vector< Float >, Float > &  vec) const

◆ equal()

template<typename Float >
template bool monolish::matrix::COO< Float >::equal ( const COO< Float > &  mat,
bool  compare_cpu_and_device = false 
) const

Comparing matricies (A == mat)

Parameters
matCOO matrix
compare_cpu_and_deviceUnused options for integrity
Returns
true or false
Note
  • # of computation: 3nnz
  • Multi-threading: true
  • GPU acceleration: false

Definition at line 10 of file compare_coo.cpp.

Here is the call graph for this function:

◆ fill()

template<typename Float >
template void monolish::matrix::COO< Float >::fill ( Float  value)

fill matrix elements with a scalar value

Parameters
valuescalar value
Note
  • # of computation: N
  • Multi-threading: true
  • GPU acceleration: true

Definition at line 9 of file fill_coo.cpp.

Here is the call graph for this function:

◆ get_col()

template<typename Float >
size_t monolish::matrix::COO< Float >::get_col ( ) const
inline

get # of col

Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 438 of file monolish_coo.hpp.

Here is the caller graph for this function:

◆ get_col_ind() [1/2]

template<typename Float >
std::vector<int>& monolish::matrix::COO< Float >::get_col_ind ( )
inline

get column index

Returns
column index
Note
  • # of computation: nnz
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 477 of file monolish_coo.hpp.

◆ get_col_ind() [2/2]

template<typename Float >
const std::vector<int>& monolish::matrix::COO< Float >::get_col_ind ( ) const
inline

get column index

Returns
column index
Note
  • # of computation: nnz
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 507 of file monolish_coo.hpp.

◆ get_data_size()

template<typename Float >
double monolish::matrix::COO< Float >::get_data_size ( ) const
inline

Memory data space required by the matrix.

Note
  • # of computation: 3
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 549 of file monolish_coo.hpp.

Here is the call graph for this function:

◆ get_device_mem_stat()

template<typename Float >
bool monolish::matrix::COO< Float >::get_device_mem_stat ( ) const
inline

false; // true: sended, false: not send

Returns
true is sended.
Warning
COO format can not use GPU function

Definition at line 321 of file monolish_coo.hpp.

Here is the caller graph for this function:

◆ get_nnz()

template<typename Float >
size_t monolish::matrix::COO< Float >::get_nnz ( ) const
inline

get # of non-zeros

Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 447 of file monolish_coo.hpp.

Here is the caller graph for this function:

◆ get_row()

template<typename Float >
size_t monolish::matrix::COO< Float >::get_row ( ) const
inline

get # of row

Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 429 of file monolish_coo.hpp.

Here is the caller graph for this function:

◆ get_row_ptr() [1/2]

template<typename Float >
std::vector<int>& monolish::matrix::COO< Float >::get_row_ptr ( )
inline

get row index

Returns
row index
Note
  • # of computation: nnz
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 467 of file monolish_coo.hpp.

◆ get_row_ptr() [2/2]

template<typename Float >
const std::vector<int>& monolish::matrix::COO< Float >::get_row_ptr ( ) const
inline

get row index

Returns
row index
Note
  • # of computation: nnz
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 497 of file monolish_coo.hpp.

◆ get_val_ptr() [1/2]

template<typename Float >
std::vector<Float>& monolish::matrix::COO< Float >::get_val_ptr ( )
inline

get value

Returns
velue
Note
  • # of computation: nnz
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 487 of file monolish_coo.hpp.

◆ get_val_ptr() [2/2]

template<typename Float >
const std::vector<Float>& monolish::matrix::COO< Float >::get_val_ptr ( ) const
inline

get value

Returns
velue
Note
  • # of computation: nnz
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 517 of file monolish_coo.hpp.

◆ input_mm()

template<typename T >
template void monolish::matrix::COO< Float >::input_mm ( const std::string  filename)

Create COO matrix from MatrixMatrket format file (only real general) (MatrixMarket format: https://math.nist.gov/MatrixMarket/formats.html)

Parameters
filenameMatrixMarket format file name
Note
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 68 of file IO_coo.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ insert()

template<typename Float >
template void monolish::matrix::COO< Float >::insert ( const size_t  m,
const size_t  n,
const Float  val 
)

insert element to (m, n)

Parameters
mrow number
ncol number
valmatrix value (if multiple element exists, value will be added together)
Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false
Warning
This function does not check for duplicate values. This adds an element to the end of the array. In most cases, calling sort() is required after this function.

Definition at line 30 of file at_insert_sort_coo.cpp.

Here is the caller graph for this function:

◆ operator!=()

template<typename Float >
template bool monolish::matrix::COO< Float >::operator!= ( const COO< Float > &  mat) const

Comparing matricies (A != mat)

Parameters
matCOO matrix
Returns
true or false
Note
  • # of computation: 3nnz
  • Multi-threading: true
  • GPU acceleration: false

Definition at line 83 of file compare_coo.cpp.

Here is the call graph for this function:

◆ operator=()

template<typename Float >
void monolish::matrix::COO< T >::operator= ( const COO< Float > &  mat)

matrix copy

Parameters
matCOO matrix
Note
  • # of computation: 3nnz
  • Multi-threading: false
  • GPU acceleration: false
Warning
src. and dst. must be same non-zero structure (dont check in this function)

Definition at line 10 of file copy_coo.cpp.

Here is the call graph for this function:

◆ operator==()

template<typename Float >
template bool monolish::matrix::COO< Float >::operator== ( const COO< Float > &  mat) const

Comparing matricies (A == mat)

Parameters
matCOO matrix
Returns
true or false
Note
  • # of computation: 3nnz
  • Multi-threading: true
  • GPU acceleration: false

Definition at line 71 of file compare_coo.cpp.

Here is the call graph for this function:

◆ output_mm()

template<typename T >
template void monolish::matrix::COO< Float >::output_mm ( const std::string  filename) const

output matrix elements in MatrixMarket format (MatrixMarket format: https://math.nist.gov/MatrixMarket/formats.html)

Parameters
filenameMatrixMarket format file name
Note
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 48 of file IO_coo.cpp.

Here is the call graph for this function:

◆ print_all() [1/2]

template<typename T >
template void monolish::matrix::COO< Float >::print_all ( bool  force_cpu = false) const

print all elements to standard I/O

Parameters
force_cpuUnused options for integrity
Note
  • # of computation: 3nnz
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 17 of file IO_coo.cpp.

Here is the call graph for this function:

◆ print_all() [2/2]

template<typename T >
template void monolish::matrix::COO< Float >::print_all ( const std::string  filename) const

print all elements to file

Parameters
filenameoutput filename
Note
  • # of computation: 3nnz
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 32 of file IO_coo.cpp.

Here is the call graph for this function:

◆ recv()

template<typename Float >
void monolish::matrix::COO< Float >::recv ( ) const
inline

recv data from GPU

Warning
COO format can not use GPU function

Definition at line 304 of file monolish_coo.hpp.

◆ row() [1/3]

template<typename Float >
void monolish::matrix::COO< Float >::row ( const size_t  r,
vector< Float > &  vec 
) const

get row vector

Parameters
rrow number
vecrow vector
Note
  • # of computation: nnz
  • Multi-threading: false
  • GPU acceleration: false
Here is the caller graph for this function:

◆ row() [2/3]

template<typename Float >
void monolish::matrix::COO< Float >::row ( const size_t  r,
view1D< matrix::Dense< Float >, Float > &  vec 
) const

◆ row() [3/3]

template<typename Float >
void monolish::matrix::COO< Float >::row ( const size_t  r,
view1D< vector< Float >, Float > &  vec 
) const

◆ send()

template<typename Float >
void monolish::matrix::COO< Float >::send ( ) const
inline

send data to GPU

Warning
COO format can not use GPU function

Definition at line 295 of file monolish_coo.hpp.

◆ set_col()

template<typename Float >
void monolish::matrix::COO< Float >::set_col ( const size_t  N)
inline

Set col number.

Parameters
N# of col
Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 276 of file monolish_coo.hpp.

Here is the caller graph for this function:

◆ set_nnz()

template<typename Float >
void monolish::matrix::COO< Float >::set_nnz ( const size_t  NNZ)
inline

Set # of non-zero elements.

Parameters
NNZ# of non-zero elements
Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 286 of file monolish_coo.hpp.

Here is the caller graph for this function:

◆ set_ptr()

template<typename Float >
template void monolish::matrix::COO< Float >::set_ptr ( const size_t  rN,
const size_t  cN,
const std::vector< int > &  r,
const std::vector< int > &  c,
const std::vector< Float > &  v 
)

Set COO array from std::vector.

Parameters
rN# of row
cN# of column
rrow_index
ccol_index
vvalue
Note
  • # of computation: 3
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 26 of file copy_coo.cpp.

Here is the call graph for this function:

◆ set_row()

template<typename Float >
void monolish::matrix::COO< Float >::set_row ( const size_t  M)
inline

Set row number.

Parameters
M# of row
Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 266 of file monolish_coo.hpp.

Here is the caller graph for this function:

◆ sort()

template<typename T >
template void monolish::matrix::COO< Float >::sort ( bool  merge)

sort COO matrix elements (and merge elements)

Parameters
mergeneet to merge (true or false)
Note
  • # of computation: 3nnz x log(3nnz) ~ 3nnz^2
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 108 of file at_insert_sort_coo.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ transpose() [1/2]

template<typename T >
template COO< float > & monolish::matrix::COO< Float >::transpose ( )

get transposed matrix (A^T)

Returns
tranposed matrix A^T
Note
  • # of computation: 2
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 9 of file transpose_coo.cpp.

Here is the call graph for this function:

◆ transpose() [2/2]

template<typename T >
template void monolish::matrix::COO< Float >::transpose ( COO< Float > &  B) const

create transposed matrix from COO matrix (A = B^T)

Parameters
BCOO matrix
Note
  • # of computation: 3 * nnz
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 21 of file transpose_coo.cpp.

Here is the call graph for this function:

◆ type()

template<typename Float >
std::string monolish::matrix::COO< Float >::type ( ) const
inline

get format name "COO"

Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 560 of file monolish_coo.hpp.

Member Data Documentation

◆ col_index

template<typename Float >
std::vector<int> monolish::matrix::COO< Float >::col_index

Coodinate format column index, which stores column numbers of the non-zero elements (size nnz)

Definition at line 71 of file monolish_coo.hpp.

◆ colN

template<typename Float >
size_t monolish::matrix::COO< Float >::colN
private

# of col

Definition at line 48 of file monolish_coo.hpp.

◆ gpu_status

template<typename Float >
bool monolish::matrix::COO< Float >::gpu_status = false
mutableprivate

true: sended, false: not send

Definition at line 58 of file monolish_coo.hpp.

◆ nnz

template<typename Float >
size_t monolish::matrix::COO< Float >::nnz
private

# of non-zero element

Definition at line 53 of file monolish_coo.hpp.

◆ row_index

template<typename Float >
std::vector<int> monolish::matrix::COO< Float >::row_index

Coodinate format row index, which stores row numbers of the non-zero elements (size nnz)

Definition at line 65 of file monolish_coo.hpp.

◆ rowN

template<typename Float >
size_t monolish::matrix::COO< Float >::rowN
private

# of row

Definition at line 43 of file monolish_coo.hpp.

◆ val

template<typename Float >
std::vector<Float> monolish::matrix::COO< Float >::val

Coodinate format value array, which stores values of the non-zero elements (size nnz)

Definition at line 77 of file monolish_coo.hpp.


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