Cyclops Tensor Framework
parallel arithmetic on multidimensional arrays
CTF_int::COO_Matrix Class Reference

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...
 

Detailed Description

serialized matrix in coordinate format, meaning three arrays of dimension nnz are stored, one of values, and two of row and column indices

Definition at line 14 of file coo.h.

Constructor & Destructor Documentation

CTF_int::COO_Matrix::COO_Matrix ( int64_t  nnz,
algstrct const *  sr 
)

constructor that allocates empty buffer

Parameters
[in]nnznumber of nonzeros
[in]sralgebraic 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)

constructor that acccepts data buffer

Parameters
[in]all_datapreallocated serialized COO Matrix buffer

Definition at line 20 of file coo.cxx.

References all_data.

CTF_int::COO_Matrix::COO_Matrix ( CSR_Matrix const &  csr,
algstrct const *  sr 
)

Member Function Documentation

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().

void CTF_int::COO_Matrix::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 
)
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

Parameters
[in]nznumber of nonzers
[in]ordernumber of tensor modes
[in]lensranges of tensor modes
[in]rev_orderingreordering of tensor modes
[in]nrow_idxnumber of modes to fold into rows
[in,out]tsr_datain key-value pair format
[in]sralgebraic structure
[in]phasedimensions of the blocking grid
[in]phase_rankindex 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

Parameters
[in]nznumber of nonzers
[in]ordernumber of tensor modes
[in]lensranges of tensor modes
[in]orderingreordering of tensor modes
[in]nrow_idxnumber of modes to fold into rows
[in]tsr_datain key-value pair format
[in]sralgebraic structure
[in]phasedimensions 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

retrieves matrix entry size out of all_data

Definition at line 49 of file coo.cxx.

References all_data.

Referenced by CTF_int::CSR_Matrix::CSR_Matrix(), rows(), and size().

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().

Field Documentation

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().


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