|
ParGeMSLR
|
Class of COO matrices. Note that most coo matrix functions are not yet on the device. More...
#include <coo_matrix.hpp>
Public Member Functions | |
| CooMatrixClass () | |
| The constructor of CooMatrixClass. More... | |
| CooMatrixClass (const CooMatrixClass< T > &mat) | |
| The copy constructor of CooMatrixClass. More... | |
| CooMatrixClass (CooMatrixClass< T > &&mat) | |
| The move constructor of CooMatrixClass. More... | |
| CooMatrixClass< T > & | operator= (const CooMatrixClass< T > &mat) |
| The = operator of CooMatrixClass. More... | |
| CooMatrixClass< T > & | operator= (CooMatrixClass< T > &&mat) |
| The = operator of CooMatrixClass. More... | |
| virtual int | Clear () |
| Free the current matrix. More... | |
| virtual | ~CooMatrixClass () |
| The destructor of CooMatrixClass. More... | |
| int | Setup (int nrows, int ncols) |
| Free the current matrix, and create the new matrix using the default reserved memory size on the host. More... | |
| int | Setup (int nrows, int ncols, int reserve) |
| Free the current matrix, and create the new matrix and reserve some space in the host memory. More... | |
| int | Setup (int nrows, int ncols, int reserve, int location) |
| Free the current matrix, and create the new matrix and reserve some space in the memory. More... | |
| virtual int | GetDataLocation () const |
| Get the data location of the matrix. More... | |
| virtual int | GetNumRowsLocal () const |
| Get the local number of rows of the matrix. More... | |
| virtual int | GetNumColsLocal () const |
| Get the local number of columns of the matrix. More... | |
| virtual long int | GetNumNonzeros () const |
| Get the number of nonzeros in this matrix. More... | |
| int | SetNumCols (int cols) |
| Set the number of cols in this matrix. More... | |
| int | SetNumNonzeros () |
| Set the number of nonzeros in this matrix. More... | |
| virtual int | Eye () |
| Create an indentity matrix. More... | |
| virtual int | Fill (const T &v) |
| Fill the matrix pattern with constant value. More... | |
| virtual int | Scale (const T &alpha) |
| Scale the matrix. More... | |
| virtual int | MoveData (const int &location) |
| Move the data to another memory location. More... | |
| int | PushBack (int row, int col, T v) |
| Insert value to the COO matrix. More... | |
| int * | GetI () const |
| Get the I pointer of the matrix. More... | |
| int * | GetJ () const |
| Get the J pointer of the matrix. More... | |
| T * | GetData () const |
| Get the data pointer of the matrix. More... | |
| IntVectorClass< int > & | GetIVector () |
| Get the reference to the I vector. More... | |
| const IntVectorClass< int > & | GetIVector () const |
| Get the reference to the I vector. More... | |
| IntVectorClass< int > & | GetJVector () |
| Get the reference to the J vector. More... | |
| const IntVectorClass< int > & | GetJVector () const |
| Get the reference to the J vector. More... | |
| SequentialVectorClass< T > & | GetDataVector () |
| Get the reference to the data vector. More... | |
| const SequentialVectorClass< T > & | GetDataVector () const |
| Get the reference to the data vector. More... | |
| int | ToCsr (int location, CsrMatrixClass< T > &csrmat_out) |
| Convert the matrix to csr. More... | |
| int | Laplacian (int nx, int ny, int nz, T alphax, T alphay, T alphaz, T shift, bool rand_perturb=false) |
| Generate Laplacian matrix, 5-pt for 2D problem and 7-pt for 3D problem. More... | |
| int | Helmholtz (int n, T w) |
| Generate 3D Helmholtz matrix with 7-pt on [0,1]^3. -\Delta u - w^2 u = f. More... | |
| int | ReadFromMMFile (const char *matfile, int idxin) |
| Read matrix on the host memory, matrix market format. More... | |
| int | PlotPatternGnuPlot (const char *datafilename, int *rperm, int *cperm, int conditiona, int conditionb) |
| Plot the pattern of the csr matrix using gnuplot. Similar to spy in the MATLAB. Function for testing purpose. More... | |
Public Member Functions inherited from pargemslr::MatrixClass< T > | |
| MatrixClass () | |
| The constructor of MatrixClass. More... | |
| MatrixClass (const MatrixClass< T > &mat) | |
| The copy constructor of MatrixClass. More... | |
| MatrixClass (MatrixClass< T > &&mat) | |
| The move constructor of MatrixClass. More... | |
| virtual | ~MatrixClass () |
| The destructor of MatrixClass. More... | |
| virtual int | MatVec (char trans, const T &alpha, const VectorClass< T > &x, const T &beta, VectorClass< T > &y) |
| In place Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y. More... | |
| virtual int | MatVec (char trans, const T &alpha, const VectorClass< T > &x, const T &beta, const VectorClass< T > &y, VectorClass< T > &z) |
| In place Matrix-Vector product ==> z := alpha*A*x + beta*y, or z := alpha*A'*x + beta*y. More... | |
| PrecisionEnum | GetPrecision () const |
| Return the precision of the matrix. More... | |
Class of COO matrices. Note that most coo matrix functions are not yet on the device.
| template pargemslr::CooMatrixClass< T >::CooMatrixClass | ( | ) |
The constructor of CooMatrixClass.
| pargemslr::CooMatrixClass< T >::CooMatrixClass | ( | const CooMatrixClass< T > & | mat | ) |
The copy constructor of CooMatrixClass.
| [in] | mat | The other matrix. |
| pargemslr::CooMatrixClass< T >::CooMatrixClass | ( | CooMatrixClass< T > && | mat | ) |
The move constructor of CooMatrixClass.
| [in] | mat | The other matrix. |
|
virtual |
The destructor of CooMatrixClass.
|
virtual |
Free the current matrix.
Reimplemented from pargemslr::MatrixClass< T >.
|
virtual |
Create an indentity matrix.
Reimplemented from pargemslr::MatrixClass< T >.
|
virtual |
Fill the matrix pattern with constant value.
| [in] | v | The value to be filled. |
Reimplemented from pargemslr::MatrixClass< T >.
| template complexd * pargemslr::CooMatrixClass< T >::GetData | ( | ) | const |
Get the data pointer of the matrix.
|
virtual |
Get the data location of the matrix.
Get the data location of the matrix.
Reimplemented from pargemslr::MatrixClass< T >.
| template SequentialVectorClass< complexd > & pargemslr::CooMatrixClass< T >::GetDataVector | ( | ) |
Get the reference to the data vector.
| template const SequentialVectorClass< complexd > & pargemslr::CooMatrixClass< T >::GetDataVector | ( | ) | const |
Get the reference to the data vector.
| template int * pargemslr::CooMatrixClass< T >::GetI | ( | ) | const |
Get the I pointer of the matrix.
| template IntVectorClass< int > & pargemslr::CooMatrixClass< T >::GetIVector | ( | ) |
Get the reference to the I vector.
| template const IntVectorClass< int > & pargemslr::CooMatrixClass< T >::GetIVector | ( | ) | const |
Get the reference to the I vector.
| template int * pargemslr::CooMatrixClass< T >::GetJ | ( | ) | const |
Get the J pointer of the matrix.
| template IntVectorClass< int > & pargemslr::CooMatrixClass< T >::GetJVector | ( | ) |
Get the reference to the J vector.
| template const IntVectorClass< int > & pargemslr::CooMatrixClass< T >::GetJVector | ( | ) | const |
Get the reference to the J vector.
|
virtual |
Get the local number of columns of the matrix.
Get the local number of columns of the matrix.
Implements pargemslr::MatrixClass< T >.
|
virtual |
Get the number of nonzeros in this matrix.
Reimplemented from pargemslr::MatrixClass< T >.
|
virtual |
Get the local number of rows of the matrix.
Get the local number of rows of the matrix.
Implements pargemslr::MatrixClass< T >.
| template int pargemslr::CooMatrixClass< T >::Helmholtz | ( | int | n, |
| T | w | ||
| ) |
Generate 3D Helmholtz matrix with 7-pt on [0,1]^3. -\Delta u - w^2 u = f. Robin boundary condition u'-iwu = 0 is used.
| [in] | n | Problem size. |
| [in] | w | The w value. |
| template int pargemslr::CooMatrixClass< T >::Laplacian | ( | int | nx, |
| int | ny, | ||
| int | nz, | ||
| T | alphax, | ||
| T | alphay, | ||
| T | alphaz, | ||
| T | shift, | ||
| bool | rand_perturb = false |
||
| ) |
Generate Laplacian matrix, 5-pt for 2D problem and 7-pt for 3D problem.
| [in] | nx | |
| [in] | ny | |
| [in] | nz | Problem size on each dimension |
| [in] | alphax | |
| [in] | alphay | |
| [in] | alphaz | Alpha value on each direction |
| [in] | shift | The shift value on diagonal. |
| [in] | rand_perturb | Set to true to add extra random real pertubation to diagonal entries as abs(shift)*Rand(). We only add shift that might makes the problem harder. |
|
virtual |
Move the data to another memory location.
| [in] | location | The location move to. |
Reimplemented from pargemslr::MatrixClass< T >.
| CooMatrixClass< T > & pargemslr::CooMatrixClass< T >::operator= | ( | const CooMatrixClass< T > & | mat | ) |
| CooMatrixClass< T > & pargemslr::CooMatrixClass< T >::operator= | ( | CooMatrixClass< T > && | mat | ) |
| template int pargemslr::CooMatrixClass< T >::PlotPatternGnuPlot | ( | const char * | datafilename, |
| int * | rperm, | ||
| int * | cperm, | ||
| int | conditiona, | ||
| int | conditionb | ||
| ) |
Plot the pattern of the csr matrix using gnuplot. Similar to spy in the MATLAB. Function for testing purpose.
| [in] | datafilename | The filename of the temp file holding the data. |
| [in] | rperm | The row permutation vector. |
| [in] | cperm | The column permutation vector. Set either rperm or cperm to NULL to spy(A), otherwise spy(A(rperm,cperm)). |
| [in] | conditiona | First condition. |
| [in] | conditionb | Secend condition, only plot when conditiona == conditionb. |
| template int pargemslr::CooMatrixClass< T >::PushBack | ( | int | row, |
| int | col, | ||
| T | v | ||
| ) |
Insert value to the COO matrix.
| [in] | row. | |
| [in] | col | The col/row to be inserted into the csr/csc. |
| [in] | v | The value to be inserted. |
| template int pargemslr::CooMatrixClass< T >::ReadFromMMFile | ( | const char * | matfile, |
| int | idxin | ||
| ) |
Read matrix on the host memory, matrix market format.
| [in] | matfile | The file. |
| [in] | idxin | The index base of the input file. 0-based or 1-based. |
|
virtual |
Scale the matrix.
| [in] | alpha | The scale. |
Reimplemented from pargemslr::MatrixClass< T >.
| template int pargemslr::CooMatrixClass< T >::SetNumCols | ( | int | cols | ) |
Set the number of cols in this matrix.
| template int pargemslr::CooMatrixClass< T >::SetNumNonzeros | ( | ) |
Set the number of nonzeros in this matrix.
| template int pargemslr::CooMatrixClass< T >::Setup | ( | int | nrows, |
| int | ncols | ||
| ) |
Free the current matrix, and create the new matrix. The default reserved memory size on the host is MAX(nrow, ncol)*_coo_reserve_fact.
| [in] | nrows | The number of rows of the new matrix. |
| [in] | ncols | The number of cols of the new matrix. |
| template int pargemslr::CooMatrixClass< T >::Setup | ( | int | nrows, |
| int | ncols, | ||
| int | reserve | ||
| ) |
Free the current matrix, and create the new matrix and reserve some space in the host memory.
| [in] | nrows | The number of rows of the new matrix. |
| [in] | ncols | The number of cols of the new matrix. |
| [in] | reserve | The reserved vector length. A good estimation can avoid to many re-allocation when inserting values. |
| template int pargemslr::CooMatrixClass< T >::Setup | ( | int | nrows, |
| int | ncols, | ||
| int | reserve, | ||
| int | location | ||
| ) |
Free the current matrix, and create the new matrix and reserve some space in the memory.
| [in] | nrows | The number of rows of the new matrix. |
| [in] | ncols | The number of cols of the new matrix. |
| [in] | reserve | The reserved vector length. A good estimation can avoid to many re-allocation when inserting values. |
| [in] | location | The location of the memory. |
| template int pargemslr::CooMatrixClass< T >::ToCsr | ( | int | location, |
| CsrMatrixClass< T > & | csrmat_out | ||
| ) |
Convert the matrix to csr.
| [in] | location | The location of the output csr matrix. |
| [out] | csrmat_out | The output csr matrix. |
1.8.18