A datatype for storing a CSR matrix.
More...
#include <SparseMatrix.h>
|
| | SparseMatrix (int columns, int rows) |
| |
| | SparseMatrix (std::string file_name) |
| |
| | SparseMatrix (const NTPoly::TripletList &list, int rows, int columns) |
| |
| | SparseMatrix (const NTPoly::SparseMatrix &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, SparseMatrix &row_out) const |
| |
| void | ExtractColumn (int column_number, SparseMatrix &column_out) const |
| |
| void | Scale (double constant) |
| |
| void | Increment (const NTPoly::SparseMatrix &matB, double alpha, double threshold) |
| |
| double | Dot (const NTPoly::SparseMatrix &matB) const |
| |
| void | PairwiseMultiply (const NTPoly::SparseMatrix &matA, const NTPoly::SparseMatrix &matB) |
| |
| void | Gemm (const NTPoly::SparseMatrix &matA, const NTPoly::SparseMatrix &matB, bool isATransposed, bool isBTransposed, double alpha, double beta, double threshold, NTPoly::MatrixMemoryPool &memory_pool) |
| |
|
void | Transpose (const NTPoly::SparseMatrix &matA) |
| | Transpose a sparse matrix.
|
| |
|
void | Print () |
| | Print the sparse matrix to the console.
|
| |
| void | WriteToMatrixMarket (std::string file_name) |
| |
| void | MatrixToTripletList (NTPoly::TripletList &triplet_list) |
| |
|
| ~SparseMatrix () |
| | Standard destructor.
|
| |
A datatype for storing a CSR matrix.
◆ SparseMatrix() [1/4]
| NTPoly::SparseMatrix::SparseMatrix |
( |
int |
columns, |
|
|
int |
rows |
|
) |
| |
Basic constructor.
- Parameters
-
| columns | number of columns for the matrix. |
| rows | number of rows for the matrix. |
◆ SparseMatrix() [2/4]
| NTPoly::SparseMatrix::SparseMatrix |
( |
std::string |
file_name | ) |
|
Construct from a matrix market file.
- Parameters
-
| file_name | matrix market file name. |
◆ SparseMatrix() [3/4]
Construct from a triplet list.
- Parameters
-
| 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. |
◆ SparseMatrix() [4/4]
Copy constructor.
- Parameters
-
| matB | the matrix to copy from. |
◆ Dot()
Matrix dot product.
- Parameters
-
- Returns
- the dot product of this and matB.
◆ ExtractColumn()
| void NTPoly::SparseMatrix::ExtractColumn |
( |
int |
column_number, |
|
|
SparseMatrix & |
column_out |
|
) |
| const |
Extract a column from the matrix into the compressed vector representation.
- Parameters
-
| column_number | the column to extract |
| column_out | the matrix representing that column |
◆ ExtractRow()
| void NTPoly::SparseMatrix::ExtractRow |
( |
int |
row_number, |
|
|
SparseMatrix & |
row_out |
|
) |
| const |
Extract a row from the matrix into the compressed vector representation.
- Parameters
-
| row_number | the row to extract |
| row_out | the matrix representing that row |
◆ Gemm()
This := alpha*matA*op( matB ) + beta*this
- Parameters
-
| 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. |
◆ Increment()
| void NTPoly::SparseMatrix::Increment |
( |
const NTPoly::SparseMatrix & |
matB, |
|
|
double |
alpha, |
|
|
double |
threshold |
|
) |
| |
This = alpha*MatrixB + This(AXPY).
- Parameters
-
| matB | matrix to add. |
| alpha | scale for the matrix. |
| threshold | for flushing small values. |
◆ MatrixToTripletList()
Compute a triplet list from the entries in a matrix.
- Parameters
-
◆ PairwiseMultiply()
Pairwise multiply two sparse matrices.
- Parameters
-
◆ Scale()
| void NTPoly::SparseMatrix::Scale |
( |
double |
constant | ) |
|
Scale the matrix by a constant.
- Parameters
-
| constant | value to scale by. |
◆ WriteToMatrixMarket()
| void NTPoly::SparseMatrix::WriteToMatrixMarket |
( |
std::string |
file_name | ) |
|
Write the sparse matrix to file.
- Parameters
-
| file_name | file to print to. |
The documentation for this class was generated from the following files:
- /Users/dawson/Desktop/simple/Source/CPlusPlus/SparseMatrix.h
- /Users/dawson/Desktop/simple/Source/CPlusPlus/SparseMatrix.cc