Cyclops Tensor Framework
parallel arithmetic on multidimensional arrays
|
serialized matrix in coordinate format, meaning three arrays of dimension nnz are stored, one of values, and two of row and column indices More...
#include <coo.h>
Public Member Functions | |
COO_Matrix (int64_t nnz, algstrct const *sr) | |
constructor that allocates empty buffer More... | |
COO_Matrix (char *all_data) | |
constructor that acccepts data buffer More... | |
COO_Matrix (CSR_Matrix const &csr, algstrct const *sr) | |
constructor that constructs serialized COO Matrix from a CSR_Matrix More... | |
int64_t | nnz () const |
retrieves number of nonzeros out of all_data More... | |
int64_t | size () const |
retrieves buffer size out of all_data More... | |
int | nrow () const |
retrieves number of rows out of all_data More... | |
int | ncol () const |
retrieves number of columns out of all_data More... | |
int | val_size () const |
retrieves matrix entry size out of all_data More... | |
char * | vals () const |
retrieves pointer to array of values out of all_data More... | |
int * | rows () const |
retrieves pointer to array row indices of each value More... | |
int * | cols () const |
retrieves pointer to array of column indices for each value More... | |
void | set_data (int64_t nz, int order, int const *lens, int const *ordering, int nrow_idx, char const *tsr_data, algstrct const *sr, int const *phase) |
folds tensor data into COO format based on prespecification of row and column modes More... | |
void | get_data (int64_t nz, int order, int const *lens, int const *rev_ordering, int nrow_idx, char *tsr_data, algstrct const *sr, int const *phase, int const *phase_rank) |
unfolds tensor data from COO format based on prespecification of row and column modes More... | |
Static Public Member Functions | |
static void | coomm (char const *A, algstrct const *sr_A, int m, int n, int k, char const *alpha, char const *B, algstrct const *sr_B, char const *beta, char *C, algstrct const *sr_C, bivar_function const *func) |
computes C = beta*C + func(alpha*A*B) where A is a COO_Matrix, while B and C are dense More... | |
Data Fields | |
char * | all_data |
serialized buffer containing info and data More... | |
serialized matrix in coordinate format, meaning three arrays of dimension nnz are stored, one of values, and two of row and column indices
CTF_int::COO_Matrix::COO_Matrix | ( | int64_t | nnz, |
algstrct const * | sr | ||
) |
constructor that allocates empty buffer
[in] | nnz | number of nonzeros |
[in] | sr | algebraic structure |
Definition at line 12 of file coo.cxx.
References all_data, CTF_int::alloc(), CTF_int::accumulatable::el_size, CTF_int::get_coo_size(), nnz(), and size().
CTF_int::COO_Matrix::COO_Matrix | ( | char * | all_data | ) |
CTF_int::COO_Matrix::COO_Matrix | ( | CSR_Matrix const & | csr, |
algstrct const * | sr | ||
) |
constructor that constructs serialized COO Matrix from a CSR_Matrix
[in] | csr | a matrix in CSR format |
[in] | sr | algebraic structure |
Definition at line 24 of file coo.cxx.
References all_data, CTF_int::alloc(), cols(), CTF_int::algstrct::csr_to_coo(), CTF_int::get_coo_size(), CTF_int::CSR_Matrix::IA(), CTF_int::accumulatable::init_shell(), CTF_int::CSR_Matrix::JA(), nnz(), CTF_int::CSR_Matrix::nnz(), CTF_int::CSR_Matrix::nrow(), rows(), size(), CTF_int::CSR_Matrix::val_size(), vals(), and CTF_int::CSR_Matrix::vals().
int * CTF_int::COO_Matrix::cols | ( | ) | const |
retrieves pointer to array of column indices for each value
Definition at line 68 of file coo.cxx.
References all_data, and nnz().
Referenced by COO_Matrix(), coomm(), CTF_int::CSR_Matrix::CSR_Matrix(), get_data(), and set_data().
|
static |
computes C = beta*C + func(alpha*A*B) where A is a COO_Matrix, while B and C are dense
Definition at line 230 of file coo.cxx.
References ASSERT, CTF_int::bivar_function::ccoomm(), cols(), CTF_int::algstrct::coomm(), CTF_int::accumulatable::el_size, CTF_int::algstrct::isequal(), CTF_int::algstrct::mulid(), nnz(), rows(), and vals().
Referenced by CTF_int::seq_tsr_spctr::run().
void CTF_int::COO_Matrix::get_data | ( | int64_t | nz, |
int | order, | ||
int const * | lens, | ||
int const * | rev_ordering, | ||
int | nrow_idx, | ||
char * | tsr_data, | ||
algstrct const * | sr, | ||
int const * | phase, | ||
int const * | phase_rank | ||
) |
unfolds tensor data from COO format based on prespecification of row and column modes
[in] | nz | number of nonzers |
[in] | order | number of tensor modes |
[in] | lens | ranges of tensor modes |
[in] | rev_ordering | reordering of tensor modes |
[in] | nrow_idx | number of modes to fold into rows |
[in,out] | tsr_data | in key-value pair format |
[in] | sr | algebraic structure |
[in] | phase | dimensions of the blocking grid |
[in] | phase_rank | index of this block in grid |
Definition at line 146 of file coo.cxx.
References all_data, CTF_int::alloc(), ASSERT, CTF_int::cdealloc(), cols(), CTF_int::accumulatable::el_size, rows(), CTF_int::PairIterator::sort(), TAU_FSTART, TAU_FSTOP, vals(), CTF_int::PairIterator::write_key(), and CTF_int::PairIterator::write_val().
Referenced by CTF_int::tensor::despmatricize().
int CTF_int::COO_Matrix::ncol | ( | ) | const |
retrieves number of columns out of all_data
int64_t CTF_int::COO_Matrix::nnz | ( | ) | const |
retrieves number of nonzeros out of all_data
Definition at line 45 of file coo.cxx.
References all_data.
Referenced by cols(), COO_Matrix(), coomm(), CTF_int::CSR_Matrix::CSR_Matrix(), CTF_int::tensor::despmatricize(), rows(), and size().
int CTF_int::COO_Matrix::nrow | ( | ) | const |
retrieves number of rows out of all_data
int * CTF_int::COO_Matrix::rows | ( | ) | const |
retrieves pointer to array row indices of each value
Definition at line 61 of file coo.cxx.
References all_data, nnz(), and val_size().
Referenced by COO_Matrix(), coomm(), CTF_int::CSR_Matrix::CSR_Matrix(), get_data(), and set_data().
void CTF_int::COO_Matrix::set_data | ( | int64_t | nz, |
int | order, | ||
int const * | lens, | ||
int const * | ordering, | ||
int | nrow_idx, | ||
char const * | tsr_data, | ||
algstrct const * | sr, | ||
int const * | phase | ||
) |
folds tensor data into COO format based on prespecification of row and column modes
[in] | nz | number of nonzers |
[in] | order | number of tensor modes |
[in] | lens | ranges of tensor modes |
[in] | ordering | reordering of tensor modes |
[in] | nrow_idx | number of modes to fold into rows |
[in] | tsr_data | in key-value pair format |
[in] | sr | algebraic structure |
[in] | phase | dimensions of the blocking grid |
Definition at line 75 of file coo.cxx.
References all_data, CTF_int::alloc(), CTF_int::cdealloc(), cols(), CTF_int::accumulatable::el_size, CTF_int::ConstPairIterator::k(), CTF_int::ConstPairIterator::read_val(), rows(), TAU_FSTART, TAU_FSTOP, and vals().
Referenced by CTF_int::tensor::spmatricize().
int64_t CTF_int::COO_Matrix::size | ( | ) | const |
retrieves buffer size out of all_data
Definition at line 53 of file coo.cxx.
References CTF_int::get_coo_size(), nnz(), and val_size().
Referenced by COO_Matrix().
int CTF_int::COO_Matrix::val_size | ( | ) | const |
char * CTF_int::COO_Matrix::vals | ( | ) | const |
retrieves pointer to array of values out of all_data
Definition at line 57 of file coo.cxx.
References all_data.
Referenced by COO_Matrix(), coomm(), CTF_int::CSR_Matrix::CSR_Matrix(), get_data(), and set_data().
char* CTF_int::COO_Matrix::all_data |
serialized buffer containing info and data
Definition at line 17 of file coo.h.
Referenced by cols(), COO_Matrix(), CTF_int::tensor::despmatricize(), get_data(), nnz(), rows(), set_data(), CTF_int::tensor::spmatricize(), val_size(), and vals().