PPL Logo

cgSolver Class Reference

Iterative Linear Solver: Conjugate Gradient method. More...

Collaboration diagram for cgSolver:

Collaboration graph
[legend]

Public Member Functions

 cgSolver (int n, real *x, const real *b, ILSI_Comm &comm_)
realgetSolution (void)
double getResidual (void) const
void iterate (void)

Private Attributes

int n
const realb
realx_k
allocVector r_k
allocVector s_k
allocVector tmp
ILSI_Commcomm
double residualMagSq

Detailed Description

Iterative Linear Solver: Conjugate Gradient method.

As an algorithm reference, I recommend J. Shewchuk's excellent article "An Introduction to the Conjugate Gradient Method Without the Agonizing Pain"

Orion Sky Lawlor, olawlor@acm.org, 1/16/2003

Definition at line 16 of file cg.C.


Constructor & Destructor Documentation

cgSolver::cgSolver ( int  n,
real x,
const real b,
ILSI_Comm comm_ 
)

Definition at line 42 of file cg.C.

References b, comm, copy(), ILSI_Comm::dotProduct(), ILSI_Comm::matrixVectorProduct(), n, r_k, residualMagSq, s_k, sub(), tmp, and x_k.

Here is the call graph for this function:


Member Function Documentation

real* cgSolver::getSolution ( void   )  [inline]

Definition at line 31 of file cg.C.

References x_k.

double cgSolver::getResidual ( void   )  const [inline]

Definition at line 36 of file cg.C.

References residualMagSq.

void cgSolver::iterate ( void   ) 

Definition at line 54 of file cg.C.

References alpha, beta, comm, ILSI_Comm::dotProduct(), fma(), ILSI_Comm::matrixVectorProduct(), n, r_k, residualMagSq, s_k, tmp, and x_k.

Here is the call graph for this function:


Field Documentation

int cgSolver::n [private]

Definition at line 17 of file cg.C.

Referenced by cgSolver(), and iterate().

const real* cgSolver::b [private]

Definition at line 18 of file cg.C.

Referenced by cgSolver().

real* cgSolver::x_k [private]

Definition at line 19 of file cg.C.

Referenced by cgSolver(), getSolution(), and iterate().

Definition at line 20 of file cg.C.

Referenced by cgSolver(), and iterate().

Definition at line 21 of file cg.C.

Referenced by cgSolver(), and iterate().

Definition at line 22 of file cg.C.

Referenced by cgSolver(), and iterate().

Definition at line 23 of file cg.C.

Referenced by cgSolver(), and iterate().

double cgSolver::residualMagSq [private]

Definition at line 24 of file cg.C.

Referenced by cgSolver(), getResidual(), and iterate().


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

Generated on Mon Sep 21 08:18:31 2020 for Charm++ by  doxygen 1.5.5