/usr/include/sc/math/optimize/mcsearch.h is in libsc-dev 2.3.1-16.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | //
// mcsearch.h
//
// Based on line search routines found in lbfgs.f on the WWW.
//
#ifndef _math_optimize_mcsearch_h
#define _math_optimize_mcsearch_h
#ifdef __GNUC__
#pragma interface
#endif
#include <math/optimize/opt.h>
#include <util/misc/autovec.h>
namespace sc {
/** This performs line searches with cubic steps. It is based on the
Fortran MCSRCH and MCSTEP routines produced by: Argonne National
Laboratory. MINPACK Project. June 1983 Jorge J. More', David
J. Thuente.
*/
class MCSearch: public LineOpt {
protected:
// These are originally from the lb3 common block.
double gtol_, stpmin_, stpmax_;
// Local variables in mcsrch
double dg, fm, fx, fy, dgm, dgx, dgy, fxm, fym, stx, sty, dgxm,
dgym;
int infoc;
double finit, width, stmin, stmax;
bool stage1;
double width1, ftest1;
bool brackt;
double dginit, dgtest;
// Local variables in mcstep
double p, q, r__, s, sgnd, stpc, stpf, stpq, gamma, theta;
bool bound;
// these are saved from call to call
int info_;
auto_vec<double> wa_;
void
mcstep(double *stx, double *fx, double *dx,
double *sty, double *fy, double *dy, double *stp,
double *fp, double *dp, bool *brackt, double *stpmin,
double *stpmax, int *info);
void
mcsrch(int *n, double *x, double *f,
double *g, double *s, double *stp, double *ftol,
double *xtol, int *maxfev, int *info, int *nfev,
double *wa);
void mcinit();
public:
/** The MCSearch KeyVal CTOR does not read any input. See
the LineOpt KeyVal CTOR for parameters that it takes.
*/
MCSearch(const Ref<KeyVal>&);
~MCSearch();
int update();
void init(RefSCVector& direction);
void init(RefSCVector& direction, Ref<Function> function);
};
}
#endif
// Local Variables:
// mode: c++
// c-file-style: "CLJ"
// End:
|