ParGeMSLR
|
Matrix operations. More...
#include <vector>
#include "../vectors/vector.hpp"
#include "../utils/mmio.hpp"
#include "matrix.hpp"
#include "csr_matrix.hpp"
#include "parallel_csr_matrix.hpp"
#include "coo_matrix.hpp"
#include "dense_matrix.hpp"
Go to the source code of this file.
Functions | |
PrecisionEnum | pargemslr::GetMatrixPrecision (const MatrixClass< int > &mat) |
Get the precision of a matrix. More... | |
PrecisionEnum | pargemslr::GetMatrixPrecision (const MatrixClass< long int > &mat) |
Get the precision of a matrix. More... | |
PrecisionEnum | pargemslr::GetMatrixPrecision (const MatrixClass< float > &mat) |
Get the precision of a matrix. More... | |
PrecisionEnum | pargemslr::GetMatrixPrecision (const MatrixClass< double > &mat) |
Get the precision of a matrix. More... | |
PrecisionEnum | pargemslr::GetMatrixPrecision (const MatrixClass< complexs > &mat) |
Get the precision of a matrix. More... | |
PrecisionEnum | pargemslr::GetMatrixPrecision (const MatrixClass< complexd > &mat) |
Get the precision of a matrix. More... | |
PrecisionEnum | pargemslr::GetMatrixPPrecision (const MatrixClass< int > *mat) |
Get the precision of a matrix. More... | |
PrecisionEnum | pargemslr::GetMatrixPPrecision (const MatrixClass< long int > *mat) |
Get the precision of a matrix. More... | |
PrecisionEnum | pargemslr::GetMatrixPPrecision (const MatrixClass< float > *mat) |
Get the precision of a matrix. More... | |
PrecisionEnum | pargemslr::GetMatrixPPrecision (const MatrixClass< double > *mat) |
Get the precision of a matrix. More... | |
PrecisionEnum | pargemslr::GetMatrixPPrecision (const MatrixClass< complexs > *mat) |
Get the precision of a matrix. More... | |
PrecisionEnum | pargemslr::GetMatrixPPrecision (const MatrixClass< complexd > *mat) |
Get the precision of a matrix. More... | |
template<typename T > | |
int | pargemslr::DenseMatrixPMatVecTemplate (char trans, int nrows, int ncols, const T &alpha, const T *aa, int ldim, const T *x, const T &beta, T *y) |
In place dense complex Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y. More... | |
int | pargemslr::DenseMatrixMatVec (const DenseMatrixClass< float > &A, char trans, const float &alpha, const VectorClass< float > &x, const float &beta, VectorClass< float > &y) |
In place dense float Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y. More... | |
int | pargemslr::DenseMatrixMatVec (const DenseMatrixClass< double > &A, char trans, const double &alpha, const VectorClass< double > &x, const double &beta, VectorClass< double > &y) |
In place dense double Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y. More... | |
int | pargemslr::DenseMatrixMatVec (const DenseMatrixClass< complexs > &A, char trans, const complexs &alpha, const VectorClass< complexs > &x, const complexs &beta, VectorClass< complexs > &y) |
In place dense single complex Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y. More... | |
int | pargemslr::DenseMatrixMatVec (const DenseMatrixClass< complexd > &A, char trans, const complexd &alpha, const VectorClass< complexd > &x, const complexd &beta, VectorClass< complexd > &y) |
In place dense double complex Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y. More... | |
int | pargemslr::DenseMatrixInvertHost (DenseMatrixClass< float > &A) |
Compute the inverese of a general float matrix. More... | |
int | pargemslr::DenseMatrixInvertHost (DenseMatrixClass< double > &A) |
Compute the inverese of a general double matrix. More... | |
int | pargemslr::DenseMatrixInvertHost (DenseMatrixClass< complexs > &A) |
Compute the inverese of a general single complex matrix. More... | |
int | pargemslr::DenseMatrixInvertHost (DenseMatrixClass< complexd > &A) |
Compute the inverese of a general double complex matrix. More... | |
int | pargemslr::DenseMatrixInvertUpperTriangularHost (DenseMatrixClass< float > &A) |
Compute the inverese of a upper triangular float matrix. More... | |
int | pargemslr::DenseMatrixInvertUpperTriangularHost (DenseMatrixClass< double > &A) |
Compute the inverese of a upper triangular double matrix. More... | |
int | pargemslr::DenseMatrixInvertUpperTriangularHost (DenseMatrixClass< complexs > &A) |
Compute the inverese of a upper triangular single complex matrix. More... | |
int | pargemslr::DenseMatrixInvertUpperTriangularHost (DenseMatrixClass< complexd > &A) |
Compute the inverese of a upper triangular double complex matrix. More... | |
int | pargemslr::DenseMatrixQRDecompositionHost (DenseMatrixClass< float > &A, DenseMatrixClass< float > &Q) |
Compute the thin QR decomposition of mxn matrix A = QR. When m >= n, Q is mxn and R is nxn. When n > m, Q is mxm and R is mxn. More... | |
int | pargemslr::DenseMatrixQRDecompositionHost (DenseMatrixClass< double > &A, DenseMatrixClass< double > &Q) |
Compute the thin QR decomposition of mxn matrix A = QR. When m >= n, Q is mxn and R is nxn. When n > m, Q is mxm and R is mxn. More... | |
int | pargemslr::DenseMatrixQRDecompositionHost (DenseMatrixClass< complexs > &A, DenseMatrixClass< complexs > &Q) |
Compute the thin QR decomposition of mxn matrix A = QR. When m >= n, Q is mxn and R is nxn. When n > m, Q is mxm and R is mxn. More... | |
int | pargemslr::DenseMatrixQRDecompositionHost (DenseMatrixClass< complexd > &A, DenseMatrixClass< complexd > &Q) |
Compute the thin QR decomposition of mxn matrix A = QR. When m >= n, Q is mxn and R is nxn. When n > m, Q is mxm and R is mxn. More... | |
int | pargemslr::DenseMatrixHessDecompositionHost (DenseMatrixClass< float > &A, DenseMatrixClass< float > &Q) |
Transform a dense float matrix A into hessenberg matrix Q^HAQ = Hess. More... | |
int | pargemslr::DenseMatrixHessDecompositionHost (DenseMatrixClass< float > &A, int start, int end, DenseMatrixClass< float > &Q) |
Transform a dense float matrix A into hessenberg matrix Q^HAQ = Hess. More... | |
int | pargemslr::DenseMatrixHessDecompositionHost (DenseMatrixClass< double > &A, DenseMatrixClass< double > &Q) |
Transform a dense double matrix A into hessenberg matrix Q^HAQ = Hess. More... | |
int | pargemslr::DenseMatrixHessDecompositionHost (DenseMatrixClass< double > &A, int start, int end, DenseMatrixClass< double > &Q) |
Transform a dense double matrix A into hessenberg matrix Q^HAQ = Hess. More... | |
int | pargemslr::DenseMatrixHessDecompositionHost (DenseMatrixClass< complexs > &A, DenseMatrixClass< complexs > &Q) |
Transform a dense single complex matrix A into hessenberg matrix Q^HAQ = Hess. More... | |
int | pargemslr::DenseMatrixHessDecompositionHost (DenseMatrixClass< complexs > &A, int start, int end, DenseMatrixClass< complexs > &Q) |
Transform a dense single complex matrix A into hessenberg matrix Q^HAQ = Hess. More... | |
int | pargemslr::DenseMatrixHessDecompositionHost (DenseMatrixClass< complexd > &A, DenseMatrixClass< complexd > &Q) |
Transform a dense double complex matrix A into hessenberg matrix Q^HAQ = Hess. More... | |
int | pargemslr::DenseMatrixHessDecompositionHost (DenseMatrixClass< complexd > &A, int start, int end, DenseMatrixClass< complexd > &Q) |
Transform a dense double complex matrix A into hessenberg matrix Q^HAQ = Hess. More... | |
int | pargemslr::DenseMatrixRealHessSchurDecompositionHost (DenseMatrixClass< float > &A, DenseMatrixClass< float > &Q, vector_seq_float &wr, vector_seq_float &wi) |
Compute the Schur decomposition of a float dense hessenberg matrix A = QUQ^H. More... | |
int | pargemslr::DenseMatrixRealHessSchurDecompositionHost (DenseMatrixClass< float > &A, int start, int end, DenseMatrixClass< float > &Q, vector_seq_float &wr, vector_seq_float &wi) |
Compute the Schur decomposition of a float dense hessenberg matrix A = QUQ^H. More... | |
int | pargemslr::DenseMatrixRealHessSchurDecompositionHost (DenseMatrixClass< double > &A, DenseMatrixClass< double > &Q, vector_seq_double &wr, vector_seq_double &wi) |
Compute the Schur decomposition of a double dense hessenberg matrix A = QUQ^H. More... | |
int | pargemslr::DenseMatrixRealHessSchurDecompositionHost (DenseMatrixClass< double > &A, int start, int end, DenseMatrixClass< double > &Q, vector_seq_double &wr, vector_seq_double &wi) |
Compute the Schur decomposition of a double dense hessenberg matrix A = QUQ^H. More... | |
int | pargemslr::DenseMatrixComplexHessSchurDecompositionHost (DenseMatrixClass< complexs > &A, DenseMatrixClass< complexs > &Q, vector_seq_complexs &w) |
Compute the Schur decomposition of a single complex dense hessenberg matrix A = QUQ^H. More... | |
int | pargemslr::DenseMatrixComplexHessSchurDecompositionHost (DenseMatrixClass< complexs > &A, int start, int end, DenseMatrixClass< complexs > &Q, vector_seq_complexs &w) |
Compute the Schur decomposition of a single complex dense hessenberg matrix A = QUQ^H. More... | |
int | pargemslr::DenseMatrixComplexHessSchurDecompositionHost (DenseMatrixClass< complexd > &A, DenseMatrixClass< complexd > &Q, vector_seq_complexd &w) |
Compute the Schur decomposition of a double complex dense hessenberg matrix A = QUQ^H. More... | |
int | pargemslr::DenseMatrixComplexHessSchurDecompositionHost (DenseMatrixClass< complexd > &A, int start, int end, DenseMatrixClass< complexd > &Q, vector_seq_complexd &w) |
Compute the Schur decomposition of a double complex dense hessenberg matrix A = QUQ^H. More... | |
int | pargemslr::DenseMatrixRealOrderSchur (DenseMatrixClass< float > &A, DenseMatrixClass< float > &Q, vector_seq_float &wr, vector_seq_float &wi, vector_int &select) |
Reorder the float schur decomposition, puch selected eigenvalues to the leading part. More... | |
int | pargemslr::DenseMatrixRealOrderSchur (DenseMatrixClass< double > &A, DenseMatrixClass< double > &Q, vector_seq_double &wr, vector_seq_double &wi, vector_int &select) |
Reorder the double schur decomposition, puch selected eigenvalues to the leading part. More... | |
int | pargemslr::DenseMatrixComplexOrderSchur (DenseMatrixClass< complexs > &A, DenseMatrixClass< complexs > &Q, vector_seq_complexs &w, vector_int &select) |
Reorder the single complex schur decomposition, puch selected eigenvalues to the leading part. More... | |
int | pargemslr::DenseMatrixComplexOrderSchur (DenseMatrixClass< complexd > &A, DenseMatrixClass< complexd > &Q, vector_seq_complexd &w, vector_int &select) |
Reorder the double complex schur decomposition, puch selected eigenvalues to the leading part. More... | |
int | pargemslr::DenseMatrixRealOrderSchurClusters (DenseMatrixClass< float > &A, DenseMatrixClass< float > &Q, vector_seq_float &wr, vector_seq_float &wi, vector_int &clusters) |
Reorder the float schur decomposition, puch selected eigenvalues to the leading part. More... | |
int | pargemslr::DenseMatrixRealOrderSchurClusters (DenseMatrixClass< double > &A, DenseMatrixClass< double > &Q, vector_seq_double &wr, vector_seq_double &wi, vector_int &clusters) |
Reorder the double schur decomposition, puch selected eigenvalues to the leading part. More... | |
int | pargemslr::DenseMatrixComplexOrderSchurClusters (DenseMatrixClass< complexs > &A, DenseMatrixClass< complexs > &Q, vector_seq_complexs &w, vector_int &clusters) |
Reorder the single complex schur decomposition, puch selected eigenvalues to the leading part. More... | |
int | pargemslr::DenseMatrixComplexOrderSchurClusters (DenseMatrixClass< complexd > &A, DenseMatrixClass< complexd > &Q, vector_seq_complexd &w, vector_int &clusters) |
Reorder the double complex schur decomposition, puch selected eigenvalues to the leading part. More... | |
int | pargemslr::DenseMatrixRealHessEigenDecompositionHost (DenseMatrixClass< float > &A, DenseMatrixClass< float > &Q, vector_seq_float &wr, vector_seq_float &wi) |
Compute the Eigen decomposition of float dense hessenberg matrix A, AQ = QD. A is not modified. More... | |
int | pargemslr::DenseMatrixRealHessEigenDecompositionHost (DenseMatrixClass< double > &A, DenseMatrixClass< double > &Q, vector_seq_double &wr, vector_seq_double &wi) |
Compute the Eigen decomposition of double dense hessenberg matrix A, AQ = QD. A is not modified. More... | |
int | pargemslr::DenseMatrixComplexHessEigenDecompositionHost (DenseMatrixClass< complexs > &A, DenseMatrixClass< complexs > &Q, vector_seq_complexs &w) |
Compute the Eigen decomposition of single complex dense hessenberg matrix A, AQ = QD. A is not modified. More... | |
int | pargemslr::DenseMatrixComplexHessEigenDecompositionHost (DenseMatrixClass< complexd > &A, DenseMatrixClass< complexd > &Q, vector_seq_complexd &w) |
Compute the Eigen decomposition of double complex dense hessenberg matrix A, AQ = QD. A is not modified. More... | |
template<typename T > | |
int | pargemslr::DenseMatrixMatMatTemplate (const T &alpha, const DenseMatrixClass< T > &A, char transa, const DenseMatrixClass< T > &B, char transb, const T &beta, DenseMatrixClass< T > &C) |
Dense float Matrix-Matrix multiplication, C = alpha*transa(A)*transb(B)+beta*C. More... | |
int | pargemslr::DenseMatrixMatMat (const float &alpha, const DenseMatrixClass< float > &A, char transa, const DenseMatrixClass< float > &B, char transb, const float &beta, DenseMatrixClass< float > &C) |
Dense float Matrix-Matrix multiplication, C = alpha*transa(A)*transb(B)+beta*C. More... | |
int | pargemslr::DenseMatrixMatMat (const double &alpha, const DenseMatrixClass< double > &A, char transa, const DenseMatrixClass< double > &B, char transb, const double &beta, DenseMatrixClass< double > &C) |
Dense float Matrix-Matrix multiplication, C = alpha*transa(A)*transb(B)+beta*C. More... | |
int | pargemslr::DenseMatrixMatMat (const complexs &alpha, const DenseMatrixClass< complexs > &A, char transa, const DenseMatrixClass< complexs > &B, char transb, const complexs &beta, DenseMatrixClass< complexs > &C) |
Dense float Matrix-Matrix multiplication, C = alpha*transa(A)*transb(B)+beta*C. More... | |
int | pargemslr::DenseMatrixMatMat (const complexd &alpha, const DenseMatrixClass< complexd > &A, char transa, const DenseMatrixClass< complexd > &B, char transb, const complexd &beta, DenseMatrixClass< complexd > &C) |
Dense float Matrix-Matrix multiplication, C = alpha*transa(A)*transb(B)+beta*C. More... | |
template<typename T > | |
int | pargemslr::CsrMatrixPMatVecHostTemplate (const int *ia, const int *ja, const T *aa, int nrows, int ncols, char trans, const T &alpha, const T *x, const T &beta, T *y) |
In place float csr Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y. More... | |
int | pargemslr::CsrMatrixPMatVecHost (const int *ia, const int *ja, const float *aa, int nrows, int ncols, char trans, const float &alpha, const float *x, const float &beta, float *y) |
In place csr Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y. More... | |
int | pargemslr::CsrMatrixPMatVecHost (const int *ia, const int *ja, const double *aa, int nrows, int ncols, char trans, const double &alpha, const double *x, const double &beta, double *y) |
In place double csr Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y. More... | |
int | pargemslr::CsrMatrixPMatVecHost (const int *ia, const int *ja, const complexs *aa, int nrows, int ncols, char trans, const complexs &alpha, const complexs *x, const complexs &beta, complexs *y) |
In place single complex csr Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y. More... | |
int | pargemslr::CsrMatrixPMatVecHost (const int *ia, const int *ja, const complexd *aa, int nrows, int ncols, char trans, const complexd &alpha, const complexd *x, const complexd &beta, complexd *y) |
In place double complex csr Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y. More... | |
int | pargemslr::CsrMatrixMatVec (const CsrMatrixClass< float > &A, char trans, const float &alpha, const VectorClass< float > &x, const float &beta, VectorClass< float > &y) |
In place float csr Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y. More... | |
int | pargemslr::CsrMatrixMatVec (const CsrMatrixClass< double > &A, char trans, const double &alpha, const VectorClass< double > &x, const double &beta, VectorClass< double > &y) |
In place double csr Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y. More... | |
int | pargemslr::CsrMatrixMatVec (const CsrMatrixClass< complexs > &A, char trans, const complexs &alpha, const VectorClass< complexs > &x, const complexs &beta, VectorClass< complexs > &y) |
In place single complex csr Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y. More... | |
int | pargemslr::CsrMatrixMatVec (const CsrMatrixClass< complexd > &A, char trans, const complexd &alpha, const VectorClass< complexd > &x, const complexd &beta, VectorClass< complexd > &y) |
In place double complex csr Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y. More... | |
template<int INIDX, int OUTIDX, typename T > | |
int | pargemslr::CsrMatrixP2CscMatrixPHost (int nrows, int ncols, bool copy_data, T *ai, int *ji, int *ii, T *ao, int *jo, int *io) |
Converts a csr matrix to csc matrix. More... | |
template<int INIDX, int OUTIDX, typename T > | |
int | pargemslr::CooMatrixP2CsrMatrixPHost (int nrows, int ncols, int nnz, T *ai, int *ji, int *ii, T *ao, int *jo, int *io) |
Converts a coo matrix to csr matrix. More... | |
template<typename T > | |
int | pargemslr::CsrMatrixTransposeHost (CsrMatrixClass< T > &A, CsrMatrixClass< T > &AT) |
Compute the transpose of a csr/csc matrix. More... | |
template<typename T > | |
int | pargemslr::CsrMatrixAddHost (CsrMatrixClass< T > &A, CsrMatrixClass< T > &B, CsrMatrixClass< T > &C) |
Add sparse matrix in CSR format, C= A + B. More... | |
template<typename T > | |
int | pargemslr::ParallelCsrMatrixTransposeHost (ParallelCsrMatrixClass< T > &A, ParallelCsrMatrixClass< T > &AT) |
Compute the transpose of a parallel csr matrix. More... | |
template<typename T > | |
int | pargemslr::ParallelCsrMatrixAddHost (ParallelCsrMatrixClass< T > &A, ParallelCsrMatrixClass< T > &B, ParallelCsrMatrixClass< T > &C) |
Add sparse matrix in Parallel CSR format, C= A + B. More... | |
template<typename T > | |
int | pargemslr::CsrMatrixMetisKwayHost (CsrMatrixClass< T > &A, int &num_dom, IntVectorClass< int > &map, bool vertexsep, IntVectorClass< int > &sep, int &edgecut, IntVectorClass< int > &perm, IntVectorClass< int > &dom_ptr) |
Kway metis partition. For the vertex seperator, we only supports 2-way vertex seperator. More... | |
template<typename T > | |
int | pargemslr::CsrMatrixMaxMatchingHost (CsrMatrixClass< T > &A, int &nmatch, IntVectorClass< int > &match_row, IntVectorClass< int > &match_col) |
Use Hopcroft–Karp algorithm to find a maximal matching. More... | |
bool | pargemslr::CsrMatrixMaxMatchingBfsHost (int nrows, int ncols, int *A_i, int *A_j, IntVectorClass< int > &dist, IntVectorClass< int > &match_row, IntVectorClass< int > &match_col) |
The BFS for maximal matching algorithm. More... | |
bool | pargemslr::CsrMatrixMaxMatchingDfsHost (int nrows, int ncols, int *A_i, int *A_j, IntVectorClass< int > &dist, IntVectorClass< int > &match_row, IntVectorClass< int > &match_col, int i) |
The BFS for maximal matching algorithm. More... | |
template<typename T > | |
int | pargemslr::CsrMatrixSortRow (CsrMatrixClass< T > &A) |
Sort columns inside each row of a real csr matrix by ascending order. More... | |
template<typename T > | |
int | pargemslr::CsrSubMatrixAmdHost (CsrMatrixClass< T > &A, vector_int &rowscols, vector_int &perm) |
This function computes the AMD ordering of a submatrix A[rowscols,rowscols] + trans(A[rowscols,rowscols]). More... | |
template<typename T > | |
int | pargemslr::CsrMatrixAmdHost (CsrMatrixClass< T > &A, vector_int &perm) |
This function computes the Amd ordering of a CSR matrix A+trans(A). More... | |
template<typename T > | |
int | pargemslr::CsrSubMatrixNdHost (CsrMatrixClass< T > &A, vector_int &rowscols, vector_int &perm) |
This function computes the ND ordering of a submatrix A[rowscols,rowscols]. More... | |
template<typename T > | |
int | pargemslr::CsrMatrixNdHost (CsrMatrixClass< T > &A, vector_int &perm) |
This function computes the ND ordering of a CSR matrix A. More... | |
template<typename T > | |
int | pargemslr::CsrSubMatrixRcmHost (CsrMatrixClass< T > &A, vector_int &rowscols, vector_int &perm) |
This function computes the RCM ordering of a submatrix A[rowscols,rowscols] + trans(A[rowscols,rowscols]). More... | |
template<typename T > | |
int | pargemslr::CsrMatrixRcmHost (CsrMatrixClass< T > &A, vector_int &perm) |
This function computes the RCM ordering of a CSR matrix A+trans(A). More... | |
template<typename T > | |
int | pargemslr::CsrMatrixRcmRootHost (CsrMatrixClass< T > &G, vector_int &marker, int &root) |
This function find the next root for the RCM ordering of graph G. More... | |
template<typename T > | |
int | pargemslr::CsrMatrixRcmNumberingHost (CsrMatrixClass< T > &G, int root, vector_int &marker, vector_int &perm, int ¤t_num) |
This function computes the RCM numbering for a connect component start from root. More... | |
template<typename T > | |
int | pargemslr::CsrMatrixRcmPerphnHost (CsrMatrixClass< T > &G, int &root, vector_int &marker) |
This function find an end of the pseudo-peripheral starting from the root. More... | |
template<typename T > | |
int | pargemslr::CsrMatrixRcmBfsHost (CsrMatrixClass< T > &G, int root, vector_int &marker, std::vector< std::vector< int > > &level) |
This function builds the level structure starting from node root. More... | |
int | pargemslr::CsrMatrixRcmClearLevelHost (std::vector< std::vector< int > > &level) |
This function frees the level structure. More... | |
int | pargemslr::CsrMatrixRcmSwapHost (vector_int &perm, int a, int b) |
This function swap two element in the perm array. More... | |
int | pargemslr::CsrMatrixRcmReverseHost (vector_int &perm, int start, int end) |
This function reverse an array between [start,end]. More... | |
int | pargemslr::ParmetisKwayHost (vector_long &vtxdist, vector_long &xadj, vector_long &adjncy, long int &num_dom, vector_long &map, parallel_log &parlog) |
Call ParMETIS to partition A based on the adjancency graph of A. More... | |
int | pargemslr::ParmetisNodeND (vector_long &vtxdist, vector_long &xadj, vector_long &adjncy, long int &num_dom, vector_long &map, parallel_log &parlog) |
Partition with log(p) levels nd, p is the number of processors. More... | |
template<class VectorType , class MatrixType , typename DataType , typename RealDataType > | |
int | pargemslr::PargemslrSubSpaceIteration (MatrixType &A, int k, int its, DenseMatrixClass< DataType > &V, DenseMatrixClass< DataType > &H, RealDataType tol) |
The subspace iteration procedure on a matrix. Note that we do not check for convergence. Apply a fixed number of iterations. More... | |
template<class VectorType , class MatrixType , typename DataType , typename RealDataType > | |
int | pargemslr::PargemslrArnoldiNoRestart (MatrixType &A, int mstart, int msteps, DenseMatrixClass< DataType > &V, DenseMatrixClass< DataType > &H, RealDataType tol_orth, RealDataType tol_reorth) |
The standard Arnoldi procedure on a matrix. More... | |
template<class VectorType , class MatrixType , typename DataType , typename RealDataType > | |
int | pargemslr::PargemslrArnoldiThickRestartNoLock (MatrixType &A, int msteps, int maxits, int rank, int rank2, RealDataType truncate, RealDataType tr_fact, RealDataType tol_eig, RealDataType eig_target_mag, RealDataType eig_truncate, RealDataType(*weight)(ComplexValueClass< RealDataType >), DenseMatrixClass< DataType > &V, DenseMatrixClass< DataType > &H, RealDataType tol_orth, RealDataType tol_reorth) |
The thick-restart Arnoldi without locking. This version should be used when convergence tolerance is high. More... | |
template<typename T > | |
int | pargemslr::PargemslrArnoldiThickRestartChooseEigenValuesReal (DenseMatrixClass< T > &H, DenseMatrixClass< T > &Q, T h_last, T(*weight)(ComplexValueClass< T >), T truncate, int &ncov, int &nicov, int &nsatis, T tol_eig, T eig_target_mag, T eig_truncate, bool &cut, SequentialVectorClass< T > &wr, SequentialVectorClass< T > &wi, vector_int &icov, vector_int &iicov, vector_int &isatis, SequentialVectorClass< T > &dcov, SequentialVectorClass< T > &dicov, SequentialVectorClass< T > &dsatis) |
Pick convergenced eigenvalues and unconvergenced eigenvalues. More... | |
template<typename DataType , typename RealDataType > | |
int | pargemslr::PargemslrArnoldiThickRestartChooseEigenValuesComplex (DenseMatrixClass< DataType > &H, DenseMatrixClass< DataType > &Q, DataType h_last, RealDataType(*weight)(DataType), RealDataType truncate, int &ncov, int &nicov, int &nsatis, RealDataType tol_eig, RealDataType eig_target_mag, RealDataType eig_truncate, bool &cut, SequentialVectorClass< DataType > &w, vector_int &icov, vector_int &iicov, vector_int &isatis, SequentialVectorClass< RealDataType > &dcov, SequentialVectorClass< RealDataType > &dicov, SequentialVectorClass< RealDataType > &dsatis) |
Pick convergenced eigenvalues and unconvergenced eigenvalues. More... | |
template<class VectorType , typename DataType , typename RealDataType > | |
int | pargemslr::PargemslrArnoldiThickRestartBuildThickRestartNewVector (DenseMatrixClass< DataType > &V, DenseMatrixClass< DataType > &H, int m, RealDataType tol_orth, RealDataType tol_reorth, VectorType &v) |
The current V is a invarient subspace, pick a new vector to restart. More... | |
template<class VectorType , typename DataType , typename RealDataType > | |
int | pargemslr::PargemslrCgs2 (VectorType &w, DenseMatrixClass< DataType > &V, DenseMatrixClass< DataType > &H, RealDataType &t, int k, RealDataType tol_orth) |
The classical Gram-Schmidt with re-orthgonal (always one step of re-orth). More... | |
template<class VectorType , typename DataType , typename RealDataType > | |
int | pargemslr::PargemslrMgs (VectorType &w, DenseMatrixClass< DataType > &V, DenseMatrixClass< DataType > &H, RealDataType &t, int k, RealDataType tol_orth, RealDataType tol_reorth) |
The modified Gram-Schmidt with re-orthgonal. More... | |
template<class VectorType , typename DataType , typename RealDataType > | |
int | pargemslr::PargemslrOrthogonal (VectorType &w, DenseMatrixClass< DataType > &V, RealDataType &t, int k, RealDataType tol_orth, RealDataType tol_reorth) |
The modified Gram-Schmidt with re-orthgonal without H matrix. More... | |
template<typename T > | |
int | pargemslr::DenseMatrixPlotHost (DenseMatrixClass< T > &A, int conditiona, int conditionb, int width) |
Plot the dense matrix to the terminal output. Function for testing purpose. More... | |
template<typename T > | |
int | pargemslr::CsrMatrixPlotHost (CsrMatrixClass< T > &A, int *perm, int conditiona, int conditionb, int width) |
Plot the csr matrix to the terminal output. Function for testing purpose. More... | |
int | pargemslr::CooMatrixReadFromFile (CooMatrixClass< float > &coo, const char *matfile, int idxin, int idxout) |
Read a coo matrix from matrix marker format file. More... | |
int | pargemslr::CooMatrixReadFromFile (CooMatrixClass< double > &coo, const char *matfile, int idxin, int idxout) |
Read a coo matrix from matrix marker format file. More... | |
int | pargemslr::CooMatrixReadFromFile (CooMatrixClass< complexs > &coo, const char *matfile, int idxin, int idxout) |
Read a coo matrix from matrix marker format file. More... | |
int | pargemslr::CooMatrixReadFromFile (CooMatrixClass< complexd > &coo, const char *matfile, int idxin, int idxout) |
Read a coo matrix from matrix marker format file. More... | |
template<typename T > | |
int | pargemslr::SetupPermutationRKwayRecursive (CsrMatrixClass< T > &A, bool vertexsep, int clvl, int &tlvl, int num_dom, int minsep, int kmin, int kfactor, vector_int &map_v, vector_int &mapptr_v) |
Recursive KWay partition call. More... | |
template<typename T > | |
int | pargemslr::SetupPermutationNDRecursive (CsrMatrixClass< T > &A, bool vertexsep, int clvl, int &tlvl, int minsep, std::vector< std::vector< vector_int > > &level_str) |
Recursive ND partition call. More... | |
int | pargemslr::SetupPermutationNDCombineLevels (std::vector< vector_int > &level_stri, int &ndom) |
Compress a certain level of level_str from SetupPermutationNDRecursive into a give number of domains. More... | |
template<typename T > | |
int | pargemslr::ParallelCsrMatrixSetupPermutationParallelRKway (ParallelCsrMatrixClass< T > &A, bool vertexsep, int &nlev, long int ncomp, long int minsep, long int kmin, long int kfactor, vector_int &map_v, vector_int &mapptr_v, bool bj_last) |
The main recursive Kway reordering function. More... | |
int | pargemslr::SetupPermutationParallelRKwayRecursive (vector_long &vtxdist, vector_long &xadj, vector_long &adjncy, int clvl, int &tlvl, long int ncomp, long int minsep, long int kmin, long int kfactor, vector_int &map_v, vector_int &mapptr_v, bool bj_last, parallel_log &parlog) |
This is the recursive function to build the mapping information. More... | |
int | pargemslr::ParallelRKwayGetSeparator (vector_long &vtxdist, vector_long &xadj, vector_long &adjncy, vector_long &vtxdist_s, vector_long &xadj_s, vector_long &adjncy_s, vector_long &map, int num_dom, vector_int &vtxsep, parallel_log &parlog) |
This function finds the edge separator based on the map information. More... | |
template<typename T > | |
int | pargemslr::SetupPermutationParallelRKwayRecursive2 (ParallelCsrMatrixClass< T > &A, int clvl, int &tlvl, long int ncomp, long int minsep, long int kmin, long int kfactor, vector_int &map_v, vector_int &mapptr_v, bool bj_last, parallel_log &parlog) |
This is the recursive function to build the mapping information, using an approximate vetrex separator (not the minimal). More... | |
template<typename T > | |
int | pargemslr::SetupPermutationParallelKwayVertexSep (ParallelCsrMatrixClass< T > &A, long int &ncomp, vector_int &map_v, vector_long &perm_sep, parallel_log &parlog) |
This function build the k-way partition where k is the power of 2, and provide an approximate vertex saperator. More... | |
template<typename T > | |
int | pargemslr::SetupPermutationParallelKwayVertexSepRecursive (ParallelCsrMatrixClass< T > &A, int clvl, int tlvl, bool &succeed, vector_int &map_v, parallel_log &parlog) |
This recursie call function for building the k-way partition where k is the power of 2, and provide an approximate vertex saperator. More... | |
int | pargemslr::ParallelNDGetSeparator (vector_long &vtxdist, vector_long &xadj, vector_long &adjncy, vector_long &map, long int &ndom1, long int &ndom2, long int &edge_cut, parallel_log &parlog) |
This function finds the vertex separator based on the map information. A very simple appraoch, find the edge separator and only keep one side. More... | |
template<typename T > | |
int | pargemslr::ParallelCsrMatrixSetupPermutationParallelND (ParallelCsrMatrixClass< T > &A, bool vertexsep, int &nlev, long int minsep, vector_int &map_v, vector_int &mapptr_v) |
The main ND reordering function using ND in the ParMETIS. More... | |
template<typename T > | |
int | pargemslr::ParallelCsrMatrixSetupIOOrder (ParallelCsrMatrixClass< T > &parcsr_in, vector_int &local_perm, int &nI, CsrMatrixClass< T > &B_mat, CsrMatrixClass< T > &E_mat, CsrMatrixClass< T > &F_mat, ParallelCsrMatrixClass< T > &C_mat, int perm_option, bool perm_c) |
Setup the local order splits the interior and exterior nodes. More... | |
Matrix operations.
DenseMatrixXxx: functions for dense matrices.
CsrMatrixXxx: functions for csr/csc matrices.
int pargemslr::CooMatrixP2CsrMatrixPHost | ( | int | nrows, |
int | ncols, | ||
int | nnz, | ||
T * | ai, | ||
int * | ji, | ||
int * | ii, | ||
T * | ao, | ||
int * | jo, | ||
int * | io | ||
) |
Converts a coo matrix to csr matrix.
[in] | INIDX | specifies if COO should be 0/1 index. |
[in] | OUTIDX | specifies if CSR should be 0/1 index. |
[in] | nrows | Number of rows. |
[in] | ncols | Number of columns. |
[in] | nnz | Number of nonzero entries. |
[in] | ai | Data vector of the input coo matrix. |
[in] | ji | Col indices vector of the input coo matrix. |
[in] | ii | Row indices vector of the input coo matrix. |
[out] | ao | Data vector for the output csr matrix. |
[out] | jo | J vector for the output csr matrix. |
[out] | io | I vector for the output csr matrix. |
int pargemslr::CooMatrixReadFromFile | ( | CooMatrixClass< complexd > & | coo, |
const char * | matfile, | ||
int | idxin, | ||
int | idxout | ||
) |
Read a coo matrix from matrix marker format file.
[out] | coo | The return matrix. |
[in] | matfile | The file name. |
[in] | idxin | The index base of the input matrix, 0-based or 1-based. |
[in] | idxin | The index base of the output matrix, 0-based or 1-based. |
int pargemslr::CooMatrixReadFromFile | ( | CooMatrixClass< complexs > & | coo, |
const char * | matfile, | ||
int | idxin, | ||
int | idxout | ||
) |
Read a coo matrix from matrix marker format file.
[out] | coo | The return matrix. |
[in] | matfile | The file name. |
[in] | idxin | The index base of the input matrix, 0-based or 1-based. |
[in] | idxin | The index base of the output matrix, 0-based or 1-based. |
int pargemslr::CooMatrixReadFromFile | ( | CooMatrixClass< double > & | coo, |
const char * | matfile, | ||
int | idxin, | ||
int | idxout | ||
) |
Read a coo matrix from matrix marker format file.
[out] | coo | The return matrix. |
[in] | matfile | The file name. |
[in] | idxin | The index base of the input matrix, 0-based or 1-based. |
[in] | idxin | The index base of the output matrix, 0-based or 1-based. |
int pargemslr::CooMatrixReadFromFile | ( | CooMatrixClass< float > & | coo, |
const char * | matfile, | ||
int | idxin, | ||
int | idxout | ||
) |
Read a coo matrix from matrix marker format file.
[out] | coo | The return matrix. |
[in] | matfile | The file name. |
[in] | idxin | The index base of the input matrix, 0-based or 1-based. |
[in] | idxin | The index base of the output matrix, 0-based or 1-based. |
int pargemslr::CsrMatrixAddHost | ( | CsrMatrixClass< T > & | A, |
CsrMatrixClass< T > & | B, | ||
CsrMatrixClass< T > & | C | ||
) |
Add sparse matrix in CSR format, C= A + B.
[in] | A | Matrix A. |
[in] | B | Matrix B. |
[out] | C | Matrix C = A + B. |
int pargemslr::CsrMatrixAmdHost | ( | CsrMatrixClass< T > & | A, |
vector_int & | perm | ||
) |
This function computes the Amd ordering of A+trans(A).
[in] | A | The target CSR matrix. |
[out] | perm | The RCM permutation. |
int pargemslr::CsrMatrixMatVec | ( | const CsrMatrixClass< complexd > & | A, |
char | trans, | ||
const complexd & | alpha, | ||
const VectorClass< complexd > & | x, | ||
const complexd & | beta, | ||
VectorClass< complexd > & | y | ||
) |
In place double complex csr Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y.
[in] | A | The matrix. |
[in] | trans | Whether or not transpose matrix A. |
[in] | alpha | The alpha value. |
[in] | x | The left vector. |
[in] | beta | The beta value. |
[in,out] | y | The product vector. |
int pargemslr::CsrMatrixMatVec | ( | const CsrMatrixClass< complexs > & | A, |
char | trans, | ||
const complexs & | alpha, | ||
const VectorClass< complexs > & | x, | ||
const complexs & | beta, | ||
VectorClass< complexs > & | y | ||
) |
In place single complex csr Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y.
[in] | A | The matrix. |
[in] | trans | Whether or not transpose matrix A. |
[in] | alpha | The alpha value. |
[in] | x | The left vector. |
[in] | beta | The beta value. |
[in,out] | y | The product vector. |
int pargemslr::CsrMatrixMatVec | ( | const CsrMatrixClass< double > & | A, |
char | trans, | ||
const double & | alpha, | ||
const VectorClass< double > & | x, | ||
const double & | beta, | ||
VectorClass< double > & | y | ||
) |
In place double csr Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y.
[in] | A | The matrix. |
[in] | trans | Whether or not transpose matrix A. |
[in] | alpha | The alpha value. |
[in] | x | The left vector. |
[in] | beta | The beta value. |
[in,out] | y | The product vector. |
int pargemslr::CsrMatrixMatVec | ( | const CsrMatrixClass< float > & | A, |
char | trans, | ||
const float & | alpha, | ||
const VectorClass< float > & | x, | ||
const float & | beta, | ||
VectorClass< float > & | y | ||
) |
In place float csr Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y.
[in] | A | The matrix. |
[in] | trans | Whether or not transpose matrix A. |
[in] | alpha | The alpha value. |
[in] | x | The left vector. |
[in] | beta | The beta value. |
[in,out] | y | The product vector. |
bool pargemslr::CsrMatrixMaxMatchingBfsHost | ( | int | nrows, |
int | ncols, | ||
int * | A_i, | ||
int * | A_j, | ||
IntVectorClass< int > & | dist, | ||
IntVectorClass< int > & | match_row, | ||
IntVectorClass< int > & | match_col | ||
) |
The BFS for maximal matching algorithm.
[in] | nrows | The number of rows. |
[in] | ncols | The number of cols. |
[in] | A_i | The I in CSR format. |
[in] | A_j | The J in CSR format. |
[in] | dist | The distance array. |
[in] | match_row | The match array for rows. |
[in] | match_col | The match array for cols. |
bool pargemslr::CsrMatrixMaxMatchingDfsHost | ( | int | nrows, |
int | ncols, | ||
int * | A_i, | ||
int * | A_j, | ||
IntVectorClass< int > & | dist, | ||
IntVectorClass< int > & | match_row, | ||
IntVectorClass< int > & | match_col, | ||
int | i | ||
) |
The BFS for maximal matching algorithm.
[in] | nrows | The number of rows. |
[in] | ncols | The number of cols. |
[in] | A_i | The I in CSR format. |
[in] | A_j | The J in CSR format. |
[in] | dist | The distance array. |
[in] | match_row | The match array for rows. |
[in] | match_col | The match array for cols. |
[in] | i | The start node. |
int pargemslr::CsrMatrixMaxMatchingHost | ( | CsrMatrixClass< T > & | A, |
int & | nmatch, | ||
IntVectorClass< int > & | match_row, | ||
IntVectorClass< int > & | match_col | ||
) |
Use Hopcroft–Karp algorithm to find a maximal matching.
[in] | A | Matrix A. |
[out] | nmatch | Number of matched pairs. |
[out] | match_row | The column map vector, match_row[i] = j if i-th row is mapping to j-th col, match_row[i] = -1 if not matched. |
[out] | match_col | The column map vector, match_col[i] = j if i-th col is mapping to j-th row, match_col[i] = -1 if not matched. |
int pargemslr::CsrMatrixMetisKwayHost | ( | CsrMatrixClass< T > & | A, |
int & | num_dom, | ||
IntVectorClass< int > & | map, | ||
bool | vertexsep, | ||
IntVectorClass< int > & | sep, | ||
int & | edgecut, | ||
IntVectorClass< int > & | perm, | ||
IntVectorClass< int > & | dom_ptr | ||
) |
Kway metis partition. For the vertex seperator, we only supports 2-way vertex seperator.
[in] | A | Matrix A. |
[in,out] | num_dom | Number of domains. |
[out] | map | The map vector, map[i] is the domain number of the ith node. |
[in] | vertexsep | Set to true to compute vertex seperator. Only work when num_dom is 2. |
[out] | sep | The seperator vector, sep[i] != 0 means the ith node is in the seperator. |
[out] | edgecut | The size of the nodes inside vertexsep. |
[out] | perm | The permutation array. |
[out] | dom_ptr | Pointer to the start node of each domain in the new order of length num_dom+1, the last entry is the size of A. |
int pargemslr::CsrMatrixNdHost | ( | CsrMatrixClass< T > & | A, |
vector_int & | perm | ||
) |
This function computes the ND ordering of a CSR matrix A.
[in] | A | The target CSR matrix. |
[out] | perm | The RCM permutation. |
int pargemslr::CsrMatrixP2CscMatrixPHost | ( | int | nrows, |
int | ncols, | ||
bool | copy_data, | ||
T * | ai, | ||
int * | ji, | ||
int * | ii, | ||
T * | ao, | ||
int * | jo, | ||
int * | io | ||
) |
Converts a csr matrix to csc matrix.
[in] | INIDX | specifies if COO should be 0/1 index. |
[in] | OUTIDX | specifies if CSR should be 0/1 index. |
[in] | nrow | Number of rows. |
[in] | ncol | Number of columns. |
[in] | copy_data | Whether we copy the data vector. |
[in] | ai | Data vector of the input csr matrix. |
[in] | ji | J vector of the input csr matrix. |
[in] | ii | I vector of the input csr matrix. |
[out] | ao | Data vector for the output csc matrix. |
[out] | jo | J vector for the output csc matrix. |
[out] | io | I vector for the output csc matrix. |
int pargemslr::CsrMatrixPlotHost | ( | CsrMatrixClass< T > & | A, |
int * | perm, | ||
int | conditiona, | ||
int | conditionb, | ||
int | width | ||
) |
Plot the csr matrix to the terminal output. Function for testing purpose.
[in] | A | The target matrix. |
[in] | perm | The permutation vector. Set to NULL to plot(A), otherwise plot(A(perm,perm)). |
[in] | conditiona | First condition. |
[in] | conditionb | Secend condition, only spy when conditiona == conditionb. |
[in] | width | The plot width. |
int pargemslr::CsrMatrixPMatVecHost | ( | const int * | ia, |
const int * | ja, | ||
const complexd * | aa, | ||
int | nrows, | ||
int | ncols, | ||
char | trans, | ||
const complexd & | alpha, | ||
const complexd * | x, | ||
const complexd & | beta, | ||
complexd * | y | ||
) |
In place double complex csr Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y.
[in] | ia | The column pointer vector. |
[in] | ja | The column vector. |
[in] | aa | The data pointer vector. |
[in] | nrows | The number of rows in the vector. |
[in] | ncolss | The number of cols in the vector. |
[in] | trans | Whether or not transpose matrix A. |
[in] | alpha | The alpha value. |
[in] | x | The left vector. |
[in] | beta | The beta value. |
[in,out] | y | The product vector. |
int pargemslr::CsrMatrixPMatVecHost | ( | const int * | ia, |
const int * | ja, | ||
const complexs * | aa, | ||
int | nrows, | ||
int | ncols, | ||
char | trans, | ||
const complexs & | alpha, | ||
const complexs * | x, | ||
const complexs & | beta, | ||
complexs * | y | ||
) |
In place single complex csr Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y.
[in] | ia | The column pointer vector. |
[in] | ja | The column vector. |
[in] | aa | The data pointer vector. |
[in] | nrows | The number of rows in the vector. |
[in] | ncolss | The number of cols in the vector. |
[in] | trans | Whether or not transpose matrix A. |
[in] | alpha | The alpha value. |
[in] | x | The left vector. |
[in] | beta | The beta value. |
[in,out] | y | The product vector. |
int pargemslr::CsrMatrixPMatVecHost | ( | const int * | ia, |
const int * | ja, | ||
const double * | aa, | ||
int | nrows, | ||
int | ncols, | ||
char | trans, | ||
const double & | alpha, | ||
const double * | x, | ||
const double & | beta, | ||
double * | y | ||
) |
In place double csr Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y.
[in] | ia | The column pointer vector. |
[in] | ja | The column vector. |
[in] | aa | The data pointer vector. |
[in] | nrows | The number of rows in the vector. |
[in] | ncolss | The number of cols in the vector. |
[in] | trans | Whether or not transpose matrix A. |
[in] | alpha | The alpha value. |
[in] | x | The left vector. |
[in] | beta | The beta value. |
[in,out] | y | The product vector. |
int pargemslr::CsrMatrixPMatVecHost | ( | const int * | ia, |
const int * | ja, | ||
const float * | aa, | ||
int | nrows, | ||
int | ncols, | ||
char | trans, | ||
const float & | alpha, | ||
const float * | x, | ||
const float & | beta, | ||
float * | y | ||
) |
In place csr Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y.
[in] | ia | The column pointer vector. |
[in] | ja | The column vector. |
[in] | aa | The data pointer vector. |
[in] | nrows | The number of rows in the vector. |
[in] | ncolss | The number of cols in the vector. |
[in] | trans | Whether or not transpose matrix A. |
[in] | alpha | The alpha value. |
[in] | x | The left vector. |
[in] | beta | The beta value. |
[in,out] | y | The product vector. |
int pargemslr::CsrMatrixPMatVecHostTemplate | ( | const int * | ia, |
const int * | ja, | ||
const T * | aa, | ||
int | nrows, | ||
int | ncols, | ||
char | trans, | ||
const T & | alpha, | ||
const T * | x, | ||
const T & | beta, | ||
T * | y | ||
) |
In place float csr Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y.
[in] | ia | The column pointer vector. |
[in] | ja | The column vector. |
[in] | aa | The data pointer vector. |
[in] | nrows | The number of rows in the vector. |
[in] | ncolss | The number of cols in the vector. |
[in] | trans | Whether or not transpose matrix A. |
[in] | alpha | The alpha value. |
[in] | x | The left vector. |
[in] | beta | The beta value. |
[in,out] | y | The product vector. |
int pargemslr::CsrMatrixRcmBfsHost | ( | CsrMatrixClass< T > & | G, |
int | root, | ||
vector_int & | marker, | ||
std::vector< std::vector< int > > & | level | ||
) |
This function builds the level structure starting from node root with BFS.
[in] | G | The target graph in CSR format. |
[in] | root | The node number of the root node. |
[in] | marker | Helper array of length equals to the size of G. |
[out] | level | The level structure |
int pargemslr::CsrMatrixRcmClearLevelHost | ( | std::vector< std::vector< int > > & | level | ) |
This function frees the level structure.
[in,out] | level | The level structure |
int pargemslr::CsrMatrixRcmHost | ( | CsrMatrixClass< T > & | A, |
vector_int & | perm | ||
) |
This function computes the RCM ordering of A+trans(A).
Connected component will be ordered by the node number of the first node in the original A in ascending order. So, if you have a block diagonal matrix, using this RCM function won't influence the block diagonal structure.
[in] | A | The target CSR matrix. |
[out] | perm | The RCM permutation. |
int pargemslr::CsrMatrixRcmNumberingHost | ( | CsrMatrixClass< T > & | G, |
int | root, | ||
vector_int & | marker, | ||
vector_int & | perm, | ||
int & | current_num | ||
) |
This function computes the RCM numbering for a connect component start from root.
[in] | G | The target graph in CSR format. |
[in] | root | The node number of the root node. |
[in] | marker | Helper array of length equals to the size of G. On return, value inside will be change so that we know this connect component is visited. |
[in,out] | perm | The permutation of this connect component will be in here. |
[in] | current_num | Start number of the current connect component. |
int pargemslr::CsrMatrixRcmPerphnHost | ( | CsrMatrixClass< T > & | G, |
int & | root, | ||
vector_int & | marker | ||
) |
This function find an end of the pseudo-peripheral starting from the root.
[in] | G | The target graph in CSR format. |
[in] | root | The node number of the root node. |
[in] | marker | Helper array of length equals to the size of G. |
int pargemslr::CsrMatrixRcmReverseHost | ( | vector_int & | perm, |
int | start, | ||
int | end | ||
) |
This function reverse an array between [start,end].
[in,out] | perm | The permutation vector |
[in] | start | The start index. |
[in] | end | The end index(includd). |
int pargemslr::CsrMatrixRcmRootHost | ( | CsrMatrixClass< T > & | G, |
vector_int & | marker, | ||
int & | root | ||
) |
This function find the next root for the RCM ordering of graph G.
It serachs for the lowest degree node in the next connect component.
[in] | G | The target graph in CSR format. |
[in] | marker | Helper array of length equals to the size of G. |
[out] | root | The node number of the root node. |
int pargemslr::CsrMatrixRcmSwapHost | ( | vector_int & | perm, |
int | a, | ||
int | b | ||
) |
This function swap two element in the perm array.
[in,out] | perm | The permutation vector |
[in] | a | One of the index. |
[in] | b | The other index. |
int pargemslr::CsrMatrixSortRow | ( | CsrMatrixClass< T > & | A | ) |
Sort columns inside each row of a real csr matrix by ascending order.
[in,out] | A | The target matrix. |
int pargemslr::CsrMatrixTransposeHost | ( | CsrMatrixClass< T > & | A, |
CsrMatrixClass< T > & | AT | ||
) |
Compute the transpose of a csr/csc matrix.
[in] | A | The input matrix. |
[out] | AT | The output transpose matrix. |
int pargemslr::CsrSubMatrixAmdHost | ( | CsrMatrixClass< T > & | A, |
vector_int & | rowscols, | ||
vector_int & | perm | ||
) |
This function computes the AMD ordering of a submatrix A[rowscols,rowscols] + trans(A[rowscols,rowscols]).
[in] | A | The target CSR matrix. |
[in] | rowscols | The target rows/cols. |
[out] | perm | The rcm order. |
int pargemslr::CsrSubMatrixNdHost | ( | CsrMatrixClass< T > & | A, |
vector_int & | rowscols, | ||
vector_int & | perm | ||
) |
This function computes the ND ordering of a submatrix A[rowscols,rowscols].
[in] | A | The target CSR matrix. |
[in] | rowscols | The target rows/cols. |
[out] | perm | The rcm order. |
int pargemslr::CsrSubMatrixRcmHost | ( | CsrMatrixClass< T > & | A, |
vector_int & | rowscols, | ||
vector_int & | perm | ||
) |
This function computes the RCM ordering of a submatrix A[rowscols,rowscols] + trans(A[rowscols,rowscols]).
[in] | A | The target CSR matrix. |
[in] | rowscols | The target rows/cols. |
[out] | perm | The rcm order. |
int pargemslr::DenseMatrixComplexHessEigenDecompositionHost | ( | DenseMatrixClass< complexd > & | A, |
DenseMatrixClass< complexd > & | Q, | ||
vector_seq_complexd & | w | ||
) |
Compute the Eigen decomposition of double complex dense hessenberg matrix A, AQ = QD. A is not modified.
[in] | A | The input matrix A. |
[out] | Q | the Q matrix AQ = QD. |
[in,out] | w | Array of real part of eigenvalues. |
int pargemslr::DenseMatrixComplexHessEigenDecompositionHost | ( | DenseMatrixClass< complexs > & | A, |
DenseMatrixClass< complexs > & | Q, | ||
vector_seq_complexs & | w | ||
) |
Compute the Eigen decomposition of single complex dense hessenberg matrix A, AQ = QD. A is not modified.
[in] | A | The input matrix A. |
[out] | Q | the Q matrix AQ = QD. |
[in,out] | w | Array of real part of eigenvalues. |
int pargemslr::DenseMatrixComplexHessSchurDecompositionHost | ( | DenseMatrixClass< complexd > & | A, |
DenseMatrixClass< complexd > & | Q, | ||
vector_seq_complexd & | w | ||
) |
Compute the Schur decomposition of a double complex dense hessenberg matrix A = QUQ^H.
[in,out] | A | The input matrix A, on return, the U matrix. |
[out] | Q | the Q matrix A = QUQ^H. |
[out] | w | Array of the eigenvalues. |
int pargemslr::DenseMatrixComplexHessSchurDecompositionHost | ( | DenseMatrixClass< complexd > & | A, |
int | start, | ||
int | end, | ||
DenseMatrixClass< complexd > & | Q, | ||
vector_seq_complexd & | w | ||
) |
Compute the Schur decomposition of a double complex dense hessenberg matrix A = QUQ^H.
[in,out] | A | The input matrix A, on return, the U matrix. |
[in] | start | |
[in] | end | Outside [start, end) the matrix is already upper triangular. |
[out] | Q | the Q matrix A = QUQ^H. |
[out] | w | Array of the eigenvalues. |
int pargemslr::DenseMatrixComplexHessSchurDecompositionHost | ( | DenseMatrixClass< complexs > & | A, |
DenseMatrixClass< complexs > & | Q, | ||
vector_seq_complexs & | w | ||
) |
Compute the Schur decomposition of a single complex dense hessenberg matrix A = QUQ^H.
[in,out] | A | The input matrix A, on return, the U matrix. |
[out] | Q | the Q matrix A = QUQ^H. |
[out] | w | Array of the eigenvalues. |
int pargemslr::DenseMatrixComplexHessSchurDecompositionHost | ( | DenseMatrixClass< complexs > & | A, |
int | start, | ||
int | end, | ||
DenseMatrixClass< complexs > & | Q, | ||
vector_seq_complexs & | w | ||
) |
Compute the Schur decomposition of a single complex dense hessenberg matrix A = QUQ^H.
[in,out] | A | The input matrix A, on return, the U matrix. |
[in] | start | |
[in] | end | Outside [start, end) the matrix is already upper triangular. |
[out] | Q | the Q matrix A = QUQ^H. |
[out] | w | Array of the eigenvalues. |
int pargemslr::DenseMatrixComplexOrderSchur | ( | DenseMatrixClass< complexd > & | A, |
DenseMatrixClass< complexd > & | Q, | ||
vector_seq_complexd & | w, | ||
vector_int & | select | ||
) |
Reorder the double complex schur decomposition, puch selected eigenvalues to the leading part.
[in,out] | A | A and Q are the original schur decomposition, on return, the new decomposition. |
[in,out] | Q | A and Q are the original schur decomposition, on return, the new decomposition. |
[out] | w | Array of eigenvalues. |
[in] | select | Eigenvalues corresponting to positive entries in select vector will be put in the leading part. |
int pargemslr::DenseMatrixComplexOrderSchur | ( | DenseMatrixClass< complexs > & | A, |
DenseMatrixClass< complexs > & | Q, | ||
vector_seq_complexs & | w, | ||
vector_int & | select | ||
) |
Reorder the single complex schur decomposition, puch selected eigenvalues to the leading part. A 2x2 block on the diagonal of Q need to be in the same cluster.
[in,out] | A | A and Q are the original schur decomposition, on return, the new decomposition. |
[in,out] | Q | A and Q are the original schur decomposition, on return, the new decomposition. |
[out] | w | Array of eigenvalues. |
[in] | select | Eigenvalues corresponting to positive entries in select vector will be put in the leading part. |
int pargemslr::DenseMatrixComplexOrderSchurClusters | ( | DenseMatrixClass< complexd > & | A, |
DenseMatrixClass< complexd > & | Q, | ||
vector_seq_complexd & | w, | ||
vector_int & | clusters | ||
) |
Reorder the double complex schur decomposition, puch selected eigenvalues to the leading part.
[in,out] | A | A and Q are the original schur decomposition, on return, the new decomposition. |
[in,out] | Q | A and Q are the original schur decomposition, on return, the new decomposition. |
[out] | w | Array of eigenvalues. |
[in] | clusters | Eigenvalues corresponding to positive entries in the clusters vector will be put in the leading part. The order of those eigenvalues are based on the values in the cluster vector in descending order. |
int pargemslr::DenseMatrixComplexOrderSchurClusters | ( | DenseMatrixClass< complexs > & | A, |
DenseMatrixClass< complexs > & | Q, | ||
vector_seq_complexs & | w, | ||
vector_int & | clusters | ||
) |
Reorder the single complex schur decomposition, puch selected eigenvalues to the leading part.
[in,out] | A | A and Q are the original schur decomposition, on return, the new decomposition. |
[in,out] | Q | A and Q are the original schur decomposition, on return, the new decomposition. |
[out] | w | Array of eigenvalues. |
[in] | clusters | Eigenvalues corresponding to positive entries in the clusters vector will be put in the leading part. The order of those eigenvalues are based on the values in the cluster vector in descending order. |
int pargemslr::DenseMatrixHessDecompositionHost | ( | DenseMatrixClass< complexd > & | A, |
DenseMatrixClass< complexd > & | Q | ||
) |
Transform a dense double complex matrix A into hessenberg matrix Q^HAQ = Hess.
[in,out] | A | The input matrix A, on return, the hessenberg matrix. |
[out] | Q | the Q matrix. |
int pargemslr::DenseMatrixHessDecompositionHost | ( | DenseMatrixClass< complexd > & | A, |
int | start, | ||
int | end, | ||
DenseMatrixClass< complexd > & | Q | ||
) |
Transform a dense double complex matrix A into hessenberg matrix Q^HAQ = Hess.
[in,out] | A | The input matrix A, on return, the hessenberg matrix. |
[in] | start | |
[in] | end | Outside [start, end) the matrix is already hessenberg. |
[out] | Q | the Q matrix. |
int pargemslr::DenseMatrixHessDecompositionHost | ( | DenseMatrixClass< complexs > & | A, |
DenseMatrixClass< complexs > & | Q | ||
) |
Transform a dense single complex matrix A into hessenberg matrix Q^HAQ = Hess.
[in,out] | A | The input matrix A, on return, the hessenberg matrix. |
[out] | Q | the Q matrix. |
int pargemslr::DenseMatrixHessDecompositionHost | ( | DenseMatrixClass< complexs > & | A, |
int | start, | ||
int | end, | ||
DenseMatrixClass< complexs > & | Q | ||
) |
Transform a dense single complex matrix A into hessenberg matrix Q^HAQ = Hess.
[in,out] | A | The input matrix A, on return, the hessenberg matrix. |
[in] | start | |
[in] | end | Outside [start, end) the matrix is already hessenberg. |
[out] | Q | the Q matrix. |
int pargemslr::DenseMatrixHessDecompositionHost | ( | DenseMatrixClass< double > & | A, |
DenseMatrixClass< double > & | Q | ||
) |
Transform a dense double matrix A into hessenberg matrix Q^HAQ = Hess.
[in,out] | A | The input matrix A, on return, the hessenberg matrix. |
[out] | Q | the Q matrix. |
int pargemslr::DenseMatrixHessDecompositionHost | ( | DenseMatrixClass< double > & | A, |
int | start, | ||
int | end, | ||
DenseMatrixClass< double > & | Q | ||
) |
Transform a dense double matrix A into hessenberg matrix Q^HAQ = Hess.
[in,out] | A | The input matrix A, on return, the hessenberg matrix. |
[in] | start | |
[in] | end | Outside [start, end) the matrix is already hessenberg. |
[out] | Q | the Q matrix. |
int pargemslr::DenseMatrixHessDecompositionHost | ( | DenseMatrixClass< float > & | A, |
DenseMatrixClass< float > & | Q | ||
) |
Transform a dense float matrix A into hessenberg matrix Q^HAQ = Hess.
[in,out] | A | The input matrix A, on return, the hessenberg matrix. |
[out] | Q | the Q matrix. |
int pargemslr::DenseMatrixHessDecompositionHost | ( | DenseMatrixClass< float > & | A, |
int | start, | ||
int | end, | ||
DenseMatrixClass< float > & | Q | ||
) |
Transform a dense float matrix A into hessenberg matrix Q^HAQ = Hess.
[in,out] | A | The input matrix A, on return, the hessenberg matrix. |
[in] | start | |
[in] | end | Outside [start, end) the matrix is already hessenberg. |
[out] | Q | the Q matrix. |
int pargemslr::DenseMatrixInvertHost | ( | DenseMatrixClass< complexd > & | A | ) |
Compute the inverese of a general double complex matrix.
[in,out] | A | The dense matrix, on exit the inverse of it. |
int pargemslr::DenseMatrixInvertHost | ( | DenseMatrixClass< complexs > & | A | ) |
Compute the inverese of a general single complex matrix.
[in,out] | A | The dense matrix, on exit the inverse of it. |
int pargemslr::DenseMatrixInvertHost | ( | DenseMatrixClass< double > & | A | ) |
Compute the inverese of a general double matrix.
[in,out] | A | The dense matrix, on exit the inverse of it. |
int pargemslr::DenseMatrixInvertHost | ( | DenseMatrixClass< float > & | A | ) |
Compute the inverese of a general float matrix.
[in,out] | A | The dense matrix, on exit the inverse of it. |
int pargemslr::DenseMatrixInvertUpperTriangularHost | ( | DenseMatrixClass< complexd > & | A | ) |
Compute the inverese of a upper triangular double complex matrix.
[in,out] | A | The dense matrix, on exit the inverse of it. |
int pargemslr::DenseMatrixInvertUpperTriangularHost | ( | DenseMatrixClass< complexs > & | A | ) |
Compute the inverese of a upper triangular single complex matrix.
[in,out] | A | The dense matrix, on exit the inverse of it. |
int pargemslr::DenseMatrixInvertUpperTriangularHost | ( | DenseMatrixClass< double > & | A | ) |
Compute the inverese of a upper triangular double matrix.
[in,out] | A | The dense matrix, on exit the inverse of it. |
int pargemslr::DenseMatrixInvertUpperTriangularHost | ( | DenseMatrixClass< float > & | A | ) |
Compute the inverese of a upper triangular float matrix.
[in,out] | A | The dense matrix, on exit the inverse of it. |
int pargemslr::DenseMatrixMatMat | ( | const complexd & | alpha, |
const DenseMatrixClass< complexd > & | A, | ||
char | transa, | ||
const DenseMatrixClass< complexd > & | B, | ||
char | transb, | ||
const complexd & | beta, | ||
DenseMatrixClass< complexd > & | C | ||
) |
Dense float Matrix-Matrix multiplication, C = alpha*transa(A)*transb(B)+beta*C.
If C is not pre-allocated, C will be allocated such that it has the same location as A.
[in] | alpha | The alpha value. |
[in] | A | The first csr matrix. |
[in] | transa | Whether we transpose A or not. |
[in] | B | The second csr matrix. |
[in] | transb | Whether we transpose B or not. |
[in] | beta | The beta value. |
[out] | C | The output C=A*B. Need not to allocate memory in advance. |
int pargemslr::DenseMatrixMatMat | ( | const complexs & | alpha, |
const DenseMatrixClass< complexs > & | A, | ||
char | transa, | ||
const DenseMatrixClass< complexs > & | B, | ||
char | transb, | ||
const complexs & | beta, | ||
DenseMatrixClass< complexs > & | C | ||
) |
Dense float Matrix-Matrix multiplication, C = alpha*transa(A)*transb(B)+beta*C.
If C is not pre-allocated, C will be allocated such that it has the same location as A.
[in] | alpha | The alpha value. |
[in] | A | The first csr matrix. |
[in] | transa | Whether we transpose A or not. |
[in] | B | The second csr matrix. |
[in] | transb | Whether we transpose B or not. |
[in] | beta | The beta value. |
[out] | C | The output C=A*B. Need not to allocate memory in advance. |
int pargemslr::DenseMatrixMatMat | ( | const double & | alpha, |
const DenseMatrixClass< double > & | A, | ||
char | transa, | ||
const DenseMatrixClass< double > & | B, | ||
char | transb, | ||
const double & | beta, | ||
DenseMatrixClass< double > & | C | ||
) |
Dense float Matrix-Matrix multiplication, C = alpha*transa(A)*transb(B)+beta*C.
If C is not pre-allocated, C will be allocated such that it has the same location as A.
[in] | alpha | The alpha value. |
[in] | A | The first csr matrix. |
[in] | transa | Whether we transpose A or not. |
[in] | B | The second csr matrix. |
[in] | transb | Whether we transpose B or not. |
[in] | beta | The beta value. |
[out] | C | The output C=A*B. Need not to allocate memory in advance. |
int pargemslr::DenseMatrixMatMat | ( | const float & | alpha, |
const DenseMatrixClass< float > & | A, | ||
char | transa, | ||
const DenseMatrixClass< float > & | B, | ||
char | transb, | ||
const float & | beta, | ||
DenseMatrixClass< float > & | C | ||
) |
Dense float Matrix-Matrix multiplication, C = alpha*transa(A)*transb(B)+beta*C.
If C is not pre-allocated, C will be allocated such that it has the same location as A.
[in] | alpha | The alpha value. |
[in] | A | The first csr matrix. |
[in] | transa | Whether we transpose A or not. |
[in] | B | The second csr matrix. |
[in] | transb | Whether we transpose B or not. |
[in] | beta | The beta value. |
[out] | C | The output C=A*B. Need not to allocate memory in advance. |
int pargemslr::DenseMatrixMatMatTemplate | ( | const T & | alpha, |
const DenseMatrixClass< T > & | A, | ||
char | transa, | ||
const DenseMatrixClass< T > & | B, | ||
char | transb, | ||
const T & | beta, | ||
DenseMatrixClass< T > & | C | ||
) |
Dense float Matrix-Matrix multiplication, C = alpha*transa(A)*transb(B)+beta*C.
C is assumed to be pre-allocated.
[in] | alpha | The alpha value. |
[in] | A | The first csr matrix. |
[in] | transa | Whether we transpose A or not. |
[in] | B | The second csr matrix. |
[in] | transb | Whether we transpose B or not. |
[in] | beta | The beta value. |
[out] | C | The output C=A*B. Need not to allocate memory in advance. |
int pargemslr::DenseMatrixMatVec | ( | const DenseMatrixClass< complexd > & | A, |
char | trans, | ||
const complexd & | alpha, | ||
const VectorClass< complexd > & | x, | ||
const complexd & | beta, | ||
VectorClass< complexd > & | y | ||
) |
In place dense double complex Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y.
[in] | A | The dense matrix. |
[in] | trans | Whether or not transpose matrix A. |
[in] | alpha | The alpha value. |
[in] | x | The left vector. |
[in] | beta | The beta value. |
[in,out] | y | The result vector. |
int pargemslr::DenseMatrixMatVec | ( | const DenseMatrixClass< complexs > & | A, |
char | trans, | ||
const complexs & | alpha, | ||
const VectorClass< complexs > & | x, | ||
const complexs & | beta, | ||
VectorClass< complexs > & | y | ||
) |
In place dense single complex Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y.
[in] | A | The dense matrix. |
[in] | trans | Whether or not transpose matrix A. |
[in] | alpha | The alpha value. |
[in] | x | The left vector. |
[in] | beta | The beta value. |
[in,out] | y | The result vector. |
int pargemslr::DenseMatrixMatVec | ( | const DenseMatrixClass< double > & | A, |
char | trans, | ||
const double & | alpha, | ||
const VectorClass< double > & | x, | ||
const double & | beta, | ||
VectorClass< double > & | y | ||
) |
In place dense double Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y.
[in] | A | The dense matrix. |
[in] | trans | Whether or not transpose matrix A. |
[in] | alpha | The alpha value. |
[in] | x | The left vector. |
[in] | beta | The beta value. |
[in,out] | y | The result vector. |
int pargemslr::DenseMatrixMatVec | ( | const DenseMatrixClass< float > & | A, |
char | trans, | ||
const float & | alpha, | ||
const VectorClass< float > & | x, | ||
const float & | beta, | ||
VectorClass< float > & | y | ||
) |
In place dense float Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y.
[in] | A | The dense matrix. |
[in] | trans | Whether or not transpose matrix A. |
[in] | alpha | The alpha value. |
[in] | x | The left vector. |
[in] | beta | The beta value. |
[in,out] | y | The result vector. |
int pargemslr::DenseMatrixPlotHost | ( | DenseMatrixClass< T > & | A, |
int | conditiona, | ||
int | conditionb, | ||
int | width | ||
) |
Plot the dense matrix to the terminal output. Function for testing purpose.
[in] | A | The target matrix. |
[in] | conditiona | First condition. |
[in] | conditionb | Secend condition, only spy when conditiona == conditionb. |
[in] | width | The plot width. |
int pargemslr::DenseMatrixPMatVecTemplate | ( | char | trans, |
int | nrows, | ||
int | ncols, | ||
const T & | alpha, | ||
const T * | aa, | ||
int | ldim, | ||
const T * | x, | ||
const T & | beta, | ||
T * | y | ||
) |
In place dense complex Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y.
[in] | trans | Whether or not transpose matrix A. |
[in] | nrows | Number of rows. |
[in] | ncols | Number of columns. |
[in] | alpha | The alpha value. |
[in] | aa | Pointer to the data. |
[in] | ldim | The leading dimension of A. |
[in] | x | The left vector. |
[in] | beta | The beta value. |
[in,out] | y | The result vector. |
int pargemslr::DenseMatrixQRDecompositionHost | ( | DenseMatrixClass< complexd > & | A, |
DenseMatrixClass< complexd > & | Q | ||
) |
Compute the thin QR decomposition of mxn matrix A = QR. When m >= n, Q is mxn and R is nxn. When n > m, Q is mxm and R is mxn.
[in,out] | A | The input matrix A. On return the R matrix. |
[out] | Q | the Q matrix. |
int pargemslr::DenseMatrixQRDecompositionHost | ( | DenseMatrixClass< complexs > & | A, |
DenseMatrixClass< complexs > & | Q | ||
) |
Compute the thin QR decomposition of mxn matrix A = QR. When m >= n, Q is mxn and R is nxn. When n > m, Q is mxm and R is mxn.
[in,out] | A | The input matrix A. On return the R matrix. |
[out] | Q | the Q matrix. |
int pargemslr::DenseMatrixQRDecompositionHost | ( | DenseMatrixClass< double > & | A, |
DenseMatrixClass< double > & | Q | ||
) |
Compute the thin QR decomposition of mxn matrix A = QR. When m >= n, Q is mxn and R is nxn. When n > m, Q is mxm and R is mxn.
[in,out] | A | The input matrix A. On return the R matrix. |
[out] | Q | the Q matrix. |
int pargemslr::DenseMatrixQRDecompositionHost | ( | DenseMatrixClass< float > & | A, |
DenseMatrixClass< float > & | Q | ||
) |
Compute the thin QR decomposition of mxn matrix A = QR. When m >= n, Q is mxn and R is nxn. When n > m, Q is mxm and R is mxn.
[in,out] | A | The input matrix A. On return the R matrix. |
[out] | Q | the Q matrix. |
int pargemslr::DenseMatrixRealHessEigenDecompositionHost | ( | DenseMatrixClass< double > & | A, |
DenseMatrixClass< double > & | Q, | ||
vector_seq_double & | wr, | ||
vector_seq_double & | wi | ||
) |
Compute the Eigen decomposition of double dense hessenberg matrix A, AQ = QD. A is not modified.
[in] | A | The input matrix A. |
[out] | Q | the Q matrix AQ = QD. |
[in,out] | wr | Array of real part of eigenvalues. |
[in] | wi | Array of imag part of eigenvalues. |
int pargemslr::DenseMatrixRealHessEigenDecompositionHost | ( | DenseMatrixClass< float > & | A, |
DenseMatrixClass< float > & | Q, | ||
vector_seq_float & | wr, | ||
vector_seq_float & | wi | ||
) |
Compute the Eigen decomposition of float dense hessenberg matrix A, AQ = QD. A is not modified.
[in] | A | The input matrix A. |
[out] | Q | the Q matrix AQ = QD. |
[in,out] | wr | Array of real part of eigenvalues. |
[in] | wi | Array of imag part of eigenvalues. |
int pargemslr::DenseMatrixRealHessSchurDecompositionHost | ( | DenseMatrixClass< double > & | A, |
DenseMatrixClass< double > & | Q, | ||
vector_seq_double & | wr, | ||
vector_seq_double & | wi | ||
) |
Compute the Schur decomposition of a double dense hessenberg matrix A = QUQ^H.
[in,out] | A | The input matrix A, on return, the U matrix. |
[out] | Q | the Q matrix A = QUQ^H. |
[out] | wr | Array of real part of the eigenvalues. |
[out] | wi | Array of imag part of the eigenvalues. |
int pargemslr::DenseMatrixRealHessSchurDecompositionHost | ( | DenseMatrixClass< double > & | A, |
int | start, | ||
int | end, | ||
DenseMatrixClass< double > & | Q, | ||
vector_seq_double & | wr, | ||
vector_seq_double & | wi | ||
) |
Compute the Schur decomposition of a double dense hessenberg matrix A = QUQ^H.
[in,out] | A | The input matrix A, on return, the U matrix. |
[in] | start | |
[in] | end | Outside [start, end) the matrix is already upper triangular. |
[out] | Q | the Q matrix A = QUQ^H. |
[out] | wr | Array of real part of the eigenvalues. |
[out] | wi | Array of imag part of the eigenvalues. |
int pargemslr::DenseMatrixRealHessSchurDecompositionHost | ( | DenseMatrixClass< float > & | A, |
DenseMatrixClass< float > & | Q, | ||
vector_seq_float & | wr, | ||
vector_seq_float & | wi | ||
) |
Compute the Schur decomposition of a float dense hessenberg matrix A = QUQ^H.
[in,out] | A | The input matrix A, on return, the U matrix. |
[out] | Q | the Q matrix A = QUQ^H. |
[out] | wr | Array of real part of the eigenvalues. |
[out] | wi | Array of imag part of the eigenvalues. |
int pargemslr::DenseMatrixRealHessSchurDecompositionHost | ( | DenseMatrixClass< float > & | A, |
int | start, | ||
int | end, | ||
DenseMatrixClass< float > & | Q, | ||
vector_seq_float & | wr, | ||
vector_seq_float & | wi | ||
) |
Compute the Schur decomposition of a float dense hessenberg matrix A = QUQ^H.
[in,out] | A | The input matrix A, on return, the U matrix. |
[in] | start | |
[in] | end | Outside [start, end) the matrix is already upper triangular. |
[out] | Q | the Q matrix A = QUQ^H. |
[out] | wr | Array of real part of the eigenvalues. |
[out] | wi | Array of imag part of the eigenvalues. |
int pargemslr::DenseMatrixRealOrderSchur | ( | DenseMatrixClass< double > & | A, |
DenseMatrixClass< double > & | Q, | ||
vector_seq_double & | wr, | ||
vector_seq_double & | wi, | ||
vector_int & | select | ||
) |
Reorder the double schur decomposition, puch selected eigenvalues to the leading part.
[in,out] | A | A and Q are the original schur decomposition, on return, the new decomposition. |
[in,out] | Q | A and Q are the original schur decomposition, on return, the new decomposition. |
[out] | wr | Array of real part of eigenvalues. |
[out] | wi | Array of imag part of eigenvalues. |
[in] | select | Eigenvalues corresponting to positive entries in select vector will be put in the leading part. |
int pargemslr::DenseMatrixRealOrderSchur | ( | DenseMatrixClass< float > & | A, |
DenseMatrixClass< float > & | Q, | ||
vector_seq_float & | wr, | ||
vector_seq_float & | wi, | ||
vector_int & | select | ||
) |
Reorder the float schur decomposition, puch selected eigenvalues to the leading part.
[in,out] | A | A and Q are the original schur decomposition, on return, the new decomposition. |
[in,out] | Q | A and Q are the original schur decomposition, on return, the new decomposition. |
[out] | wr | Array of real part of eigenvalues. |
[out] | wi | Array of imag part of eigenvalues. |
[in] | select | Eigenvalues corresponting to positive entries in select vector will be put in the leading part. |
int pargemslr::DenseMatrixRealOrderSchurClusters | ( | DenseMatrixClass< double > & | A, |
DenseMatrixClass< double > & | Q, | ||
vector_seq_double & | wr, | ||
vector_seq_double & | wi, | ||
vector_int & | clusters | ||
) |
Reorder the double schur decomposition, puch selected eigenvalues to the leading part. A 2x2 block on the diagonal of Q need to be in the same cluster.
[in,out] | A | A and Q are the original schur decomposition, on return, the new decomposition. |
[in,out] | Q | A and Q are the original schur decomposition, on return, the new decomposition. |
[out] | wr | Array of real part of eigenvalues. |
[out] | wi | Array of imag part of eigenvalues. |
[in] | clusters | Eigenvalues corresponding to positive entries in the clusters vector will be put in the leading part. The order of those eigenvalues are based on the values in the cluster vector in descending order. |
int pargemslr::DenseMatrixRealOrderSchurClusters | ( | DenseMatrixClass< float > & | A, |
DenseMatrixClass< float > & | Q, | ||
vector_seq_float & | wr, | ||
vector_seq_float & | wi, | ||
vector_int & | clusters | ||
) |
Reorder the float schur decomposition, puch selected eigenvalues to the leading part. A 2x2 block on the diagonal of Q need to be in the same cluster.
[in,out] | A | A and Q are the original schur decomposition, on return, the new decomposition. |
[in,out] | Q | A and Q are the original schur decomposition, on return, the new decomposition. |
[out] | wr | Array of real part of eigenvalues. |
[out] | wi | Array of imag part of eigenvalues. |
[in] | clusters | Eigenvalues corresponding to positive entries in the clusters vector will be put in the leading part. The order of those eigenvalues are based on the values in the cluster vector in descending order. |
PrecisionEnum pargemslr::GetMatrixPPrecision | ( | const MatrixClass< complexd > * | mat | ) |
Get the precision of a matrix.
[in] | mat | the matrix. |
PrecisionEnum pargemslr::GetMatrixPPrecision | ( | const MatrixClass< complexs > * | mat | ) |
Get the precision of a matrix.
[in] | mat | the matrix. |
PrecisionEnum pargemslr::GetMatrixPPrecision | ( | const MatrixClass< double > * | mat | ) |
Get the precision of a matrix.
[in] | mat | the matrix. |
PrecisionEnum pargemslr::GetMatrixPPrecision | ( | const MatrixClass< float > * | mat | ) |
Get the precision of a matrix.
[in] | mat | the matrix. |
PrecisionEnum pargemslr::GetMatrixPPrecision | ( | const MatrixClass< int > * | mat | ) |
Get the precision of a matrix.
[in] | mat | the matrix. |
PrecisionEnum pargemslr::GetMatrixPPrecision | ( | const MatrixClass< long int > * | mat | ) |
Get the precision of a matrix.
[in] | mat | the matrix. |
PrecisionEnum pargemslr::GetMatrixPrecision | ( | const MatrixClass< complexd > & | mat | ) |
Get the precision of a matrix.
[in] | mat | the matrix. |
PrecisionEnum pargemslr::GetMatrixPrecision | ( | const MatrixClass< complexs > & | mat | ) |
Get the precision of a matrix.
[in] | mat | the matrix. |
PrecisionEnum pargemslr::GetMatrixPrecision | ( | const MatrixClass< double > & | mat | ) |
Get the precision of a matrix.
[in] | mat | the matrix. |
PrecisionEnum pargemslr::GetMatrixPrecision | ( | const MatrixClass< float > & | mat | ) |
Get the precision of a matrix.
[in] | mat | the matrix. |
PrecisionEnum pargemslr::GetMatrixPrecision | ( | const MatrixClass< int > & | mat | ) |
Get the precision of a matrix.
[in] | mat | the matrix. |
PrecisionEnum pargemslr::GetMatrixPrecision | ( | const MatrixClass< long int > & | mat | ) |
Get the precision of a matrix.
[in] | mat | the matrix. |
int pargemslr::ParallelCsrMatrixAddHost | ( | ParallelCsrMatrixClass< T > & | A, |
ParallelCsrMatrixClass< T > & | B, | ||
ParallelCsrMatrixClass< T > & | C | ||
) |
Add sparse matrix in Parallel CSR format, C= A + B.
[in] | A | Matrix A. |
[in] | B | Matrix B. |
[out] | C | Matrix C = A + B. |
int pargemslr::ParallelCsrMatrixSetupIOOrder | ( | ParallelCsrMatrixClass< T > & | parcsr_in, |
vector_int & | local_perm, | ||
int & | nI, | ||
CsrMatrixClass< T > & | B_mat, | ||
CsrMatrixClass< T > & | E_mat, | ||
CsrMatrixClass< T > & | F_mat, | ||
ParallelCsrMatrixClass< T > & | C_mat, | ||
int | perm_option, | ||
bool | perm_c | ||
) |
Setup the local order splits the interior and exterior nodes.
[in] | parcsr_in | The input matrix. |
[out] | local_perm | The local permutation. |
[out] | nI | The number of local interior nodes. |
[out] | B_mat | The local B matrix. |
[out] | E_mat | The local E matrix. |
[out] | F_mat | The local F matrix. |
[out] | C_mat | The global coupling matrix. |
[in] | perm_option | The permutation option. kIluReorderingNo, kIluReorderingRCM, kIluReorderingAMD. |
[in] | bool | perm_c Permute B only or B and C? |
int pargemslr::ParallelCsrMatrixSetupPermutationParallelND | ( | ParallelCsrMatrixClass< T > & | A, |
bool | vertexsep, | ||
int & | nlev, | ||
long int | minsep, | ||
vector_int & | map_v, | ||
vector_int & | mapptr_v | ||
) |
The main ND reordering function using ND in the ParMETIS. The number of level is fixed once the np is given.
[in] | A | The target parallel CSR matrix. |
[in] | vertexsep | Use edge seperator or vertex seperator (currently not in use). |
[in,out] | nlev | The target number of levels (currently not in use). |
[in] | minsep | Minimal size of the seperator (currently not in use). |
int pargemslr::ParallelCsrMatrixSetupPermutationParallelRKway | ( | ParallelCsrMatrixClass< T > & | A, |
bool | vertexsep, | ||
int & | nlev, | ||
long int | ncomp, | ||
long int | minsep, | ||
long int | kmin, | ||
long int | kfactor, | ||
vector_int & | map_v, | ||
vector_int & | mapptr_v, | ||
bool | bj_last | ||
) |
The first part of the function conatins the following steps:
1) On each level, partition the current adjacency graph with kway partitioning.
2) Find the adjacency graph of the interface matrix.
3) Repeat until we reach the last level or the interface matrix is too small.
After that, we re-assign all nodes to their new processor, and apply communication to transfer data.
[in] | A | The target parallel CSR matrix. |
[in] | vertexset | Use edge seperator or vertex seperator. |
[in,out] | nlev | The target number of levels. |
[in] | ncomp | Number of components. |
[in] | minsep | Minimal size of the seperator. |
[in] | kmin | Minimal size of the number of subdomains on a level. |
[in] | kfactor | At each level, ncomp is deviced by kfactor, for example, when ncomp = 16 and kfactor = 2, size would be 16, 8, 4, .... |
[out] | map_v | The map from node number to domain number. |
[out] | mapptr_v | The vector holds the start domian number on each level. |
[in] | bj_last | Should we treat last level with block Jacobi? |
int pargemslr::ParallelCsrMatrixTransposeHost | ( | ParallelCsrMatrixClass< T > & | A, |
ParallelCsrMatrixClass< T > & | AT | ||
) |
Compute the transpose of a parallel csr matrix.
[in] | A | The input matrix. |
[out] | AT | The output transpose matrix. |
int pargemslr::ParallelNDGetSeparator | ( | vector_long & | vtxdist, |
vector_long & | xadj, | ||
vector_long & | adjncy, | ||
vector_long & | map, | ||
long int & | ndom1, | ||
long int & | ndom2, | ||
long int & | edge_cut, | ||
parallel_log & | parlog | ||
) |
This function finds the vertex separator based on the map information. A very simple appraoch, find the edge separator and only keep one side.
[in] | vtxdist | The distribution of rows for parMETIS. |
[in] | xadj | The column ptr for parMETIS. |
[in] | adjncy | The column numbers for parMETIS. |
[in,out] | map | The subdomain number of each node, on return, edge separator would be marked as 2. |
[out] | ndom1 | Global number of interior nodes in dom1. |
[out] | ndom2 | Global number of interior nodes in dom2. |
[out] | edge_cut | Global number of edge_cut. |
[in] | parallel_log | Parallel info struct. |
int pargemslr::ParallelRKwayGetSeparator | ( | vector_long & | vtxdist, |
vector_long & | xadj, | ||
vector_long & | adjncy, | ||
vector_long & | vtxdist_s, | ||
vector_long & | xadj_s, | ||
vector_long & | adjncy_s, | ||
vector_long & | map, | ||
int | num_dom, | ||
vector_int & | vtxsep, | ||
parallel_log & | parlog | ||
) |
This function finds the edge separator based on the map information.
[in] | vtxdist | The distribution of rows for parMETIS. |
[in] | xadj | The column ptr for parMETIS. |
[in] | adjncy | The column numbers for parMETIS. |
[in] | vtxdist_s | The distribution of rows for the edge separator. |
[in] | xadj_s | The column ptr for the edge separator. |
[in] | adjncy_s | The column numbers for the edge separator. |
[in] | map | The subdomain number of each node. |
[in] | num_dom | The number ofsubdomain number of each node. |
[out] | vtxsep | vtxsep[i] > 0 if node i is inside the edge separator. |
[in] | parallel_log | Parallel info struct. |
int pargemslr::PargemslrArnoldiNoRestart | ( | MatrixType & | A, |
int | mstart, | ||
int | msteps, | ||
DenseMatrixClass< DataType > & | V, | ||
DenseMatrixClass< DataType > & | H, | ||
RealDataType | tol_orth, | ||
RealDataType | tol_reorth | ||
) |
The standard Arnoldi procedure on a matrix.
Can start from a certan vector instead of the first vector in V.
[in] | A | The target matrix with Matvec and GetNumRows function. |
[in] | mstart | the index of the starting vector (start from V_mstart). |
[in] | msteps | (Maximum) Number of Arnoldi steps is msteps - mstart. |
[in,out] | V | Matrix holding the Krylov basis, space should be reserved, V(:,0:mstart) should be set already. |
[in,out] | H | The upper Hessenberg matrix generated by Arnoldi, space should be reserved. |
[in] | tol_orth | the tolorance for the Arnoldi. |
[in] | tol_reorth | the tolorance for the reorthgonation, set to -1.0 to turn off reorthgonation. |
int pargemslr::PargemslrArnoldiThickRestartBuildThickRestartNewVector | ( | DenseMatrixClass< DataType > & | V, |
DenseMatrixClass< DataType > & | H, | ||
int | m, | ||
RealDataType | tol_orth, | ||
RealDataType | tol_reorth, | ||
VectorType & | v | ||
) |
The current V is a invarient subspace, pick a new vector to restart.
[in] | V | The V at the current step. |
[in] | H | The H at the current step. |
[in] | m | The size of Hm. |
[in] | tol_orth | The threshold for orthgonal. |
[in] | tol_reorth | The threshold for reorthgonal. |
[in] | v | Working vector pointer, set by SetupVectorPtrStr(). |
int pargemslr::PargemslrArnoldiThickRestartChooseEigenValuesComplex | ( | DenseMatrixClass< DataType > & | H, |
DenseMatrixClass< DataType > & | Q, | ||
DataType | h_last, | ||
RealDataType(*)(DataType) | weight, | ||
RealDataType | truncate, | ||
int & | ncov, | ||
int & | nicov, | ||
int & | nsatis, | ||
RealDataType | tol_eig, | ||
RealDataType | eig_target_mag, | ||
RealDataType | eig_truncate, | ||
bool & | cut, | ||
SequentialVectorClass< DataType > & | w, | ||
vector_int & | icov, | ||
vector_int & | iicov, | ||
vector_int & | isatis, | ||
SequentialVectorClass< RealDataType > & | dcov, | ||
SequentialVectorClass< RealDataType > & | dicov, | ||
SequentialVectorClass< RealDataType > & | dsatis | ||
) |
Pick convergenced eigenvalues and unconvergenced eigenvalues.
[in] | H | The H matrix after Schur decomposition. |
[in] | Q | The Q matrix after Schur decomposition. |
[in] | h_last | The H(m+1.m) value. |
[in] | weight | The weight function. |
[out] | ncov | The number of convergenced eigenvalues. |
[out] | nicov | The number of unconvergenced eigenvalues. |
[in] | w | The eigenvalues. |
[out] | icov | The index of convergenced eigenvalues. |
[out] | iicov | The index of unconvergenced eigenvalues. |
[out] | dcov | The distance of convergenced eigenvalues. |
[out] | dicov | The distance of unconvergenced eigenvalues. |
int pargemslr::PargemslrArnoldiThickRestartChooseEigenValuesReal | ( | DenseMatrixClass< T > & | H, |
DenseMatrixClass< T > & | Q, | ||
T | h_last, | ||
T(*)(ComplexValueClass< T >) | weight, | ||
T | truncate, | ||
int & | ncov, | ||
int & | nicov, | ||
int & | nsatis, | ||
T | tol_eig, | ||
T | eig_target_mag, | ||
T | eig_truncate, | ||
bool & | cut, | ||
SequentialVectorClass< T > & | wr, | ||
SequentialVectorClass< T > & | wi, | ||
vector_int & | icov, | ||
vector_int & | iicov, | ||
vector_int & | isatis, | ||
SequentialVectorClass< T > & | dcov, | ||
SequentialVectorClass< T > & | dicov, | ||
SequentialVectorClass< T > & | dsatis | ||
) |
Pick convergenced eigenvalues and unconvergenced eigenvalues.
[in] | H | The H matrix after Schur decomposition. |
[in] | Q | The Q matrix after Schur decomposition. |
[in] | h_last | The H(m+1.m) value. |
[in] | weight | The weight function. |
[out] | ncov | The number of convergenced eigenvalues. |
[out] | nicov | The number of unconvergenced eigenvalues. |
[in] | wr | The real part of eigenvalues. |
[in] | wi | The imag part of eigenvalues. |
[out] | icov | The index of convergenced eigenvalues. |
[out] | iicov | The index of unconvergenced eigenvalues. |
[out] | dcov | The distance of convergenced eigenvalues. |
[out] | dicov | The distance of unconvergenced eigenvalues. |
int pargemslr::PargemslrArnoldiThickRestartNoLock | ( | MatrixType & | A, |
int | msteps, | ||
int | maxits, | ||
int | rank, | ||
int | rank2, | ||
RealDataType | truncate, | ||
RealDataType | tr_fact, | ||
RealDataType | tol_eig, | ||
RealDataType | eig_target_mag, | ||
RealDataType | eig_truncate, | ||
RealDataType(*)(ComplexValueClass< RealDataType >) | weight, | ||
DenseMatrixClass< DataType > & | V, | ||
DenseMatrixClass< DataType > & | H, | ||
RealDataType | tol_orth, | ||
RealDataType | tol_reorth | ||
) |
The thick-restart Arnoldi without locking. This version should be used when convergence tolerance is high.
[in] | A | The target matrix with Matvec and GetNumRows function. |
[in] | msteps | Initial number of Arnoldi steps. |
[in] | maxits | Maximum number of restarts. |
[in] | rank | The number of convergenced eigenvalues to compute. |
[in] | rank2 | The number of convergenced eigenvalues to keep. |
[in] | tr_fact | Real value between (0,1), thick-restart factor. Control the size of thick-restart. Each restart would restart with number of convergenced plus number of unconvergenced eigenvalue * tr_fact. |
[in] | tol_eig | The tolorance of eigenvalue convergence. |
[in] | weight | Compute eigenvalue has larger weight(val) first. |
[in,out] | V | Matrix holding the Krylov basis, space should be reserved, V(:,0:mstart) should be set already. |
[in,out] | H | The upper Hessenberg matrix generated by Arnoldi, space should be reserved. |
[in] | tol_orth | the tolorance for the Arnoldi. |
[in] | tol_reorth | the tolorance for the reorthgonation, set to -1.0 to turn off reorthgonation. |
int pargemslr::PargemslrCgs2 | ( | VectorType & | w, |
DenseMatrixClass< DataType > & | V, | ||
DenseMatrixClass< DataType > & | H, | ||
RealDataType & | t, | ||
int | k, | ||
RealDataType | tol_orth | ||
) |
The classical Gram-Schmidt with re-orthgonal (always one step of re-orth).
[in] | w | Parallel vector to project to I-VV'. |
[in,out] | V | Matrix holding the Krylov basis. |
[in,out] | H | The upper Hessenberg matrix generated by Arnoldi. |
[out] | t | Scalar to hold ||w||. |
[in] | k | Number of columns used in V, exclude w. |
[in] | tol_orth | tol used to check break. |
int pargemslr::PargemslrMgs | ( | VectorType & | w, |
DenseMatrixClass< DataType > & | V, | ||
DenseMatrixClass< DataType > & | H, | ||
RealDataType & | t, | ||
int | k, | ||
RealDataType | tol_orth, | ||
RealDataType | tol_reorth | ||
) |
The modified Gram-Schmidt with re-orthgonal.
[in] | w | Parallel vector to project to I-VV'. |
[in,out] | V | Matrix holding the Krylov basis. |
[in,out] | H | The upper Hessenberg matrix generated by Arnoldi. |
[out] | t | Scalar to hold ||w||. |
[in] | k | Number of columns used in V, exclude w. |
[in] | tol_orth | tol used to check break. |
[in] | tol_reorth | tol used in reorth for higher accuracy. |
int pargemslr::PargemslrOrthogonal | ( | VectorType & | w, |
DenseMatrixClass< DataType > & | V, | ||
RealDataType & | t, | ||
int | k, | ||
RealDataType | tol_orth, | ||
RealDataType | tol_reorth | ||
) |
The modified Gram-Schmidt with re-orthgonal without H matrix.
[in] | w | Parallel vector to project to I-VV'. |
[in,out] | V | Matrix holding the Krylov basis. |
[out] | t | Scalar to hold ||w||. |
[in] | k | Number of columns used in V, exclude w. |
[in] | tol_orth | tol used to check break. |
[in] | tol_reorth | tol used in reorth for higher accuracy. |
int pargemslr::PargemslrSubSpaceIteration | ( | MatrixType & | A, |
int | k, | ||
int | its, | ||
DenseMatrixClass< DataType > & | V, | ||
DenseMatrixClass< DataType > & | H, | ||
RealDataType | tol | ||
) |
The subspace iteration procedure on a matrix. Note that we do not check for convergence. Apply a fixed number of iterations.
[in] | A | The target matrix with Matvec and GetNumRows function. |
[in] | k | the dimension of the subspace. |
[in] | its | (Maximum) Number of iterations. |
[in,out] | V | Matrix holding the final Q. |
[in,out] | H | Matrix holding the final R. |
[in] | tol | Not yet in used. |
int pargemslr::ParmetisKwayHost | ( | vector_long & | vtxdist, |
vector_long & | xadj, | ||
vector_long & | adjncy, | ||
long int & | num_dom, | ||
vector_long & | map, | ||
parallel_log & | parlog | ||
) |
Call ParMETIS to partition A based on the adjancency graph of A.
[in] | vtxdist | Vector of the number of the first vertex on each processor. |
[in] | xadj | Local I vector in the CSR format. |
[in] | adjncy | Local J vector in the CSR format. |
[in,out] | num_dom | Number of requested partitions. On exit the number of partitions we get. |
[out] | map | The domain number of each vertex. |
[in] | parallel_log | Parallel info struct. |
int pargemslr::ParmetisNodeND | ( | vector_long & | vtxdist, |
vector_long & | xadj, | ||
vector_long & | adjncy, | ||
long int & | num_dom, | ||
vector_long & | map, | ||
parallel_log & | parlog | ||
) |
Partition with log(p) levels nd, p is the number of processors.
[in] | vtxdist | Vector of the number of the first vertex on each processor. |
[in] | xadj | Local I vector in the CSR format. |
[in] | adjncy | Local J vector in the CSR format. |
[in,out] | num_dom | Number of requested partitions. On exit the number of partitions we get. |
[out] | map | The domain number of each vertex. |
[in] | parallel_log | Parallel info struct. |
int pargemslr::SetupPermutationNDCombineLevels | ( | std::vector< vector_int > & | level_stri, |
int & | ndom | ||
) |
Compress a certain level of level_str from SetupPermutationNDRecursive into a give number of domains.
[in] | level_stri | The level of a level_str. |
[in,out] | ndom | The target number of domains, on return the ndom we get. |
int pargemslr::SetupPermutationNDRecursive | ( | CsrMatrixClass< T > & | A, |
bool | vertexsep, | ||
int | clvl, | ||
int & | tlvl, | ||
int | minsep, | ||
std::vector< std::vector< vector_int > > & | level_str | ||
) |
Recursive ND partition call.
[in] | A | The target matrix. |
[in] | vertexset | Use edge seperator or vertex seperator. |
[in] | clvl | The current level. |
[in,out] | tlvl | The total number of levels. |
[in] | num_dom | The target number of domains on this level. |
[in] | minsep | The minimal size of the edge seperator. |
[in] | level_str | The level structure. level_str[i][j] is the nodes in the i-th component, of the j-th level in this component. |
int pargemslr::SetupPermutationParallelKwayVertexSep | ( | ParallelCsrMatrixClass< T > & | A, |
long int & | ncomp, | ||
vector_int & | map_v, | ||
vector_long & | perm_sep, | ||
parallel_log & | parlog | ||
) |
This function build the k-way partition where k is the power of 2, and provide an approximate vertex saperator.
[in] | A | The target matrix. |
[in,out] | ncomp | The k for the kway partition, on return, the actual number of subdomains. |
[out] | map_v | The subdomain number of each node, starting from 0 to ncomp-1. if map_v[i] == ncomp this is the separator. |
[out] | perm_sep | The permutation, A(perm_sep, perm_sep) is the global coupling matrix. |
[in] | parallel_log | Parallel info struct. |
int pargemslr::SetupPermutationParallelKwayVertexSepRecursive | ( | ParallelCsrMatrixClass< T > & | A, |
int | clvl, | ||
int | tlvl, | ||
bool & | succeed, | ||
vector_int & | map_v, | ||
parallel_log & | parlog | ||
) |
This recursie call function for building the k-way partition where k is the power of 2, and provide an approximate vertex saperator.
[in] | A | The target matrix. |
[in] | clvl | The current level starting from 0. |
[in] | tlvl | The total number of levels, map from level to domain: 2->2, 3->4, 4->8 .... |
[in,out] | succeed | Tell if the partition get desired result. |
[out] | map_v | The subdomain number of each node, starting from 0 to ncomp-1. if map_v[i] == ncomp this is the separator. |
[in] | parallel_log | Parallel info struct. |
int pargemslr::SetupPermutationParallelRKwayRecursive | ( | vector_long & | vtxdist, |
vector_long & | xadj, | ||
vector_long & | adjncy, | ||
int | clvl, | ||
int & | tlvl, | ||
long int | ncomp, | ||
long int | minsep, | ||
long int | kmin, | ||
long int | kfactor, | ||
vector_int & | map_v, | ||
vector_int & | mapptr_v, | ||
bool | bj_last, | ||
parallel_log & | parlog | ||
) |
The function conatins the following steps:
1) On each level, partition the current adjacency graph with kway partitioning.
2) Find the adjacency graph of the interface matrix.
3) Repeat until we reach the last level or the interface matrix is too small.
[in] | vtxdist | The distribution of rows for parMETIS. |
[in] | xadj | The column ptr for parMETIS. |
[in] | adjncy | The column numbers for parMETIS. |
[in] | clvl | Current level number. |
[in,out] | tlvl | The max number of levels. If the algorithm stops at a level lower than desired level, reset tlvl to current number of levels. |
[in] | ncomp | The k for the kway partition on the current level. |
[in] | minsep | The minimal size of the edge separator. The algorithm stops if the size of the current interface matrix is too small. |
[in] | kmin | The minimal value of k for the kway partition. |
[in] | kfactor | On the next level, ncomp = ncomp/kfactor. We might want more subdomains on higher levels. |
[out] | map_v | The subdomain number of each node. |
[out] | mapptr_v | The vector holds the start domian number on each level. |
[in] | bj_last | Should we treat last level with block Jacobi? |
[in] | parallel_log | Parallel info struct. |
int pargemslr::SetupPermutationParallelRKwayRecursive2 | ( | ParallelCsrMatrixClass< T > & | A, |
int | clvl, | ||
int & | tlvl, | ||
long int | ncomp, | ||
long int | minsep, | ||
long int | kmin, | ||
long int | kfactor, | ||
vector_int & | map_v, | ||
vector_int & | mapptr_v, | ||
bool | bj_last, | ||
parallel_log & | parlog | ||
) |
This is the recursive function to build the mapping information, using an approximate vetrex separator (not the minimal).
[in] | A | The target matrix. |
[in] | clvl | Current level number. |
[in,out] | tlvl | The max number of levels. If the algorithm stops at a level lower than desired level, reset tlvl to current number of levels. |
[in] | ncomp | The k for the kway partition on the current level. |
[in] | minsep | The minimal size of the edge separator. The algorithm stops if the size of the current interface matrix is too small. |
[in] | kmin | The minimal value of k for the kway partition. |
[in] | kfactor | On the next level, ncomp = ncomp/kfactor. We might want more subdomains on higher levels. |
[out] | map_v | The subdomain number of each node. |
[out] | mapptr_v | The vector holds the start domian number on each level. |
[in] | bj_last | Should we treat last level with block Jacobi? |
[in] | parallel_log | Parallel info struct. |
int pargemslr::SetupPermutationRKwayRecursive | ( | CsrMatrixClass< T > & | A, |
bool | vertexsep, | ||
int | clvl, | ||
int & | tlvl, | ||
int | num_dom, | ||
int | minsep, | ||
int | kmin, | ||
int | kfactor, | ||
vector_int & | map_v, | ||
vector_int & | mapptr_v | ||
) |
Recursive KWay partition call.
[in] | A | The target matrix. |
[in] | vertexset | Use edge seperator or vertex seperator. |
[in] | clvl | The current level. |
[in,out] | tlvl | The total number of levels. |
[in] | num_dom | The target number of domains on this level, must be no less than 2. |
[in] | minsep | The minimal size of the edge seperator. |
[in] | kmin | The minimal number of domains on this level. |
[in] | kfactor | The reduce factor of the number of domains. |
[in] | map_v | The map from node number to domain number. |
[in] | mapptr_v | The vector holds the start domian number on each level. |