# CG_RC Conjugate Gradient Method with Reverse Communication

CG_RC is a FORTRAN77 library which implements the conjugate gradient method for solving a positive definite sparse linear system A*x=b, using reverse communication (RC).

### Languages:

CG_RC is available in a C version and a C++ version and a FORTRAN77 version and a FORTRAN90 version and a MATLAB version and a Python version.

### Related Data and Programs:

BACKTRACK_BINARY_RC, a FORTRAN77 library which carries out a backtrack search for a set of binary decisions, using reverse communication.

BISECTION_RC, a FORTRAN77 library which seeks a solution to the equation F(X)=0 using bisection within a user-supplied change of sign interval [A,B]. The procedure is written using reverse communication (RC).

CG, a FORTRAN77 library which implements a simple version of the conjugate gradient (CG) method for solving a system of linear equations of the form A*x=b, suitable for situations in which the matrix A is positive definite (only real, positive eigenvalues) and symmetric.

CG_PLUS, a FORTRAN77 library which implements the conjugate gradient method for minimizing a scalar function of multiple variables.

CG_SERIAL, a FORTRAN77 program which a serial version of the Conjugate Gradient (CG) NAS Parallel Benchmark .

MGMRES, a FORTRAN77 library which applies the restarted GMRES algorithm to solve a sparse linear system.

SORT_RC, a FORTRAN77library which can sort a list of any kind of objects, using reverse communication (RC).

TEMPLATED, a FORTRAN77 library which carries out simple versions of various iterative solvers. This is the double precision version.

ZERO_RC, a FORTRAN77 library which seeks solutions of a scalar nonlinear equation f(x) = 0, or a system of nonlinear equations, using reverse communication (RC).

### Reference:

1. Richard Barrett, Michael Berry, Tony Chan, James Demmel, June Donato, Jack Dongarra, Victor Eijkhout, Roidan Pozo, Charles Romine, Henk van der Vorst,
Templates for the Solution of Linear Systems: Building Blocks for Iterative Methods,
SIAM, 1994,
ISBN: 0898714710,
LC: QA297.8.T45.
2. Jonathan Shewchuk,
An introduction to the conjugate gradient method without the agonizing pain, Edition 1.25, August 1994.

### Source Code:

• cg_rc.f, the source code.
• cg_rc.sh, BASH commands to compile the source code.

### List of Routines:

• CG_RC is a reverse communication conjugate gradient routine.
• R8MAT_MV multiplies a matrix times a vector.
• R8VEC_UNIFORM_01 returns a unit pseudorandom R8VEC.
• TIMESTAMP prints out the current YMDHMS date as a timestamp.
• WATHEN returns the WATHEN matrix.
• WATHEN_ORDER returns the order of the WATHEN matrix.

You can go up one level to the FORTRAN77 source codes.

Last revised on 12 January 2013.