ViennaCL - The Vienna Computing Library  1.7.0
Free open-source GPU-accelerated linear algebra and solver library.
viennacl::linalg::cg_tag Class Reference

A tag for the conjugate gradient Used for supplying solver parameters and for dispatching the solve() function. More...

#include <cg.hpp>

Public Member Functions

 cg_tag (double tol=1e-8, unsigned int max_iterations=300)
 The constructor. More...
 
double tolerance () const
 Returns the relative tolerance. More...
 
double abs_tolerance () const
 Returns the absolute tolerance. More...
 
void abs_tolerance (double new_tol)
 Sets the absolute tolerance. More...
 
unsigned int max_iterations () const
 Returns the maximum number of iterations. More...
 
unsigned int iters () const
 Return the number of solver iterations: More...
 
void iters (unsigned int i) const
 
double error () const
 Returns the estimated relative error at the end of the solver run. More...
 
void error (double e) const
 Sets the estimated relative error at the end of the solver run. More...
 

Detailed Description

A tag for the conjugate gradient Used for supplying solver parameters and for dispatching the solve() function.

Examples:
amg.cpp, iterative-armadillo.cpp, iterative-custom.cpp, iterative-eigen.cpp, iterative-mtl4.cpp, iterative-ublas.cpp, iterative.cpp, matrix-free.cpp, and multithreaded_cg.cpp.

Definition at line 48 of file cg.hpp.

Constructor & Destructor Documentation

viennacl::linalg::cg_tag::cg_tag ( double  tol = 1e-8,
unsigned int  max_iterations = 300 
)
inline

The constructor.

Parameters
tolRelative tolerance for the residual (solver quits if ||r|| < tol * ||r_initial||)
max_iterationsThe maximum number of iterations

Definition at line 56 of file cg.hpp.

Member Function Documentation

double viennacl::linalg::cg_tag::abs_tolerance ( ) const
inline

Returns the absolute tolerance.

Definition at line 62 of file cg.hpp.

void viennacl::linalg::cg_tag::abs_tolerance ( double  new_tol)
inline

Sets the absolute tolerance.

Definition at line 64 of file cg.hpp.

double viennacl::linalg::cg_tag::error ( ) const
inline

Returns the estimated relative error at the end of the solver run.

Definition at line 74 of file cg.hpp.

void viennacl::linalg::cg_tag::error ( double  e) const
inline

Sets the estimated relative error at the end of the solver run.

Definition at line 76 of file cg.hpp.

unsigned int viennacl::linalg::cg_tag::iters ( ) const
inline

Return the number of solver iterations:

Definition at line 70 of file cg.hpp.

void viennacl::linalg::cg_tag::iters ( unsigned int  i) const
inline

Definition at line 71 of file cg.hpp.

unsigned int viennacl::linalg::cg_tag::max_iterations ( ) const
inline

Returns the maximum number of iterations.

Definition at line 67 of file cg.hpp.

double viennacl::linalg::cg_tag::tolerance ( ) const
inline

Returns the relative tolerance.

Definition at line 59 of file cg.hpp.


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