NAME

conjugate_gradient -- create unit to minimize function

PROTOTYPE

unitptr conjugate_gradient( int iNumOperands, int iDim, float *pfSearchDir, float (*pFunc)(int,float*), char *pcOpt, unitptr uHost)

ARGUMENTS

int iNumOperands
nr of operands to include in evalutation call
int iDim
nr of parameters for minimization
float *pfSearchDir
initial search directions [may be NULL]
float (*pFunc)(int,float*)
function to minimize (only used, if iNumOperands=0). May be NULL, if iNumOperands>0.
char *pcOpt
option string
unitptr uHost
host unit

RETURN VALUE:

A pointer to the created unit or NULL in the case of an error.

INTERFACE OF CREATED UNIT:

X_in[1]:
(input field 0) value from function to be minimized
Y_in[iDim]:
(input field 1) initial parameter vector for minimization
Z_in[2]:
(input field 2) error tolerance level and iteration limit
CTL_in[1]:
(control field)
X_out[iDim]:
(output field 0) new parameter vector after minimization step.
Y_out[1]:
(output field 1) nr of iterations taken.

EXECUTION OF CREATED UNIT:

A single execution call of the present unit makes repeated execution calls to its operand units, providing at each execution call of the operand units at its output field X_out a modified parameter vector. This vector should be used by the operand units to compute a new function value. The pin at which this function value appears must be connected to X_in of the present unit for making the next minimization step.

INITIALIZATION:

The vector Y_in is used as the starting parameter set for the minimization.

DESCRIPTION:

Attempts minimization of a scalar function of iDim parameters. This function is assumed to be computed by the operand units of this unit, using the the parameter vector available at X_out of the present unit. The scalar result of the function evaluation must be made available to the present unit via a suitable connection to X_in of the present unit.

OPTIONS:

[not yet implemented]
%R
replace starting parameters at Y_in with result parameters after minimization step.
%fT
set initial error tolerance level to f (default 0.001).
%fI
set limit on allowable nr of interations

CONTROL MODES:

EXAMPLES:

STATUS:

alpha.

SEE ALSO:

FILE

/amnt/loge/users/nistaff02/nistaff/rhaschke/nst7/man/../o.linux//../foldersrc/nst_cjgr.c