MPQC 3.0.0-alpha
Loading...
Searching...
No Matches
mcsearch.h
1//
2// mcsearch.h
3//
4// Based on line search routines found in lbfgs.f on the WWW.
5//
6
7#ifndef _math_optimize_mcsearch_h
8#define _math_optimize_mcsearch_h
9
10#include <math/optimize/opt.h>
11#include <util/misc/autovec.h>
12
13namespace sc {
14
20class MCSearch: public LineOpt {
21 protected:
22
23 // These are originally from the lb3 common block.
24 double gtol_, stpmin_, stpmax_;
25
26 // Local variables in mcsrch
27 double dg, fm, fx, fy, dgm, dgx, dgy, fxm, fym, stx, sty, dgxm,
28 dgym;
29 int infoc;
30 double finit, width, stmin, stmax;
31 bool stage1;
32 double width1, ftest1;
33 bool brackt;
34 double dginit, dgtest;
35
36 // Local variables in mcstep
37 double p, q, r__, s, sgnd, stpc, stpf, stpq, gamma, theta;
38 bool bound;
39
40 // these are saved from call to call
41 int info_;
43
44 void
45 mcstep(double *stx, double *fx, double *dx,
46 double *sty, double *fy, double *dy, double *stp,
47 double *fp, double *dp, bool *brackt, double *stpmin,
48 double *stpmax, int *info);
49
50 void
51 mcsrch(int *n, double *x, double *f,
52 double *g, double *s, double *stp, double *ftol,
53 double *xtol, int *maxfev, int *info, int *nfev,
54 double *wa);
55
56
57 void mcinit();
58 public:
59
64 MCSearch();
65 ~MCSearch();
66 int update();
67
68 void init(RefSCVector& direction);
70
71 void print(std::ostream& = ExEnv::out0()) const;
72};
73
74}
75
76#endif
77
78// Local Variables:
79// mode: c++
80// c-file-style: "CLJ"
81// End:
static std::ostream & out0()
Return an ostream that writes from node 0.
The LineOpt abstract class is used to perform one dimensional optimizations.
Definition opt.h:125
This performs line searches with cubic steps.
Definition mcsearch.h:20
void print(std::ostream &=ExEnv::out0()) const
Print the object.
int update()
Take a step.
void init(RefSCVector &direction)
Initializes the line search object.
MCSearch(const Ref< KeyVal > &)
The MCSearch KeyVal CTOR does not read any input.
void init(RefSCVector &direction, Ref< Function > function)
Initializes the line search object.
Ref< Function > function() const
Returns information about the Function being optimized.
Definition opt.h:113
The RefSCVector class is a smart pointer to an SCVector specialization.
Definition matrix.h:55
A template class that maintains references counts.
Definition ref.h:361
The auto_vec class functions much like auto_ptr, except it contains references to arrays.
Definition autovec.h:59
Contains all MPQC code up to version 3.
Definition mpqcin.h:14

Generated at Wed Sep 25 2024 02:45:30 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.12.0.