monolish
0.14.0
MONOlithic LIner equation Solvers for Highly-parallel architecture
|
#include <monolish_coo.hpp>
Public Member Functions | |
Float | at (const size_t i, const size_t j) |
get element A[i][j] (only CPU) More... | |
Float | at (const size_t i, const size_t j) const |
get 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 COO< Float > &coo) |
Create Dense matrix from COO matrix. More... | |
void | convert (const Dense< Float > &dense) |
Create Dense matrix from Dense matrix. More... | |
Dense () | |
Dense (const COO< Float > &coo) | |
Create dense matrix from COO matrix. More... | |
Dense (const Dense< Float > &dense) | |
Create Dense matrix from Dense matrix. More... | |
Dense (const size_t M, const size_t N) | |
Allocate dense matrix. More... | |
Dense (const size_t M, const size_t N, const Float *value) | |
Create dense matrix from array. More... | |
Dense (const size_t M, const size_t N, const Float min, const Float max) | |
Create random dense matrix from dense matrix. More... | |
Dense (const size_t M, const size_t N, const Float value) | |
Create construct dense matrix. More... | |
Dense (const size_t M, const size_t N, const std::initializer_list< Float > &list) | |
Create dense matrix from std::initializer_list. More... | |
Dense (const size_t M, const size_t N, const std::vector< Float > &value) | |
Create dense matrix from std::vector. More... | |
Dense (const size_t M, const size_t N, const vector< Float > &value) | |
Create dense matrix from monolish::vector. 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 |
void | diag_add (const Float alpha) |
Scalar and diag. vector of dense matrix add. More... | |
void | diag_add (const vector< Float > &vec) |
Vector and diag. vector of dense matrix add. More... | |
void | diag_add (const view1D< matrix::Dense< Float >, Float > &vec) |
void | diag_add (const view1D< vector< Float >, Float > &vec) |
void | diag_div (const Float alpha) |
Scalar and diag. vector of dense matrix div. More... | |
void | diag_div (const vector< Float > &vec) |
Vector and diag. vector of dense matrix div. More... | |
void | diag_div (const view1D< matrix::Dense< Float >, Float > &vec) |
void | diag_div (const view1D< vector< Float >, Float > &vec) |
void | diag_mul (const Float alpha) |
Scalar and diag. vector of dense matrix mul. More... | |
void | diag_mul (const vector< Float > &vec) |
Vector and diag. vector of dense matrix mul. More... | |
void | diag_mul (const view1D< matrix::Dense< Float >, Float > &vec) |
void | diag_mul (const view1D< vector< Float >, Float > &vec) |
void | diag_sub (const Float alpha) |
Scalar and diag. vector of dense matrix sub. More... | |
void | diag_sub (const vector< Float > &vec) |
Vector and diag. vector of dense matrix sub. More... | |
void | diag_sub (const view1D< matrix::Dense< Float >, Float > &vec) |
void | diag_sub (const view1D< vector< Float >, Float > &vec) |
bool | equal (const Dense< 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... | |
double | get_data_size () const |
Memory data space required by the matrix. More... | |
bool | get_device_mem_stat () const |
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... | |
void | insert (const size_t i, const size_t j, const Float Val) |
get element A[i][j] More... | |
void | nonfree_recv () |
recv. data to GPU (w/o free) More... | |
bool | operator!= (const Dense< Float > &mat) const |
Comparing matricies (A != mat) More... | |
void | operator= (const Dense< Float > &mat) |
matrix copy More... | |
bool | operator== (const Dense< Float > &mat) const |
Comparing matricies (A == mat) More... | |
void | print_all (bool force_cpu=false) const |
print all elements to standard I/O More... | |
void | recv () |
recv. data to GPU, and free data on 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 M) |
Set column number. More... | |
void | set_nnz (const size_t NZ) |
Set # of non-zero elements. More... | |
void | set_ptr (const size_t M, const size_t N, const std::vector< Float > &value) |
Set Dense array from std::vector. More... | |
void | set_row (const size_t N) |
Set row number. More... | |
Dense & | transpose () |
get transposed matrix (A^T) More... | |
void | transpose (const Dense &B) |
create transposed matrix from COO matrix (A = B^T) More... | |
std::string | type () const |
get format name "Dense" More... | |
~Dense () | |
destructor of CRS matrix, free GPU memory More... | |
Public Attributes | |
std::vector< Float > | val |
Dense format value(size M x N) More... | |
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 (M * N) More... | |
size_t | rowN |
# of row More... | |
Dense format Matrix.
Definition at line 28 of file monolish_coo.hpp.
|
inline |
Definition at line 49 of file monolish_dense.hpp.
|
inline |
Create dense matrix from COO matrix.
coo | input COO matrix (size M x N) |
Definition at line 79 of file monolish_dense.hpp.
monolish::matrix::Dense< Float >::Dense | ( | const Dense< Float > & | dense | ) |
template monolish::matrix::Dense< Float >::Dense | ( | const size_t | M, |
const size_t | N | ||
) |
Allocate dense matrix.
M | # of row |
N | # of col |
Definition at line 12 of file dense_constructor.cpp.
monolish::matrix::Dense< Float >::Dense | ( | const size_t | M, |
const size_t | N, | ||
const Float * | value | ||
) |
Create dense matrix from array.
M | # of row |
N | # of col |
value | value array |
monolish::matrix::Dense< Float >::Dense | ( | const size_t | M, |
const size_t | N, | ||
const std::vector< Float > & | value | ||
) |
Create dense matrix from std::vector.
M | # of row |
N | # of col |
value | value std::vector (size M x N) |
monolish::matrix::Dense< Float >::Dense | ( | const size_t | M, |
const size_t | N, | ||
const vector< Float > & | value | ||
) |
Create dense matrix from monolish::vector.
M | # of row |
N | # of col |
value | value std::vector (size M x N) |
monolish::matrix::Dense< Float >::Dense | ( | const size_t | M, |
const size_t | N, | ||
const std::initializer_list< Float > & | list | ||
) |
Create dense matrix from std::initializer_list.
M | # of row |
N | # of col |
list | value std::initializer_list (size M x N) |
monolish::matrix::Dense< Float >::Dense | ( | const size_t | M, |
const size_t | N, | ||
const Float | min, | ||
const Float | max | ||
) |
Create random dense matrix from dense matrix.
M | # of row |
N | # of col |
min | rand min |
max | rand max |
monolish::matrix::Dense< Float >::Dense | ( | const size_t | M, |
const size_t | N, | ||
const Float | value | ||
) |
Create construct dense matrix.
M | # of row |
N | # of col |
value | value |
|
inline |
destructor of CRS matrix, free GPU memory
Definition at line 386 of file monolish_dense.hpp.
|
inline |
get element A[i][j] (only CPU)
i | row |
j | col |
Definition at line 308 of file monolish_dense.hpp.
template float monolish::matrix::Dense< Float >::at | ( | const size_t | i, |
const size_t | j | ||
) | const |
get element A[i][j]
i | row |
j | col |
Definition at line 9 of file at_insert_sort_dense.cpp.
void monolish::matrix::Dense< Float >::col | ( | const size_t | c, |
vector< Float > & | vec | ||
) | const |
get column vector
c | column number |
vec | column vector |
void monolish::matrix::Dense< Float >::col | ( | const size_t | c, |
view1D< matrix::Dense< Float >, Float > & | vec | ||
) | const |
void monolish::matrix::Dense< Float >::col | ( | const size_t | c, |
view1D< vector< Float >, Float > & | vec | ||
) | const |
void monolish::matrix::Dense< Float >::convert | ( | const COO< Float > & | coo | ) |
void monolish::matrix::Dense< Float >::convert | ( | const Dense< Float > & | dense | ) |
template void monolish::matrix::Dense< Float >::device_free | ( | ) | const |
free data on GPU
Definition at line 238 of file gpu_comm.cpp.
void monolish::matrix::Dense< Float >::diag | ( | vector< Float > & | vec | ) | const |
get diag. vector
vec | diag. vector |
void monolish::matrix::Dense< Float >::diag | ( | view1D< matrix::Dense< Float >, Float > & | vec | ) | const |
void monolish::matrix::Dense< Float >::diag | ( | view1D< vector< Float >, Float > & | vec | ) | const |
void monolish::matrix::Dense< Float >::diag_add | ( | const Float | alpha | ) |
Scalar and diag. vector of dense matrix add.
alpha | scalar |
void monolish::matrix::Dense< Float >::diag_add | ( | const vector< Float > & | vec | ) |
Vector and diag. vector of dense matrix add.
vec | vector |
void monolish::matrix::Dense< Float >::diag_add | ( | const view1D< matrix::Dense< Float >, Float > & | vec | ) |
void monolish::matrix::Dense< Float >::diag_add | ( | const view1D< vector< Float >, Float > & | vec | ) |
void monolish::matrix::Dense< Float >::diag_div | ( | const Float | alpha | ) |
Scalar and diag. vector of dense matrix div.
alpha | scalar |
void monolish::matrix::Dense< Float >::diag_div | ( | const vector< Float > & | vec | ) |
Vector and diag. vector of dense matrix div.
vec | vector |
void monolish::matrix::Dense< Float >::diag_div | ( | const view1D< matrix::Dense< Float >, Float > & | vec | ) |
void monolish::matrix::Dense< Float >::diag_div | ( | const view1D< vector< Float >, Float > & | vec | ) |
void monolish::matrix::Dense< Float >::diag_mul | ( | const Float | alpha | ) |
Scalar and diag. vector of dense matrix mul.
alpha | scalar |
void monolish::matrix::Dense< Float >::diag_mul | ( | const vector< Float > & | vec | ) |
Vector and diag. vector of dense matrix mul.
vec | vector |
void monolish::matrix::Dense< Float >::diag_mul | ( | const view1D< matrix::Dense< Float >, Float > & | vec | ) |
void monolish::matrix::Dense< Float >::diag_mul | ( | const view1D< vector< Float >, Float > & | vec | ) |
void monolish::matrix::Dense< Float >::diag_sub | ( | const Float | alpha | ) |
Scalar and diag. vector of dense matrix sub.
alpha | scalar |
void monolish::matrix::Dense< Float >::diag_sub | ( | const vector< Float > & | vec | ) |
Vector and diag. vector of dense matrix sub.
vec | vector |
void monolish::matrix::Dense< Float >::diag_sub | ( | const view1D< matrix::Dense< Float >, Float > & | vec | ) |
void monolish::matrix::Dense< Float >::diag_sub | ( | const view1D< vector< Float >, Float > & | vec | ) |
template bool monolish::matrix::Dense< Float >::equal | ( | const Dense< Float > & | mat, |
bool | compare_cpu_and_device = false |
||
) | const |
Comparing matricies (A == mat)
mat | Dense matrix |
compare_cpu_and_device | compare data on both CPU and GPU |
Definition at line 10 of file compare_dense.cpp.
template void monolish::matrix::Dense< Float >::fill | ( | Float | value | ) |
fill matrix elements with a scalar value
value | scalar value |
Definition at line 9 of file fill_dense.cpp.
|
inline |
get # of col
Definition at line 208 of file monolish_dense.hpp.
|
inline |
Memory data space required by the matrix.
Definition at line 284 of file monolish_dense.hpp.
|
inline |
true: sended, false: not send
Definition at line 377 of file monolish_dense.hpp.
|
inline |
get # of non-zeros
Definition at line 217 of file monolish_dense.hpp.
|
inline |
get # of row
Definition at line 199 of file monolish_dense.hpp.
template void monolish::matrix::Dense< Float >::insert | ( | const size_t | i, |
const size_t | j, | ||
const Float | Val | ||
) |
get element A[i][j]
i | row |
j | col |
Val | scalar value |
Definition at line 25 of file at_insert_sort_dense.cpp.
template void monolish::matrix::Dense< Float >::nonfree_recv | ( | ) |
recv. data to GPU (w/o free)
Definition at line 222 of file gpu_comm.cpp.
template bool monolish::matrix::Dense< Float >::operator!= | ( | const Dense< Float > & | mat | ) | const |
Comparing matricies (A != mat)
mat | Dense matrix |
gpu_status == true
; compare data on GPUDefinition at line 55 of file compare_dense.cpp.
template void monolish::matrix::Dense< Float >::operator= | ( | const Dense< Float > & | mat | ) |
matrix copy
gpu_statius == true
; coping data on CPUDefinition at line 10 of file copy_dense.cpp.
template bool monolish::matrix::Dense< Float >::operator== | ( | const Dense< Float > & | mat | ) | const |
Comparing matricies (A == mat)
mat | Dense matrix |
gpu_status == true
; compare data on GPUDefinition at line 43 of file compare_dense.cpp.
template void monolish::matrix::Dense< Float >::print_all | ( | bool | force_cpu = false | ) | const |
print all elements to standard I/O
force_cpu | Ignore device status and output CPU data |
Definition at line 17 of file IO_dense.cpp.
template void monolish::matrix::Dense< Float >::recv | ( | ) |
recv. data to GPU, and free data on GPU
Definition at line 205 of file gpu_comm.cpp.
void monolish::matrix::Dense< Float >::row | ( | const size_t | r, |
vector< Float > & | vec | ||
) | const |
get row vector
r | row number |
vec | row vector |
void monolish::matrix::Dense< Float >::row | ( | const size_t | r, |
view1D< matrix::Dense< Float >, Float > & | vec | ||
) | const |
void monolish::matrix::Dense< Float >::row | ( | const size_t | r, |
view1D< vector< Float >, Float > & | vec | ||
) | const |
template void monolish::matrix::Dense< Float >::send | ( | ) | const |
send data to GPU
Definition at line 186 of file gpu_comm.cpp.
|
inline |
Set column number.
N | # of col
|
Definition at line 235 of file monolish_dense.hpp.
|
inline |
Set # of non-zero elements.
NNZ | # of non-zero elements
|
Definition at line 244 of file monolish_dense.hpp.
template void monolish::matrix::Dense< Float >::set_ptr | ( | const size_t | M, |
const size_t | N, | ||
const std::vector< Float > & | value | ||
) |
Set Dense array from std::vector.
M | # of row |
N | # of col |
value | value (size nnz) |
Definition at line 32 of file copy_dense.cpp.
|
inline |
Set row number.
M | # of row
|
Definition at line 226 of file monolish_dense.hpp.
template Dense< float > & monolish::matrix::Dense< Float >::transpose | ( | ) |
get transposed matrix (A^T)
Definition at line 9 of file transpose_dense.cpp.
void monolish::matrix::Dense< Float >::transpose | ( | const Dense< Float > & | B | ) |
|
inline |
get format name "Dense"
Definition at line 253 of file monolish_dense.hpp.
|
private |
# of col
Definition at line 31 of file monolish_dense.hpp.
|
mutableprivate |
true: sended, false: not send
Definition at line 41 of file monolish_dense.hpp.
|
private |
# of non-zero element (M * N)
Definition at line 36 of file monolish_dense.hpp.
|
private |
# of row
Definition at line 26 of file monolish_dense.hpp.
std::vector<Float> monolish::matrix::Dense< Float >::val |
Dense format value(size M x N)
Definition at line 47 of file monolish_dense.hpp.