Go to the source code of this file.
|
| template<class T , class P > |
| bool | Rminfc (T(*f)(P), P a, P b, double eps, double delta, P &x, P &y) |
| |
| template<class C , class T , class P > |
| bool | RminfcM (const C &part, T(C::*f)(P) const, P a, P b, double eps, double delta, P &x, P &y) |
| |
◆ Rminfc()
template<class T , class P >
| bool Rminfc |
( |
T(*)(P) |
f, |
|
|
P |
a, |
|
|
P |
b, |
|
|
double |
eps, |
|
|
double |
delta, |
|
|
P & |
x, |
|
|
P & |
y |
|
) |
| |
Rminfc. Function which finds a single, local minimum of a function with one variable in a given interval. The "golden section search" is applied. The method uses a fixed number $n$ of function evaluations, where $n = [2.08\cdot\ln(|a-b|/\epsilon)+1/2] + 1$.
- Parameters
-
| f | one-dimensional function |
| a,b | end-points of search interval |
| eps | accuracy parameter $\epsilon$ |
| delta | tolerance interval $\delta$ near $a$ and $b$. Suggested value: $\delta = 10\epsilon$ |
| x | computed approximation to the abscissa of a minimum of the function $f$ |
| y | value of $f(x)$ |
49 static P v,
w, fv, fw;
50 bool lge =
true, llt =
true;
67 v = c + h * 0.3819660112501051;
71 w = c + h * 0.6180339887498949;
92 return (
fabs(x -
a) > delta) && (
fabs(x - b) > delta);
int round(const T &x)
Definition: Functions.hh:83
void d()
Definition: RecDispEX.C:381
Expr< UnaryOp< Fabs< T >, Expr< A, T, D >, T >, T, D > fabs(const Expr< A, T, D > &rhs)
Definition: UnaryOperators.hh:96
void a()
Definition: check_aligned.C:59
void w(int rid=2, int nviews=2)
Definition: test.C:27
◆ RminfcM()
template<class C , class T , class P >
| bool RminfcM |
( |
const C & |
part, |
|
|
T(C::*)(P) const |
f, |
|
|
P |
a, |
|
|
P |
b, |
|
|
double |
eps, |
|
|
double |
delta, |
|
|
P & |
x, |
|
|
P & |
y |
|
) |
| |
RminfcM. Rminfc version for const class member functions.
Function which finds a single, local minimum of a function with one variable in a given interval. The "golden section search" is applied. The method uses a fixed number $n$ of function evaluations, where $n = [2.08\cdot\ln(|a-b|/\epsilon)+1/2] + 1$.
- Parameters
-
| f | one-dimensional function |
| a,b | end-points of search interval |
| eps | accuracy parameter $\epsilon$ |
| delta | tolerance interval $\delta$ near $a$ and $b$. Suggested value: $\delta = 10\epsilon$ |
| x | computed approximation to the abscissa of a minimum of the function $f$ |
| y | value of $f(x)$ |
117 static P v,
w, fv, fw;
118 bool lge =
true, llt =
true;
135 v = c + h * 0.3819660112501051;
139 w = c + h * 0.6180339887498949;
160 return (
fabs(x -
a) > delta) && (
fabs(x - b) > delta);
FILE * f
Definition: RecDispMC.C:150