CheMPS2
CheMPS2::ConjugateGradient Class Reference

#include <ConjugateGradient.h>

Public Member Functions

 ConjugateGradient (const int veclength_in, const double RTOL_in, const double DIAG_CUTOFF_in, const bool print_in)
 Constructor. More...
 
virtual ~ConjugateGradient ()
 Destructor.
 
char step (double **pointers)
 The iterator to converge the ground state vector. More...
 
int get_num_matvec () const
 Get the number of matrix vector multiplications which have been performed. More...
 

Detailed Description

Conjugate gradient class.

Author
Sebastian Wouters sebas.nosp@m.tian.nosp@m.woute.nosp@m.rs@g.nosp@m.mail..nosp@m.com
Date
January 27, 2016

The ConjugateGradient class implements the conjugate gradient algorithm to solve the symmetric linear problem
$ operator * x = b $.
With precon = 1 / sqrt( diag( operator ) ), the problem is turned into
$ precon * operator * precon * xtilde = precon * b $
$ x = precon * xtilde $.

Definition at line 37 of file ConjugateGradient.h.

Constructor & Destructor Documentation

CheMPS2::ConjugateGradient::ConjugateGradient ( const int  veclength_in,
const double  RTOL_in,
const double  DIAG_CUTOFF_in,
const bool  print_in 
)

Constructor.

Parameters
veclength_inLinear dimension of the symmetric matrix
RTOL_inThe tolerance for the two-norm of the residual
DIAG_CUTOFF_inThe cutoff to truncate the diagonal elements of operator
print_inWhether or not to print

Definition at line 29 of file ConjugateGradient.cpp.

Member Function Documentation

int CheMPS2::ConjugateGradient::get_num_matvec ( ) const

Get the number of matrix vector multiplications which have been performed.

Returns
The number of matrix vector multiplications which have been performed

Definition at line 61 of file ConjugateGradient.cpp.

+ Here is the caller graph for this function:

char CheMPS2::ConjugateGradient::step ( double **  pointers)

The iterator to converge the ground state vector.

Parameters
pointersArray of double* of length 3 to return pointers to vectors to the caller
Returns
Instruction character. 'A' means copy the initial guess to pointers[0], the diagonal of the symmetric matrix to pointers[1], and the right-hand side of the problem to pointers[2]. 'B' means calculate pointers[1] = symmetric matrix times pointers[0]. 'C' means that the converged solution can be copied back from pointers[0], and the residual norm from pointers[1][0]. 'D' means that an error has occurred.

Definition at line 63 of file ConjugateGradient.cpp.

+ Here is the caller graph for this function:


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