ViennaCL - The Vienna Computing Library  1.6.1
Free open-source GPU-accelerated linear algebra and solver library.
viennacl::linalg::detail::amg Namespace Reference

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...
 

Detailed Description

Implementation namespace for algebraic multigrid preconditioner.

Function Documentation

template<typename InternalT1 , typename InternalT2 , typename InternalT3 >
void viennacl::linalg::detail::amg::amg_coarse ( unsigned int  level,
InternalT1 &  A,
InternalT2 &  pointvector,
InternalT3 &  slicing,
amg_tag &  tag 
)

Calls the right coarsening procedure.

Parameters
levelCoarse level identifier
AOperator matrix on all levels
pointvectorVector of points on all levels
slicingPartitioning of the system matrix to different processors (only used in RS0 and RS3)
tagAMG preconditioner tag

Definition at line 52 of file amg_coarse.hpp.

template<typename InternalT1 , typename InternalT2 >
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)

Parameters
levelCoarse level identifier
AOperator matrix on all levels
pointvectorVector of points on all levels
tagAMG preconditioner tag

Definition at line 576 of file amg_coarse.hpp.

template<typename InternalT1 , typename InternalT2 >
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)

Parameters
levelCoarse level identifier
AOperator matrix on all levels
pointvectorVector of points on all levels
tagAMG preconditioner tag

Definition at line 244 of file amg_coarse.hpp.

template<typename InternalT1 , typename InternalT2 >
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)

Parameters
levelCourse level identifier
AOperator matrix on all levels
pointvectorVector of points on all levels
tagAMG preconditioner tag

Definition at line 156 of file amg_coarse.hpp.

template<typename InternalT1 , typename InternalT2 , typename InternalT3 >
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)

Parameters
levelCoarse level identifier
AOperator matrix on all level
pointvectorVector of points on all levels
slicingPartitioning of the system matrix and the other data structures to different processors
tagAMG preconditioner tag

Definition at line 367 of file amg_coarse.hpp.

template<typename InternalT1 , typename InternalT2 , typename InternalT3 >
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)

Parameters
levelCoarse level identifier
AOperator matrix on all levels
pointvectorVector of points on all levels
slicingPartitioning of the system matrix and the other data structures to different processors
tagAMG preconditioner tag

Definition at line 447 of file amg_coarse.hpp.

template<typename SparseMatrixT >
void viennacl::linalg::detail::amg::amg_galerkin_prod ( SparseMatrixT &  A,
SparseMatrixT &  P,
SparseMatrixT &  RES 
)

Sparse Galerkin product: Calculates RES = trans(P)*A*P.

Parameters
AOperator matrix (quadratic)
PProlongation/Interpolation matrix
RESResult Matrix (Galerkin operator)

Definition at line 1359 of file amg_base.hpp.

template<typename InternalT1 , typename InternalT2 >
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!

Parameters
levelCoarse level identifier
AOperator matrix on all levels
pointvectorVector of points on all levels
tagAMG preconditioner tag

Definition at line 71 of file amg_coarse.hpp.

template<typename InternalT1 , typename InternalT2 >
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.

Parameters
levelCoarse level identifier
AOperator matrix on all levels
PProlongation matrices. P[level] is constructed
pointvectorVector of points on all levels
tagAMG preconditioner tag

Definition at line 53 of file amg_interpol.hpp.

template<typename InternalT1 , typename InternalT2 >
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)

Parameters
levelCoarse level identifier
AOperator matrix on all levels
PProlongation matrices. P[level] is constructed
pointvectorVector of points on all levels

Definition at line 363 of file amg_interpol.hpp.

template<typename InternalT1 , typename InternalT2 >
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)

Parameters
levelCoarse level identifier
AOperator matrix on all levels
PProlongation matrices. P[level] is constructed
pointvectorVector of points on all levels
tagAMG preconditioner tag

Definition at line 174 of file amg_interpol.hpp.

template<typename InternalT1 , typename InternalT2 >
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)

Parameters
levelCoarse level identifier
AOperator matrix on all levels
PProlongation matrices. P[level] is constructed
pointvectorVector of points on all levels
tagAMG preconditioner tag

Definition at line 72 of file amg_interpol.hpp.

template<typename InternalT1 , typename InternalT2 >
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)

Parameters
levelCoarse level identifier
AOperator matrix on all levels
PProlongation matrices. P[level] is constructed
pointvectorVector of points on all levels
tagAMG preconditioner tag

Definition at line 407 of file amg_interpol.hpp.

template<typename SparseMatrixT >
void viennacl::linalg::detail::amg::amg_mat_prod ( SparseMatrixT &  A,
SparseMatrixT &  B,
SparseMatrixT &  RES 
)

Sparse matrix product. Calculates RES = A*B.

Parameters
ALeft Matrix
BRight Matrix
RESResult Matrix

Definition at line 1319 of file amg_base.hpp.

template<typename SparseMatrixT >
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)

Parameters
PInterpolation matrix
rowRow which has to be truncated
tagAMG preconditioner tag

Definition at line 298 of file amg_interpol.hpp.

template<typename MatrixT >
void viennacl::linalg::detail::amg::printmatrix ( MatrixT &  ,
int   
)

Definition at line 77 of file amg_debug.hpp.

template<typename VectorT >
void viennacl::linalg::detail::amg::printvector ( VectorT const &  )

Definition at line 80 of file amg_debug.hpp.

template<typename SparseMatrixT , typename PointVectorT >
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!

Parameters
AOperator matrix (quadratic)
PProlongation/Interpolation matrix
PointvectorVector of points

Definition at line 1451 of file amg_base.hpp.

template<typename SparseMatrixT >
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!

Parameters
AOperator matrix (quadratic)
PProlongation/Interpolation matrix
A_i1Result Matrix

Definition at line 1417 of file amg_base.hpp.