# CG_PLUS Scalar function minimization by conjugate gradient

CG_PLUS is a FORTRAN77 program which seeks the multidimensional minimizer x of a scalar function f(x) using the conjugate gradient method, assuming that the gradient vector g(x) can be computed.

To set up the code to minimize a particular function you need to specify the following variables in the main program:

• n the number of variables
• x the initial input vector
• method the form of the conjugate gradient method used to solve the problem:
1. Fletcher-Reeves;
2. Polak-Ribiere;
3. positive Polak-Ribiere (beta = max{beta,0});
and you need to change the FCN routine in the main program to calculate the function and gradient for the particular function you want to minimize.

### Languages:

CG_PLUS is available in a FORTRAN77 version.

### Related Data and Programs:

ASA047, a FORTRAN77 library which minimizes a scalar function of several variables using the Nelder-Mead algorithm.

BRENT, a FORTRAN90 library which contains Richard Brent's routines for finding the zero, local minimizer, or global minimizer of a scalar function of a scalar argument, without the use of derivative information.

COORDINATE_SEARCH, a MATLAB program which minimizes a scalar function of several variables using the coordinate search algorithm.

DQED, a FORTRAN90 library which solves constrained least squares problems.

ENTRUST, a MATLAB program which minimizes a scalar function of several variables using trust region methods.

MINPACK, a FORTRAN90 library which carries out the least squares minimization of the residual of a set of linear or nonlinear equations.

NELDER_MEAD, a MATLAB program which minimizes a scalar function of several variables using the Nelder-Mead algorithm.

NL2SOL, a FORTRAN90 library which implements an adaptive nonlinear least-squares algorithm.

PRAXIS, a FORTRAN90 library which minimizes a scalar function of several variables.

TEST_OPT, a FORTRAN90 library which defines a number of problems for the minimization of scalar functions of multiple variables.

TOMS611, a FORTRAN90 library which minimizes a scalar functional of multiple variables.

### Reference:

1. Jean Charles Gilbert, Jorge Nocedal,
Global Convergence Properties of Conjugate Gradient Methods,
SIAM Journal on Optimization,
Volume 2, Number 1, 1992, pages 21-42.
2. Jorge More, David Thuente,
Linesearch Algorithms with Guaranteed Sufficient Decrease,
ACM Transactions on Mathematical Software,
Volume 20, Number 3, September 1994, pages 286-307.

### List of Routines:

• CGBD prints monitoring information.
• CGFAM implements conjugate gradient methods for unconstrained nonlinear optimization.
• CSTEPM computes a safeguarded step for a line search.
• CSVMOD finds a step which satisfies a sufficient decrease condition.
• DASUM takes the sum of the absolute values.
• DAXPY computes constant times a vector plus a vector.
• DCOPY copies a vector.
• DDOT forms the dot product of two vectors.
• DNRM2 returns the euclidean norm of a vector.
• DSCAL scales a vector by a constant.
• DSWAP interchanges two vectors.
• IDAMAX finds the index of element having maximum absolute value.
• TIMER returns an estimate for the elapsed user time.

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

Last revised on 18 December 2008.