PARALUTION  1.0.0
PARALUTION
paralution::MixedPrecisionDC< OperatorTypeH, VectorTypeH, ValueTypeH, OperatorTypeL, VectorTypeL, ValueTypeL > Class Template Reference

#include <mixed_precision.hpp>

Inheritance diagram for paralution::MixedPrecisionDC< OperatorTypeH, VectorTypeH, ValueTypeH, OperatorTypeL, VectorTypeL, ValueTypeL >:
paralution::IterativeLinearSolver< OperatorTypeH, VectorTypeH, ValueTypeH > paralution::Solver< OperatorTypeH, VectorTypeH, ValueTypeH > paralution::ParalutionObj

Public Member Functions

 MixedPrecisionDC ()
 
virtual ~MixedPrecisionDC ()
 
virtual void Print (void) const
 Print information about the solver. More...
 
void Set (Solver< OperatorTypeL, VectorTypeL, ValueTypeL > &Solver_L)
 
virtual void Build (void)
 Build the solver (data allocation, structure computation, numerical computation) More...
 
virtual void Clear (void)
 Clear (free all local data) the solver. More...
 
void Init (const double abs_tol, const double rel_tol, const double div_tol, const int max_iter)
 Initialize the solver with absolute/relative/divergence tolerance and maximum number of iterations. More...
 
void Init (const double abs_tol, const double rel_tol, const double div_tol, const int min_iter, const int max_iter)
 Initialize the solver with absolute/relative/divergence tolerance and minimum/maximum number of iterations. More...
 
void InitMinIter (const int min_iter)
 Set the minimum number of iterations. More...
 
void InitMaxIter (const int max_iter)
 Set the maximum number of iterations. More...
 
void InitTol (const double abs, const double rel, const double div)
 Set the absolute/relative/divergence tolerance. More...
 
void SetResidualNorm (const int resnorm)
 Set the residual norm to L1, L2 or Inf norm resnorm == 1 L1 Norm resnorm == 2 L2 Norm (default) resnorm == 3 Inf Norm. More...
 
void RecordResidualHistory (void)
 Record the residual history. More...
 
void RecordHistory (const std::string filename) const
 Write the history to file. More...
 
virtual void Verbose (const int verb=1)
 Provide verbose output of the solver: verb == 0 no output verb == 1 print info about the solver (start,end); verb == 2 print (iter, residual) via iteration control;. More...
 
virtual void Solve (const VectorTypeH &rhs, VectorTypeH *x)
 Solve Operator x = rhs. More...
 
virtual void SetPreconditioner (Solver< OperatorTypeH, VectorTypeH, ValueTypeH > &precond)
 Set a preconditioner of the linear solver. More...
 
virtual int GetIterationCount (void)
 Return the iteration count. More...
 
virtual double GetCurrentResidual (void)
 Return the current residual. More...
 
virtual int GetSolverStatus (void)
 Return the current status. More...
 
virtual int GetAmaxResidualIndex (void)
 Return absolute maximum index of residual vector when using Linf norm. More...
 
void SetOperator (const OperatorTypeH &op)
 Set the Operator of the solver. More...
 
virtual void ResetOperator (const OperatorTypeH &op)
 Reset the operator; see ReBuildNumeric. More...
 
virtual void SolveZeroSol (const VectorTypeH &rhs, VectorTypeH *x)
 Solve Operator x = rhs; but set first the init x = 0. More...
 
virtual void ReBuildNumeric (void)
 Rebuild only with numerical computation (no allocation or data structure computation) More...
 
virtual void MoveToHost (void)
 Move all the data (i.e. move the solver) to the host. More...
 
virtual void MoveToAccelerator (void)
 Move all the data (i.e. move the solver) to the accelerator. More...
 

Protected Member Functions

virtual void SolveNonPrecond_ (const VectorTypeH &rhs, VectorTypeH *x)
 Non-preconditioner solution procedure. More...
 
virtual void SolvePrecond_ (const VectorTypeH &rhs, VectorTypeH *x)
 Preconditioned solution procedure. More...
 
virtual void PrintStart_ (void) const
 Print starting msg of the solver. More...
 
virtual void PrintEnd_ (void) const
 Print ending msg of the solver. More...
 
virtual void MoveToHostLocalData_ (void)
 Move all local data to the host. More...
 
virtual void MoveToAcceleratorLocalData_ (void)
 Move all local data to the accelerator. More...
 
ValueTypeH Norm (const VectorTypeH &vec)
 Computes the vector norm. More...
 

Protected Attributes

IterationControl iter_ctrl_
 Iteration control (monitor) More...
 
int res_norm_
 Residual norm res_norm = 1 L1 Norm res_norm = 2 L2 Norm res_norm = 3 Linf Norm. More...
 
int index_
 Absolute maximum index of residual vector when using Linf norm. More...
 
const OperatorTypeH * op_
 Pointer to the operator. More...
 
Solver< OperatorTypeH, VectorTypeH, ValueTypeH > * precond_
 Pointer to the defined preconditioner. More...
 
bool build_
 Flag == true after building the solver (e.g. Build()) More...
 
LocalVector< intpermutation_
 Permutation vector (used if the solver performs permutation/re-ordering techniques) More...
 
int verb_
 Verbose flag verb == 0 no output verb == 1 print info about the solver (start,end); verb == 2 print (iter, residual) via iteration control;. More...
 
size_t global_obj_id
 

Private Attributes

Solver< OperatorTypeL, VectorTypeL, ValueTypeL > * Solver_L_
 
VectorTypeH r_h_
 
VectorTypeL r_l_
 
VectorTypeH * x_h_
 
VectorTypeL d_l_
 
VectorTypeH d_h_
 
const OperatorTypeH * op_h_
 
OperatorTypeL * op_l_
 

Constructor & Destructor Documentation

template<class OperatorTypeH , class VectorTypeH , typename ValueTypeH , class OperatorTypeL , class VectorTypeL , typename ValueTypeL >
paralution::MixedPrecisionDC< OperatorTypeH, VectorTypeH, ValueTypeH, OperatorTypeL, VectorTypeL, ValueTypeL >::MixedPrecisionDC ( )
template<class OperatorTypeH , class VectorTypeH , typename ValueTypeH , class OperatorTypeL , class VectorTypeL , typename ValueTypeL >
paralution::MixedPrecisionDC< OperatorTypeH, VectorTypeH, ValueTypeH, OperatorTypeL, VectorTypeL, ValueTypeL >::~MixedPrecisionDC ( )
virtual

Member Function Documentation

template<class OperatorTypeH , class VectorTypeH , typename ValueTypeH , class OperatorTypeL , class VectorTypeL , typename ValueTypeL >
void paralution::MixedPrecisionDC< OperatorTypeH, VectorTypeH, ValueTypeH, OperatorTypeL, VectorTypeL, ValueTypeL >::Build ( void  )
virtual

Build the solver (data allocation, structure computation, numerical computation)

Reimplemented from paralution::Solver< OperatorTypeH, VectorTypeH, ValueTypeH >.

Referenced by main().

template<class OperatorTypeH , class VectorTypeH , typename ValueTypeH , class OperatorTypeL , class VectorTypeL , typename ValueTypeL >
void paralution::MixedPrecisionDC< OperatorTypeH, VectorTypeH, ValueTypeH, OperatorTypeL, VectorTypeL, ValueTypeL >::Clear ( void  )
virtual

Clear (free all local data) the solver.

Reimplemented from paralution::Solver< OperatorTypeH, VectorTypeH, ValueTypeH >.

Referenced by main().

virtual int paralution::IterativeLinearSolver< OperatorTypeH , VectorTypeH , ValueTypeH >::GetAmaxResidualIndex ( void  )
virtualinherited

Return absolute maximum index of residual vector when using Linf norm.

virtual double paralution::IterativeLinearSolver< OperatorTypeH , VectorTypeH , ValueTypeH >::GetCurrentResidual ( void  )
virtualinherited

Return the current residual.

virtual int paralution::IterativeLinearSolver< OperatorTypeH , VectorTypeH , ValueTypeH >::GetIterationCount ( void  )
virtualinherited

Return the iteration count.

virtual int paralution::IterativeLinearSolver< OperatorTypeH , VectorTypeH , ValueTypeH >::GetSolverStatus ( void  )
virtualinherited

Return the current status.

void paralution::IterativeLinearSolver< OperatorTypeH , VectorTypeH , ValueTypeH >::Init ( const double  abs_tol,
const double  rel_tol,
const double  div_tol,
const int  max_iter 
)
inherited

Initialize the solver with absolute/relative/divergence tolerance and maximum number of iterations.

void paralution::IterativeLinearSolver< OperatorTypeH , VectorTypeH , ValueTypeH >::Init ( const double  abs_tol,
const double  rel_tol,
const double  div_tol,
const int  min_iter,
const int  max_iter 
)
inherited

Initialize the solver with absolute/relative/divergence tolerance and minimum/maximum number of iterations.

void paralution::IterativeLinearSolver< OperatorTypeH , VectorTypeH , ValueTypeH >::InitMaxIter ( const int  max_iter)
inherited

Set the maximum number of iterations.

void paralution::IterativeLinearSolver< OperatorTypeH , VectorTypeH , ValueTypeH >::InitMinIter ( const int  min_iter)
inherited

Set the minimum number of iterations.

void paralution::IterativeLinearSolver< OperatorTypeH , VectorTypeH , ValueTypeH >::InitTol ( const double  abs,
const double  rel,
const double  div 
)
inherited

Set the absolute/relative/divergence tolerance.

virtual void paralution::Solver< OperatorTypeH , VectorTypeH , ValueTypeH >::MoveToAccelerator ( void  )
virtualinherited

Move all the data (i.e. move the solver) to the accelerator.

template<class OperatorTypeH , class VectorTypeH , typename ValueTypeH , class OperatorTypeL , class VectorTypeL , typename ValueTypeL >
void paralution::MixedPrecisionDC< OperatorTypeH, VectorTypeH, ValueTypeH, OperatorTypeL, VectorTypeL, ValueTypeL >::MoveToAcceleratorLocalData_ ( void  )
protectedvirtual

Move all local data to the accelerator.

Implements paralution::Solver< OperatorTypeH, VectorTypeH, ValueTypeH >.

virtual void paralution::Solver< OperatorTypeH , VectorTypeH , ValueTypeH >::MoveToHost ( void  )
virtualinherited

Move all the data (i.e. move the solver) to the host.

template<class OperatorTypeH , class VectorTypeH , typename ValueTypeH , class OperatorTypeL , class VectorTypeL , typename ValueTypeL >
void paralution::MixedPrecisionDC< OperatorTypeH, VectorTypeH, ValueTypeH, OperatorTypeL, VectorTypeL, ValueTypeL >::MoveToHostLocalData_ ( void  )
protectedvirtual

Move all local data to the host.

Implements paralution::Solver< OperatorTypeH, VectorTypeH, ValueTypeH >.

ValueTypeH paralution::IterativeLinearSolver< OperatorTypeH , VectorTypeH , ValueTypeH >::Norm ( const VectorTypeH &  vec)
protectedinherited

Computes the vector norm.

template<class OperatorTypeH , class VectorTypeH , typename ValueTypeH , class OperatorTypeL , class VectorTypeL , typename ValueTypeL >
void paralution::MixedPrecisionDC< OperatorTypeH, VectorTypeH, ValueTypeH, OperatorTypeL, VectorTypeL, ValueTypeL >::Print ( void  ) const
virtual

Print information about the solver.

Implements paralution::Solver< OperatorTypeH, VectorTypeH, ValueTypeH >.

template<class OperatorTypeH , class VectorTypeH , typename ValueTypeH , class OperatorTypeL , class VectorTypeL , typename ValueTypeL >
void paralution::MixedPrecisionDC< OperatorTypeH, VectorTypeH, ValueTypeH, OperatorTypeL, VectorTypeL, ValueTypeL >::PrintEnd_ ( void  ) const
protectedvirtual

Print ending msg of the solver.

Implements paralution::Solver< OperatorTypeH, VectorTypeH, ValueTypeH >.

template<class OperatorTypeH , class VectorTypeH , typename ValueTypeH , class OperatorTypeL , class VectorTypeL , typename ValueTypeL >
void paralution::MixedPrecisionDC< OperatorTypeH, VectorTypeH, ValueTypeH, OperatorTypeL, VectorTypeL, ValueTypeL >::PrintStart_ ( void  ) const
protectedvirtual

Print starting msg of the solver.

Implements paralution::Solver< OperatorTypeH, VectorTypeH, ValueTypeH >.

virtual void paralution::Solver< OperatorTypeH , VectorTypeH , ValueTypeH >::ReBuildNumeric ( void  )
virtualinherited

Rebuild only with numerical computation (no allocation or data structure computation)

void paralution::IterativeLinearSolver< OperatorTypeH , VectorTypeH , ValueTypeH >::RecordHistory ( const std::string  filename) const
inherited

Write the history to file.

void paralution::IterativeLinearSolver< OperatorTypeH , VectorTypeH , ValueTypeH >::RecordResidualHistory ( void  )
inherited

Record the residual history.

virtual void paralution::Solver< OperatorTypeH , VectorTypeH , ValueTypeH >::ResetOperator ( const OperatorTypeH &  op)
virtualinherited

Reset the operator; see ReBuildNumeric.

template<class OperatorTypeH , class VectorTypeH , typename ValueTypeH , class OperatorTypeL , class VectorTypeL , typename ValueTypeL >
void paralution::MixedPrecisionDC< OperatorTypeH, VectorTypeH, ValueTypeH, OperatorTypeL, VectorTypeL, ValueTypeL >::Set ( Solver< OperatorTypeL, VectorTypeL, ValueTypeL > &  Solver_L)

Referenced by main().

void paralution::Solver< OperatorTypeH , VectorTypeH , ValueTypeH >::SetOperator ( const OperatorTypeH &  op)
inherited

Set the Operator of the solver.

Referenced by main().

virtual void paralution::IterativeLinearSolver< OperatorTypeH , VectorTypeH , ValueTypeH >::SetPreconditioner ( Solver< OperatorTypeH , VectorTypeH , ValueTypeH > &  precond)
virtualinherited

Set a preconditioner of the linear solver.

void paralution::IterativeLinearSolver< OperatorTypeH , VectorTypeH , ValueTypeH >::SetResidualNorm ( const int  resnorm)
inherited

Set the residual norm to L1, L2 or Inf norm resnorm == 1 L1 Norm resnorm == 2 L2 Norm (default) resnorm == 3 Inf Norm.

virtual void paralution::IterativeLinearSolver< OperatorTypeH , VectorTypeH , ValueTypeH >::Solve ( const VectorTypeH &  rhs,
VectorTypeH *  x 
)
virtualinherited

Solve Operator x = rhs.

Implements paralution::Solver< OperatorTypeH, VectorTypeH, ValueTypeH >.

Referenced by main().

template<class OperatorTypeH , class VectorTypeH , typename ValueTypeH , class OperatorTypeL , class VectorTypeL , typename ValueTypeL >
void paralution::MixedPrecisionDC< OperatorTypeH, VectorTypeH, ValueTypeH, OperatorTypeL, VectorTypeL, ValueTypeL >::SolveNonPrecond_ ( const VectorTypeH &  rhs,
VectorTypeH *  x 
)
protectedvirtual

Non-preconditioner solution procedure.

Implements paralution::IterativeLinearSolver< OperatorTypeH, VectorTypeH, ValueTypeH >.

template<class OperatorTypeH , class VectorTypeH , typename ValueTypeH , class OperatorTypeL , class VectorTypeL , typename ValueTypeL >
void paralution::MixedPrecisionDC< OperatorTypeH, VectorTypeH, ValueTypeH, OperatorTypeL, VectorTypeL, ValueTypeL >::SolvePrecond_ ( const VectorTypeH &  rhs,
VectorTypeH *  x 
)
protectedvirtual
virtual void paralution::Solver< OperatorTypeH , VectorTypeH , ValueTypeH >::SolveZeroSol ( const VectorTypeH &  rhs,
VectorTypeH *  x 
)
virtualinherited

Solve Operator x = rhs; but set first the init x = 0.

virtual void paralution::IterativeLinearSolver< OperatorTypeH , VectorTypeH , ValueTypeH >::Verbose ( const int  verb = 1)
virtualinherited

Provide verbose output of the solver: verb == 0 no output verb == 1 print info about the solver (start,end); verb == 2 print (iter, residual) via iteration control;.

Reimplemented from paralution::Solver< OperatorTypeH, VectorTypeH, ValueTypeH >.

Field Documentation

bool paralution::Solver< OperatorTypeH , VectorTypeH , ValueTypeH >::build_
protectedinherited

Flag == true after building the solver (e.g. Build())

template<class OperatorTypeH, class VectorTypeH, typename ValueTypeH, class OperatorTypeL, class VectorTypeL, typename ValueTypeL>
VectorTypeH paralution::MixedPrecisionDC< OperatorTypeH, VectorTypeH, ValueTypeH, OperatorTypeL, VectorTypeL, ValueTypeL >::d_h_
private
template<class OperatorTypeH, class VectorTypeH, typename ValueTypeH, class OperatorTypeL, class VectorTypeL, typename ValueTypeL>
VectorTypeL paralution::MixedPrecisionDC< OperatorTypeH, VectorTypeH, ValueTypeH, OperatorTypeL, VectorTypeL, ValueTypeL >::d_l_
private
size_t paralution::ParalutionObj::global_obj_id
protectedinherited
int paralution::IterativeLinearSolver< OperatorTypeH , VectorTypeH , ValueTypeH >::index_
protectedinherited

Absolute maximum index of residual vector when using Linf norm.

IterationControl paralution::IterativeLinearSolver< OperatorTypeH , VectorTypeH , ValueTypeH >::iter_ctrl_
protectedinherited

Iteration control (monitor)

const OperatorTypeH * paralution::Solver< OperatorTypeH , VectorTypeH , ValueTypeH >::op_
protectedinherited

Pointer to the operator.

template<class OperatorTypeH, class VectorTypeH, typename ValueTypeH, class OperatorTypeL, class VectorTypeL, typename ValueTypeL>
const OperatorTypeH* paralution::MixedPrecisionDC< OperatorTypeH, VectorTypeH, ValueTypeH, OperatorTypeL, VectorTypeL, ValueTypeL >::op_h_
private
template<class OperatorTypeH, class VectorTypeH, typename ValueTypeH, class OperatorTypeL, class VectorTypeL, typename ValueTypeL>
OperatorTypeL* paralution::MixedPrecisionDC< OperatorTypeH, VectorTypeH, ValueTypeH, OperatorTypeL, VectorTypeL, ValueTypeL >::op_l_
private
LocalVector<int> paralution::Solver< OperatorTypeH , VectorTypeH , ValueTypeH >::permutation_
protectedinherited

Permutation vector (used if the solver performs permutation/re-ordering techniques)

Solver<OperatorTypeH , VectorTypeH , ValueTypeH >* paralution::Solver< OperatorTypeH , VectorTypeH , ValueTypeH >::precond_
protectedinherited

Pointer to the defined preconditioner.

template<class OperatorTypeH, class VectorTypeH, typename ValueTypeH, class OperatorTypeL, class VectorTypeL, typename ValueTypeL>
VectorTypeH paralution::MixedPrecisionDC< OperatorTypeH, VectorTypeH, ValueTypeH, OperatorTypeL, VectorTypeL, ValueTypeL >::r_h_
private
template<class OperatorTypeH, class VectorTypeH, typename ValueTypeH, class OperatorTypeL, class VectorTypeL, typename ValueTypeL>
VectorTypeL paralution::MixedPrecisionDC< OperatorTypeH, VectorTypeH, ValueTypeH, OperatorTypeL, VectorTypeL, ValueTypeL >::r_l_
private
int paralution::IterativeLinearSolver< OperatorTypeH , VectorTypeH , ValueTypeH >::res_norm_
protectedinherited

Residual norm res_norm = 1 L1 Norm res_norm = 2 L2 Norm res_norm = 3 Linf Norm.

template<class OperatorTypeH, class VectorTypeH, typename ValueTypeH, class OperatorTypeL, class VectorTypeL, typename ValueTypeL>
Solver<OperatorTypeL, VectorTypeL, ValueTypeL>* paralution::MixedPrecisionDC< OperatorTypeH, VectorTypeH, ValueTypeH, OperatorTypeL, VectorTypeL, ValueTypeL >::Solver_L_
private
int paralution::Solver< OperatorTypeH , VectorTypeH , ValueTypeH >::verb_
protectedinherited

Verbose flag verb == 0 no output verb == 1 print info about the solver (start,end); verb == 2 print (iter, residual) via iteration control;.

template<class OperatorTypeH, class VectorTypeH, typename ValueTypeH, class OperatorTypeL, class VectorTypeL, typename ValueTypeL>
VectorTypeH* paralution::MixedPrecisionDC< OperatorTypeH, VectorTypeH, ValueTypeH, OperatorTypeL, VectorTypeL, ValueTypeL >::x_h_
private

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