Implementation namespace for algebraic multigrid preconditioner. More...
Classes | |
class | amg_nonzero_scalar |
A class for a scalar that can be written to the sparse matrix or sparse vector datatypes. More... | |
class | amg_point |
A class for the AMG points. Saves point index and influence measure Holds information whether point is undecided, C or F point. Holds lists of points that are influenced by or influencing this point. More... | |
class | amg_pointvector |
A class for the AMG points. Holds pointers of type amg_point in a vector that can be accessed using [point-index]. Additional list of pointers sorted by influence number and index to improve coarsening performance (see amg_coarse_classic_onepass() in amg_coarse.hpp) Constructs indices for C points on the coarse level, needed for interpolation. More... | |
class | amg_slicing |
A class for the matrix slicing for parallel coarsening schemes (RS0/RS3). More... | |
class | amg_sparsematrix |
A class for the sparse matrix type. Uses vector of maps as data structure for higher performance and lower memory usage. Uses similar interface as ublas::compressed_matrix. Can deal with transposed of matrix internally: Creation, Storage, Iterators, etc. More... | |
class | amg_sparsevector |
A class for the sparse vector type. More... | |
class | amg_sparsevector_iterator |
Defines an iterator for the sparse vector type. More... | |
class | amg_tag |
A tag for algebraic multigrid (AMG). Used to transport information from the user to the implementation. More... | |
struct | classcomp |
Comparison class for the sorted set of points in amg_pointvector. Set is sorted by influence measure from lower to higher with the point-index as tie-breaker. More... | |
Functions | |
template<typename SparseMatrixT > | |
void | amg_mat_prod (SparseMatrixT &A, SparseMatrixT &B, SparseMatrixT &RES) |
Sparse matrix product. Calculates RES = A*B. More... | |
template<typename SparseMatrixT > | |
void | amg_galerkin_prod (SparseMatrixT &A, SparseMatrixT &P, SparseMatrixT &RES) |
Sparse Galerkin product: Calculates RES = trans(P)*A*P. More... | |
template<typename SparseMatrixT > | |
void | test_triplematprod (SparseMatrixT &A, SparseMatrixT &P, SparseMatrixT &A_i1) |
Test triple-matrix product by comparing it to ublas functions. Very slow for large matrices! More... | |
template<typename SparseMatrixT , typename PointVectorT > | |
void | test_interpolation (SparseMatrixT &A, SparseMatrixT &P, PointVectorT &Pointvector) |
Test if interpolation matrix makes sense. Only vanilla test though! Only checks if basic requirements are met! More... | |
template<typename InternalT1 , typename InternalT2 , typename InternalT3 > | |
void | amg_coarse (unsigned int level, InternalT1 &A, InternalT2 &pointvector, InternalT3 &slicing, amg_tag &tag) |
Calls the right coarsening procedure. More... | |
template<typename InternalT1 , typename InternalT2 > | |
void | amg_influence (unsigned int level, InternalT1 const &A, InternalT2 &pointvector, amg_tag &tag) |
Determines strong influences in system matrix, classical approach (RS). Multithreaded! More... | |
template<typename InternalT1 , typename InternalT2 > | |
void | amg_coarse_classic_onepass (unsigned int level, InternalT1 &A, InternalT2 &pointvector, amg_tag &tag) |
Classical (RS) one-pass coarsening. Single-Threaded! (VIENNACL_AMG_COARSE_CLASSIC_ONEPASS) More... | |
template<typename InternalT1 , typename InternalT2 > | |
void | amg_coarse_classic (unsigned int level, InternalT1 &A, InternalT2 &pointvector, amg_tag &tag) |
Classical (RS) two-pass coarsening. Single-Threaded! (VIENNACL_AMG_COARSE_CLASSIC) More... | |
template<typename InternalT1 , typename InternalT2 , typename InternalT3 > | |
void | amg_coarse_rs0 (unsigned int level, InternalT1 &A, InternalT2 &pointvector, InternalT3 &slicing, amg_tag &tag) |
Parallel classical RS0 coarsening. Multi-Threaded! (VIENNACL_AMG_COARSE_RS0 || VIENNACL_AMG_COARSE_RS3) More... | |
template<typename InternalT1 , typename InternalT2 , typename InternalT3 > | |
void | amg_coarse_rs3 (unsigned int level, InternalT1 &A, InternalT2 &pointvector, InternalT3 &slicing, amg_tag &tag) |
RS3 coarsening. Single-Threaded! (VIENNACL_AMG_COARSE_RS3) More... | |
template<typename InternalT1 , typename InternalT2 > | |
void | amg_coarse_ag (unsigned int level, InternalT1 &A, InternalT2 &pointvector, amg_tag &tag) |
AG (aggregation based) coarsening. Single-Threaded! (VIENNACL_AMG_COARSE_SA) More... | |
template<typename MatrixT > | |
void | printmatrix (MatrixT &, int) |
template<typename VectorT > | |
void | printvector (VectorT const &) |
template<typename InternalT1 , typename InternalT2 > | |
void | amg_interpol (unsigned int level, InternalT1 &A, InternalT1 &P, InternalT2 &pointvector, amg_tag &tag) |
Calls the right function to build interpolation matrix. More... | |
template<typename InternalT1 , typename InternalT2 > | |
void | amg_interpol_direct (unsigned int level, InternalT1 &A, InternalT1 &P, InternalT2 &pointvector, amg_tag &tag) |
Direct interpolation. Multi-threaded! (VIENNACL_AMG_INTERPOL_DIRECT) More... | |
template<typename InternalT1 , typename InternalT2 > | |
void | amg_interpol_classic (unsigned int level, InternalT1 &A, InternalT1 &P, InternalT2 &pointvector, amg_tag &tag) |
Classical interpolation. Don't use with onepass classical coarsening or RS0 (Yang, p.14)! Multi-threaded! (VIENNACL_AMG_INTERPOL_CLASSIC) More... | |
template<typename SparseMatrixT > | |
void | amg_truncate_row (SparseMatrixT &P, unsigned int row, amg_tag &tag) |
Interpolation truncation (for VIENNACL_AMG_INTERPOL_DIRECT and VIENNACL_AMG_INTERPOL_CLASSIC) More... | |
template<typename InternalT1 , typename InternalT2 > | |
void | amg_interpol_ag (unsigned int level, InternalT1 &A, InternalT1 &P, InternalT2 &pointvector, amg_tag) |
AG (aggregation based) interpolation. Multi-Threaded! (VIENNACL_INTERPOL_SA) More... | |
template<typename InternalT1 , typename InternalT2 > | |
void | amg_interpol_sa (unsigned int level, InternalT1 &A, InternalT1 &P, InternalT2 &pointvector, amg_tag &tag) |
SA (smoothed aggregate) interpolation. Multi-Threaded! (VIENNACL_INTERPOL_SA) More... | |
Implementation namespace for algebraic multigrid preconditioner.
void viennacl::linalg::detail::amg::amg_coarse | ( | unsigned int | level, |
InternalT1 & | A, | ||
InternalT2 & | pointvector, | ||
InternalT3 & | slicing, | ||
amg_tag & | tag | ||
) |
Calls the right coarsening procedure.
level | Coarse level identifier |
A | Operator matrix on all levels |
pointvector | Vector of points on all levels |
slicing | Partitioning of the system matrix to different processors (only used in RS0 and RS3) |
tag | AMG preconditioner tag |
Definition at line 52 of file amg_coarse.hpp.
void viennacl::linalg::detail::amg::amg_coarse_ag | ( | unsigned int | level, |
InternalT1 & | A, | ||
InternalT2 & | pointvector, | ||
amg_tag & | tag | ||
) |
AG (aggregation based) coarsening. Single-Threaded! (VIENNACL_AMG_COARSE_SA)
level | Coarse level identifier |
A | Operator matrix on all levels |
pointvector | Vector of points on all levels |
tag | AMG preconditioner tag |
Definition at line 572 of file amg_coarse.hpp.
void viennacl::linalg::detail::amg::amg_coarse_classic | ( | unsigned int | level, |
InternalT1 & | A, | ||
InternalT2 & | pointvector, | ||
amg_tag & | tag | ||
) |
Classical (RS) two-pass coarsening. Single-Threaded! (VIENNACL_AMG_COARSE_CLASSIC)
level | Coarse level identifier |
A | Operator matrix on all levels |
pointvector | Vector of points on all levels |
tag | AMG preconditioner tag |
Definition at line 240 of file amg_coarse.hpp.
void viennacl::linalg::detail::amg::amg_coarse_classic_onepass | ( | unsigned int | level, |
InternalT1 & | A, | ||
InternalT2 & | pointvector, | ||
amg_tag & | tag | ||
) |
Classical (RS) one-pass coarsening. Single-Threaded! (VIENNACL_AMG_COARSE_CLASSIC_ONEPASS)
level | Course level identifier |
A | Operator matrix on all levels |
pointvector | Vector of points on all levels |
tag | AMG preconditioner tag |
Definition at line 153 of file amg_coarse.hpp.
void viennacl::linalg::detail::amg::amg_coarse_rs0 | ( | unsigned int | level, |
InternalT1 & | A, | ||
InternalT2 & | pointvector, | ||
InternalT3 & | slicing, | ||
amg_tag & | tag | ||
) |
Parallel classical RS0 coarsening. Multi-Threaded! (VIENNACL_AMG_COARSE_RS0 || VIENNACL_AMG_COARSE_RS3)
level | Coarse level identifier |
A | Operator matrix on all level |
pointvector | Vector of points on all levels |
slicing | Partitioning of the system matrix and the other data structures to different processors |
tag | AMG preconditioner tag |
Definition at line 363 of file amg_coarse.hpp.
void viennacl::linalg::detail::amg::amg_coarse_rs3 | ( | unsigned int | level, |
InternalT1 & | A, | ||
InternalT2 & | pointvector, | ||
InternalT3 & | slicing, | ||
amg_tag & | tag | ||
) |
RS3 coarsening. Single-Threaded! (VIENNACL_AMG_COARSE_RS3)
level | Coarse level identifier |
A | Operator matrix on all levels |
pointvector | Vector of points on all levels |
slicing | Partitioning of the system matrix and the other data structures to different processors |
tag | AMG preconditioner tag |
Definition at line 443 of file amg_coarse.hpp.
void viennacl::linalg::detail::amg::amg_galerkin_prod | ( | SparseMatrixT & | A, |
SparseMatrixT & | P, | ||
SparseMatrixT & | RES | ||
) |
Sparse Galerkin product: Calculates RES = trans(P)*A*P.
A | Operator matrix (quadratic) |
P | Prolongation/Interpolation matrix |
RES | Result Matrix (Galerkin operator) |
Definition at line 1368 of file amg_base.hpp.
void viennacl::linalg::detail::amg::amg_influence | ( | unsigned int | level, |
InternalT1 const & | A, | ||
InternalT2 & | pointvector, | ||
amg_tag & | tag | ||
) |
Determines strong influences in system matrix, classical approach (RS). Multithreaded!
level | Coarse level identifier |
A | Operator matrix on all levels |
pointvector | Vector of points on all levels |
tag | AMG preconditioner tag |
Definition at line 71 of file amg_coarse.hpp.
void viennacl::linalg::detail::amg::amg_interpol | ( | unsigned int | level, |
InternalT1 & | A, | ||
InternalT1 & | P, | ||
InternalT2 & | pointvector, | ||
amg_tag & | tag | ||
) |
Calls the right function to build interpolation matrix.
level | Coarse level identifier |
A | Operator matrix on all levels |
P | Prolongation matrices. P[level] is constructed |
pointvector | Vector of points on all levels |
tag | AMG preconditioner tag |
Definition at line 53 of file amg_interpol.hpp.
void viennacl::linalg::detail::amg::amg_interpol_ag | ( | unsigned int | level, |
InternalT1 & | A, | ||
InternalT1 & | P, | ||
InternalT2 & | pointvector, | ||
amg_tag | |||
) |
AG (aggregation based) interpolation. Multi-Threaded! (VIENNACL_INTERPOL_SA)
level | Coarse level identifier |
A | Operator matrix on all levels |
P | Prolongation matrices. P[level] is constructed |
pointvector | Vector of points on all levels |
Definition at line 350 of file amg_interpol.hpp.
void viennacl::linalg::detail::amg::amg_interpol_classic | ( | unsigned int | level, |
InternalT1 & | A, | ||
InternalT1 & | P, | ||
InternalT2 & | pointvector, | ||
amg_tag & | tag | ||
) |
Classical interpolation. Don't use with onepass classical coarsening or RS0 (Yang, p.14)! Multi-threaded! (VIENNACL_AMG_INTERPOL_CLASSIC)
level | Coarse level identifier |
A | Operator matrix on all levels |
P | Prolongation matrices. P[level] is constructed |
pointvector | Vector of points on all levels |
tag | AMG preconditioner tag |
Definition at line 171 of file amg_interpol.hpp.
void viennacl::linalg::detail::amg::amg_interpol_direct | ( | unsigned int | level, |
InternalT1 & | A, | ||
InternalT1 & | P, | ||
InternalT2 & | pointvector, | ||
amg_tag & | tag | ||
) |
Direct interpolation. Multi-threaded! (VIENNACL_AMG_INTERPOL_DIRECT)
level | Coarse level identifier |
A | Operator matrix on all levels |
P | Prolongation matrices. P[level] is constructed |
pointvector | Vector of points on all levels |
tag | AMG preconditioner tag |
Definition at line 72 of file amg_interpol.hpp.
void viennacl::linalg::detail::amg::amg_interpol_sa | ( | unsigned int | level, |
InternalT1 & | A, | ||
InternalT1 & | P, | ||
InternalT2 & | pointvector, | ||
amg_tag & | tag | ||
) |
SA (smoothed aggregate) interpolation. Multi-Threaded! (VIENNACL_INTERPOL_SA)
level | Coarse level identifier |
A | Operator matrix on all levels |
P | Prolongation matrices. P[level] is constructed |
pointvector | Vector of points on all levels |
tag | AMG preconditioner tag |
Definition at line 392 of file amg_interpol.hpp.
void viennacl::linalg::detail::amg::amg_mat_prod | ( | SparseMatrixT & | A, |
SparseMatrixT & | B, | ||
SparseMatrixT & | RES | ||
) |
Sparse matrix product. Calculates RES = A*B.
A | Left Matrix |
B | Right Matrix |
RES | Result Matrix |
Definition at line 1330 of file amg_base.hpp.
void viennacl::linalg::detail::amg::amg_truncate_row | ( | SparseMatrixT & | P, |
unsigned int | row, | ||
amg_tag & | tag | ||
) |
Interpolation truncation (for VIENNACL_AMG_INTERPOL_DIRECT and VIENNACL_AMG_INTERPOL_CLASSIC)
P | Interpolation matrix |
row | Row which has to be truncated |
tag | AMG preconditioner tag |
Definition at line 285 of file amg_interpol.hpp.
void viennacl::linalg::detail::amg::printmatrix | ( | MatrixT & | , |
int | |||
) |
Definition at line 77 of file amg_debug.hpp.
void viennacl::linalg::detail::amg::printvector | ( | VectorT const & | ) |
Definition at line 80 of file amg_debug.hpp.
void viennacl::linalg::detail::amg::test_interpolation | ( | SparseMatrixT & | A, |
SparseMatrixT & | P, | ||
PointVectorT & | Pointvector | ||
) |
Test if interpolation matrix makes sense. Only vanilla test though! Only checks if basic requirements are met!
A | Operator matrix (quadratic) |
P | Prolongation/Interpolation matrix |
Pointvector | Vector of points |
Definition at line 1458 of file amg_base.hpp.
void viennacl::linalg::detail::amg::test_triplematprod | ( | SparseMatrixT & | A, |
SparseMatrixT & | P, | ||
SparseMatrixT & | A_i1 | ||
) |
Test triple-matrix product by comparing it to ublas functions. Very slow for large matrices!
A | Operator matrix (quadratic) |
P | Prolongation/Interpolation matrix |
A_i1 | Result Matrix |
Definition at line 1424 of file amg_base.hpp.