NTPoly
Loading...
Searching...
No Matches
Public Member Functions | List of all members
NTPoly::Matrix_lsc Class Reference

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.
 

Detailed Description

A datatype for storing a CSR matrix (complex values).

Constructor & Destructor Documentation

◆ Matrix_lsc() [1/4]

NTPoly::Matrix_lsc::Matrix_lsc ( int  columns,
int  rows 
)

Basic constructor.

Parameters
columnsnumber of columns for the matrix.
rowsnumber of rows for the matrix.

◆ Matrix_lsc() [2/4]

NTPoly::Matrix_lsc::Matrix_lsc ( std::string  file_name)

Construct from a matrix market file.

Parameters
file_namematrix market file name.

◆ Matrix_lsc() [3/4]

NTPoly::Matrix_lsc::Matrix_lsc ( const NTPoly::TripletList_c list,
int  rows,
int  columns 
)

Construct from a triplet list.

Parameters
lista list of triplet values to set in the matrix.
columnsnumber of columns for the matrix.
rowsnumber of rows for the matrix.

◆ Matrix_lsc() [4/4]

NTPoly::Matrix_lsc::Matrix_lsc ( const NTPoly::Matrix_lsc matB)

Copy constructor.

Parameters
matBthe matrix to copy from.

Member Function Documentation

◆ Dot()

complex< double > NTPoly::Matrix_lsc::Dot ( const NTPoly::Matrix_lsc matB) const

Matrix dot product.

Parameters
matBmatrix to dot with.
Returns
the dot product of this and matB.

◆ ExtractColumn()

void NTPoly::Matrix_lsc::ExtractColumn ( int  column_number,
Matrix_lsc column_out 
) const

Extract a column from the matrix into the compressed vector representation

Parameters
column_numberthe column to extract
column_outthe matrix representing that column

◆ ExtractRow()

void NTPoly::Matrix_lsc::ExtractRow ( int  row_number,
Matrix_lsc row_out 
) const

Extract a row from the matrix into the compressed vector representation.

Parameters
row_numberthe row to extract
row_outthe matrix representing that row

◆ Gemm()

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

Parameters
matA
matB
isATransposedtrue if A is already transposed.
isBTransposedtrue if B is already transposed.
alphascaling value.
betascaling value.
thresholdfor flushing small values.
memory_poola memory pool to use for storing intermediates.

◆ Increment()

void NTPoly::Matrix_lsc::Increment ( const NTPoly::Matrix_lsc matB,
double  alpha,
double  threshold 
)

This = alpha*MatrixB + This(AXPY).

Parameters
matBmatrix to add.
alphascale for the matrix.
thresholdfor flushing small values.

◆ MatrixToTripletList()

void NTPoly::Matrix_lsc::MatrixToTripletList ( NTPoly::TripletList_c triplet_list) const

Compute a triplet list from the entries in a matrix.

Parameters
triplet_listoutput.

◆ PairwiseMultiply()

void NTPoly::Matrix_lsc::PairwiseMultiply ( const NTPoly::Matrix_lsc matA,
const NTPoly::Matrix_lsc matB 
)

Pairwise multiply two sparse matrices.

Parameters
matA
matB

◆ Scale()

void NTPoly::Matrix_lsc::Scale ( double  constant)

Scale the matrix by a constant.

Parameters
constantvalue to scale by.

◆ WriteToMatrixMarket()

void NTPoly::Matrix_lsc::WriteToMatrixMarket ( std::string  file_name) const

Write the sparse matrix to file.

Parameters
file_namefile to print to.

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