ViennaCL - The Vienna Computing Library: viennacl::linalg::amg_tag Class Reference

ViennaCL - The Vienna Computing Library 1.7.1 Free open-source GPU-accelerated linear algebra and solver library. |

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
viennacl::linalg::amg_tag Class Reference

A tag for algebraic multigrid (AMG). Used to transport information from the user to the implementation. More...

`#include <amg_base.hpp>`

## Public Member Functions
| amg_tag ()
| The constructor, setting default values for the various parameters. More...
void | set_coarsening_method (amg_coarsening_method s)
| Sets the strategy used for constructing coarse grids. More...
amg_coarsening_method | get_coarsening_method () const
| Returns the current coarsening strategy. More...
void | set_interpolation_method (amg_interpolation_method interpol)
| Sets the interpolation method to the provided method. More...
amg_interpolation_method | get_interpolation_method () const
| Returns the current interpolation method. More...
void | set_strong_connection_threshold (double threshold)
| Sets the strong connection threshold. Customizations by the user essential for best results! More...
double | get_strong_connection_threshold () const
| Returns the strong connection threshold parameter. More...
void | set_jacobi_weight (double w)
| Sets the weight (damping) for the Jacobi smoother. More...
double | get_jacobi_weight () const
| Returns the Jacobi smoother weight (damping). More...
void | set_presmooth_steps (vcl_size_t steps)
| Sets the number of smoother applications on the fine level before restriction to the coarser level. More...
vcl_size_t | get_presmooth_steps () const
| Returns the number of smoother applications on the fine level before restriction to the coarser level. More...
void | set_postsmooth_steps (vcl_size_t steps)
| Sets the number of smoother applications on the coarse level before interpolation to the finer level. More...
vcl_size_t | get_postsmooth_steps () const
| Returns the number of smoother applications on the coarse level before interpolation to the finer level. More...
void | set_coarse_levels (vcl_size_t levels)
| Sets the number of coarse levels. If set to zero, then coarse levels are constructed until the cutoff size is reached. More...
vcl_size_t | get_coarse_levels () const
| Returns the number of coarse levels. If zero, then coarse levels are constructed until the cutoff size is reached. More...
void | set_coarsening_cutoff (vcl_size_t size)
| Sets the coarse grid size for which the recursive multigrid scheme is stopped and a direct solver is used. More...
vcl_size_t | get_coarsening_cutoff () const
| Returns the coarse grid size for which the recursive multigrid scheme is stopped and a direct solver is used. More...
void | set_setup_context (viennacl::context ctx)
| Sets the ViennaCL context for the setup stage. Set this to a host context if you want to run the setup on the host. More...
viennacl::context const & | get_setup_context () const
| Returns the ViennaCL context for the preconditioenr setup. More...
void | set_target_context (viennacl::context ctx)
| Sets the ViennaCL context for the solver cycle stage (i.e. preconditioner applications). More...
viennacl::context const & | get_target_context () const
| Returns the ViennaCL context for the solver cycle stage (i.e. preconditioner applications). More...

## Detailed Description

A tag for algebraic multigrid (AMG). Used to transport information from the user to the implementation.

Examples:
  amg.cpp.

Definition at line 64 of file amg_base.hpp.

## Constructor & Destructor Documentation

viennacl::linalg::amg_tag::amg_tag | ( |  | ) |
| inline

The constructor, setting default values for the various parameters.

Default coarsening routine: Aggreggation based on maximum independent sets of distance (MIS-2) Default interpolation routine: Smoothed aggregation Default threshold for strong connections: 0.1 (customizations are recommeded!) Default weight for Jacobi smoother: 1.0 Default number of pre-smooth operations: 2 Default number of post-smooth operations: 2 Default number of coarse levels: 0 (this indicates that as many coarse levels as needed are constructed until the cutoff is reached) Default coarse grid size for direct solver (coarsening cutoff): 50

Definition at line 78 of file amg_base.hpp.

## Member Function Documentation

vcl_size_t viennacl::linalg::amg_tag::get_coarse_levels | ( |  | ) | const
| inline

Returns the number of coarse levels. If zero, then coarse levels are constructed until the cutoff size is reached.

Definition at line 128 of file amg_base.hpp.

vcl_size_t viennacl::linalg::amg_tag::get_coarsening_cutoff | ( |  | ) | const
| inline

Returns the coarse grid size for which the recursive multigrid scheme is stopped and a direct solver is used.

Definition at line 133 of file amg_base.hpp.

amg_coarsening_method viennacl::linalg::amg_tag::get_coarsening_method | ( |  | ) | const
| inline

Returns the current coarsening strategy.

Definition at line 88 of file amg_base.hpp.

amg_interpolation_method viennacl::linalg::amg_tag::get_interpolation_method | ( |  | ) | const
| inline

Returns the current interpolation method.

Definition at line 93 of file amg_base.hpp.

double viennacl::linalg::amg_tag::get_jacobi_weight | ( |  | ) | const
| inline

Returns the Jacobi smoother weight (damping).

Definition at line 113 of file amg_base.hpp.

vcl_size_t viennacl::linalg::amg_tag::get_postsmooth_steps | ( |  | ) | const
| inline

Returns the number of smoother applications on the coarse level before interpolation to the finer level.

Definition at line 123 of file amg_base.hpp.

vcl_size_t viennacl::linalg::amg_tag::get_presmooth_steps | ( |  | ) | const
| inline

Returns the number of smoother applications on the fine level before restriction to the coarser level.

Definition at line 118 of file amg_base.hpp.

viennacl::context const& viennacl::linalg::amg_tag::get_setup_context | ( |  | ) | const
| inline

Returns the ViennaCL context for the preconditioenr setup.

Definition at line 142 of file amg_base.hpp.

double viennacl::linalg::amg_tag::get_strong_connection_threshold | ( |  | ) | const
| inline

Returns the strong connection threshold parameter.

See Also
  set_strong_connection_threshold() for an explanation of the threshold parameter

Definition at line 105 of file amg_base.hpp.

viennacl::context const& viennacl::linalg::amg_tag::get_target_context | ( |  | ) | const
| inline

Returns the ViennaCL context for the solver cycle stage (i.e. preconditioner applications).

Definition at line 150 of file amg_base.hpp.

void viennacl::linalg::amg_tag::set_coarse_levels | ( | vcl_size_t | levels | ) |
| inline

Sets the number of coarse levels. If set to zero, then coarse levels are constructed until the cutoff size is reached.

Definition at line 126 of file amg_base.hpp.

void viennacl::linalg::amg_tag::set_coarsening_cutoff | ( | vcl_size_t | size | ) |
| inline

Sets the coarse grid size for which the recursive multigrid scheme is stopped and a direct solver is used.

Definition at line 131 of file amg_base.hpp.

void viennacl::linalg::amg_tag::set_coarsening_method | ( | amg_coarsening_method | s | ) |
| inline

Sets the strategy used for constructing coarse grids.

Examples:
  amg.cpp.

Definition at line 86 of file amg_base.hpp.

void viennacl::linalg::amg_tag::set_interpolation_method | ( | amg_interpolation_method | interpol | ) |
| inline

Sets the interpolation method to the provided method.

Examples:
  amg.cpp.

Definition at line 91 of file amg_base.hpp.

void viennacl::linalg::amg_tag::set_jacobi_weight | ( | double | w | ) |
| inline

Sets the weight (damping) for the Jacobi smoother.

The optimal value depends on the problem at hand. Values of 0.67 or 1.0 are usually a good starting point for further experiments.

Examples:
  amg.cpp.

Definition at line 111 of file amg_base.hpp.

void viennacl::linalg::amg_tag::set_postsmooth_steps | ( | vcl_size_t | steps | ) |
| inline

Sets the number of smoother applications on the coarse level before interpolation to the finer level.

Examples:
  amg.cpp.

Definition at line 121 of file amg_base.hpp.

void viennacl::linalg::amg_tag::set_presmooth_steps | ( | vcl_size_t | steps | ) |
| inline

Sets the number of smoother applications on the fine level before restriction to the coarser level.

Examples:
  amg.cpp.

Definition at line 116 of file amg_base.hpp.

void viennacl::linalg::amg_tag::set_setup_context | ( | viennacl::context | ctx | ) |
| inline

Sets the ViennaCL context for the setup stage. Set this to a host context if you want to run the setup on the host.

Set the ViennaCL context for the solver application via set_target_context(). Target and setup context can be different.

Examples:
  amg.cpp.

Definition at line 140 of file amg_base.hpp.

void viennacl::linalg::amg_tag::set_strong_connection_threshold | ( | double | threshold | ) |
| inline

Sets the strong connection threshold. Customizations by the user essential for best results!

With classical interpolation, a connection is considered strong if |a_ij| >= threshold * max_k(|a_ik|) Strength of connection currently ignored for aggregation-based coarsening (to be added in the future).

Examples:
  amg.cpp.

Definition at line 100 of file amg_base.hpp.

void viennacl::linalg::amg_tag::set_target_context | ( | viennacl::context | ctx | ) |
| inline

Sets the ViennaCL context for the solver cycle stage (i.e. preconditioner applications).

Since the cycle stage easily benefits from accelerators, you usually want to set this to a CUDA or OpenCL-enabled context.

Examples:
  amg.cpp.

Definition at line 148 of file amg_base.hpp.

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

- viennacl/linalg/detail/amg/amg_base.hpp