NTPoly
|
A datatype for storing a CSR matrix (complex values). More...
#include <SMatrix.h>
Public Member Functions | |
Matrix_lsc (int columns, int rows) | |
Matrix_lsc (std::string file_name) | |
Matrix_lsc (const NTPoly::TripletList_c &list, int rows, int columns) | |
Matrix_lsc (const NTPoly::Matrix_lsc &matB) | |
int | GetRows () const |
Get the number of rows in a matrix. | |
int | GetColumns () const |
Get the number of columns in a matrix. | |
void | ExtractRow (int row_number, Matrix_lsc &row_out) const |
void | ExtractColumn (int column_number, Matrix_lsc &column_out) const |
void | Scale (double constant) |
void | Increment (const NTPoly::Matrix_lsc &matB, double alpha, double threshold) |
std::complex< double > | Dot (const NTPoly::Matrix_lsc &matB) const |
void | PairwiseMultiply (const NTPoly::Matrix_lsc &matA, const NTPoly::Matrix_lsc &matB) |
void | Gemm (const NTPoly::Matrix_lsc &matA, const NTPoly::Matrix_lsc &matB, bool isATransposed, bool isBTransposed, double alpha, double beta, double threshold, NTPoly::MatrixMemoryPool_c &memory_pool) |
void | Transpose (const NTPoly::Matrix_lsc &matA) |
Transpose a sparse matrix. | |
void | Conjugate () |
Compute the complex conjugate of a matrix. | |
void | Print () const |
Print the sparse matrix to the console. | |
void | WriteToMatrixMarket (std::string file_name) const |
void | MatrixToTripletList (NTPoly::TripletList_c &triplet_list) const |
~Matrix_lsc () | |
Standard destructor. | |
A datatype for storing a CSR matrix (complex values).
NTPoly::Matrix_lsc::Matrix_lsc | ( | int | columns, |
int | rows | ||
) |
Basic constructor.
columns | number of columns for the matrix. |
rows | number of rows for the matrix. |
NTPoly::Matrix_lsc::Matrix_lsc | ( | std::string | file_name | ) |
Construct from a matrix market file.
file_name | matrix market file name. |
NTPoly::Matrix_lsc::Matrix_lsc | ( | const NTPoly::TripletList_c & | list, |
int | rows, | ||
int | columns | ||
) |
Construct from a triplet list.
list | a list of triplet values to set in the matrix. |
columns | number of columns for the matrix. |
rows | number of rows for the matrix. |
NTPoly::Matrix_lsc::Matrix_lsc | ( | const NTPoly::Matrix_lsc & | matB | ) |
Copy constructor.
matB | the matrix to copy from. |
complex< double > NTPoly::Matrix_lsc::Dot | ( | const NTPoly::Matrix_lsc & | matB | ) | const |
Matrix dot product.
matB | matrix to dot with. |
void NTPoly::Matrix_lsc::ExtractColumn | ( | int | column_number, |
Matrix_lsc & | column_out | ||
) | const |
Extract a column from the matrix into the compressed vector representation
column_number | the column to extract |
column_out | the matrix representing that column |
void NTPoly::Matrix_lsc::ExtractRow | ( | int | row_number, |
Matrix_lsc & | row_out | ||
) | const |
Extract a row from the matrix into the compressed vector representation.
row_number | the row to extract |
row_out | the matrix representing that row |
void NTPoly::Matrix_lsc::Gemm | ( | const NTPoly::Matrix_lsc & | matA, |
const NTPoly::Matrix_lsc & | matB, | ||
bool | isATransposed, | ||
bool | isBTransposed, | ||
double | alpha, | ||
double | beta, | ||
double | threshold, | ||
NTPoly::MatrixMemoryPool_c & | memory_pool | ||
) |
This := alpha*matA*op( matB ) + beta*this
matA | |
matB | |
isATransposed | true if A is already transposed. |
isBTransposed | true if B is already transposed. |
alpha | scaling value. |
beta | scaling value. |
threshold | for flushing small values. |
memory_pool | a memory pool to use for storing intermediates. |
void NTPoly::Matrix_lsc::Increment | ( | const NTPoly::Matrix_lsc & | matB, |
double | alpha, | ||
double | threshold | ||
) |
This = alpha*MatrixB + This(AXPY).
matB | matrix to add. |
alpha | scale for the matrix. |
threshold | for flushing small values. |
void NTPoly::Matrix_lsc::MatrixToTripletList | ( | NTPoly::TripletList_c & | triplet_list | ) | const |
Compute a triplet list from the entries in a matrix.
triplet_list | output. |
void NTPoly::Matrix_lsc::PairwiseMultiply | ( | const NTPoly::Matrix_lsc & | matA, |
const NTPoly::Matrix_lsc & | matB | ||
) |
Pairwise multiply two sparse matrices.
matA | |
matB |
void NTPoly::Matrix_lsc::Scale | ( | double | constant | ) |
Scale the matrix by a constant.
constant | value to scale by. |
void NTPoly::Matrix_lsc::WriteToMatrixMarket | ( | std::string | file_name | ) | const |
Write the sparse matrix to file.
file_name | file to print to. |