SDDSlib
|
Implementation of the RCDS (Robust Conjugate Direction Search) algorithm. More...
#include "mdb.h"
#include <time.h>
Go to the source code of this file.
Macros | |
#define | DEFAULT_MAXEVALS 100 |
#define | DEFAULT_MAXPASSES 5 |
#define | DEBUG 0 |
#define | RCDS_ABORT 0x0001UL |
Functions | |
long | rcdsMinAbort (long abort) |
Sets or queries the abort flag for the RCDS minimization. | |
void | sort_two_arrays (double *x, double *y, long n) |
void | normalize_variables (double *x0, double *relative_x, double *lowerLimit, double *upperLimit, long dimensions) |
void | scale_variables (double *x0, double *relative_x, double *lowerLimit, double *upperLimit, long dimensions) |
long | bracketmin (double(*func)(double *x, long *invalid), double *x0, double f0, double *dv, double *lowerLimit, double *upperLimit, long dimensions, double noise, double step, double *a10, double *a20, double **stepList, double **flist, long *nflist, double *xm, double *fm, double *xmin, double *fmin) |
long | linescan (double(*func)(double *x, long *invalid), double *x0, double f0, double *dv, double *lowerLimit, double *upperLimit, long dimensions, double alo, double ahi, long Np, double *step_list, double *f_list, long n_list, double *xm, double *fm, double *xmin, double *fmin) |
long | outlier_1d (double *x, long n, double mul_tol, double perlim, long *removed_index) |
long | rcdsMin (double *yReturn, double *xBest, double *xGuess, double *dxGuess, double *xLowerLimit, double *xUpperLimit, double **dmat0, long dimensions, double target, double tolerance, double(*func)(double *x, long *invalid), void(*report)(double ymin, double *xmin, long pass, long evals, long dims), long maxEvaluations, long maxPasses, double noise, double rcdsStep, unsigned long flags) |
Performs minimization using the RCDS (Robust Conjugate Direction Search) algorithm. | |
Variables | |
static unsigned long | rcdsFlags = 0 |
static long | DIMENSIONS |
Implementation of the RCDS (Robust Conjugate Direction Search) algorithm.
This code is translated from XiaoBiao Huang's MATLAB code for the RCDS algorithm. The RCDS algorithm is used for automated tuning via minimization.
Reference: X. Huang, et al. Nucl. Instr. Methods, A, 726 (2013) 77-83.
Definition in file rcds_powell.c.
#define DEBUG 0 |
Definition at line 17 of file rcds_powell.c.
#define DEFAULT_MAXEVALS 100 |
Definition at line 14 of file rcds_powell.c.
#define DEFAULT_MAXPASSES 5 |
Definition at line 15 of file rcds_powell.c.
#define RCDS_ABORT 0x0001UL |
Definition at line 19 of file rcds_powell.c.
long bracketmin | ( | double(* | func )(double *x, long *invalid), |
double * | x0, | ||
double | f0, | ||
double * | dv, | ||
double * | lowerLimit, | ||
double * | upperLimit, | ||
long | dimensions, | ||
double | noise, | ||
double | step, | ||
double * | a10, | ||
double * | a20, | ||
double ** | stepList, | ||
double ** | flist, | ||
long * | nflist, | ||
double * | xm, | ||
double * | fm, | ||
double * | xmin, | ||
double * | fmin ) |
Definition at line 387 of file rcds_powell.c.
long linescan | ( | double(* | func )(double *x, long *invalid), |
double * | x0, | ||
double | f0, | ||
double * | dv, | ||
double * | lowerLimit, | ||
double * | upperLimit, | ||
long | dimensions, | ||
double | alo, | ||
double | ahi, | ||
long | Np, | ||
double * | step_list, | ||
double * | f_list, | ||
long | n_list, | ||
double * | xm, | ||
double * | fm, | ||
double * | xmin, | ||
double * | fmin ) |
Definition at line 677 of file rcds_powell.c.
void normalize_variables | ( | double * | x0, |
double * | relative_x, | ||
double * | lowerLimit, | ||
double * | upperLimit, | ||
long | dimensions ) |
Definition at line 647 of file rcds_powell.c.
long outlier_1d | ( | double * | x, |
long | n, | ||
double | mul_tol, | ||
double | perlim, | ||
long * | removed_index ) |
Definition at line 908 of file rcds_powell.c.
long rcdsMin | ( | double * | yReturn, |
double * | xBest, | ||
double * | xGuess, | ||
double * | dxGuess, | ||
double * | xLowerLimit, | ||
double * | xUpperLimit, | ||
double ** | dmat0, | ||
long | dimensions, | ||
double | target, | ||
double | tolerance, | ||
double(* | func )(double *x, long *invalid), | ||
void(* | report )(double ymin, double *xmin, long pass, long evals, long dims), | ||
long | maxEvaluations, | ||
long | maxPasses, | ||
double | noise, | ||
double | rcdsStep, | ||
unsigned long | flags ) |
Performs minimization using the RCDS (Robust Conjugate Direction Search) algorithm.
This function minimizes the given objective function using the RCDS algorithm, which is based on Powell's method with line scans.
yReturn | Pointer to store the best function value found. |
xBest | Pointer to an array to store the best solution found. |
xGuess | Initial guess for the solution (array of size 'dimensions'). |
dxGuess | Initial step sizes for each variable (array of size 'dimensions'). |
xLowerLimit | Lower bounds for the variables (array of size 'dimensions'). Can be NULL. |
xUpperLimit | Upper bounds for the variables (array of size 'dimensions'). Can be NULL. |
dmat0 | Initial direction set (array of pointers to arrays of size 'dimensions x dimensions'). If NULL, unit vectors are used. |
dimensions | Number of variables (dimensions of the problem). |
target | Target function value to reach. The minimization will stop if this value is reached. |
tolerance | Tolerance for termination condition. If negative, interpreted as fractional tolerance; if positive, interpreted as absolute tolerance. |
func | Objective function to minimize. Should take an array of variables and a pointer to an invalid flag, and return the function value. |
report | Optional reporting function to call after each iteration. Can be NULL. |
maxEvaluations | Maximum number of function evaluations allowed. |
maxPasses | Maximum number of iterations (passes) allowed. |
noise | Estimated noise level in the function value. |
rcdsStep | Initial step size for the line searches. |
flags | Control flags for the algorithm behavior. |
Definition at line 113 of file rcds_powell.c.
long rcdsMinAbort | ( | long | abort | ) |
Sets or queries the abort flag for the RCDS minimization.
abort | If non-zero, sets the abort flag. If zero, queries the abort flag status. |
Definition at line 28 of file rcds_powell.c.
void scale_variables | ( | double * | x0, |
double * | relative_x, | ||
double * | lowerLimit, | ||
double * | upperLimit, | ||
long | dimensions ) |
Definition at line 636 of file rcds_powell.c.
void sort_two_arrays | ( | double * | x, |
double * | y, | ||
long | n ) |
Definition at line 867 of file rcds_powell.c.
|
static |
Definition at line 80 of file rcds_powell.c.
|
static |
Definition at line 20 of file rcds_powell.c.