|
Contents | Previous | Next | Subchapters |
| Syntax |
[betaout, nf] = minline(function f,xref, betain, dir, level, maxdx, maxf) |
| See Also | brent , conjdir , conjgrad |
beta that solves the problem:
minimize f(xref + beta dir) with respect to beta
where beta is a scalar with the same type as xref.
If minline can not decrease the value of f in the
direction dir, betaout is exactly equal to zero.
If present, the return value nf is set to the number of function
evaluations used for the minimization.
f(x)
returns a scalar value with the same type as
xref provided that x has the same type and dimension
as xref.
xref
is a real or double-precision column vector
that specifies the reference point for the line search.
betain
is a nonzero scalar that has the same type as xref
and specifies the initial step size for the line search parameter.
dir
is a vector with the same type and dimension as xref.
It specifies the direction of the line search.
level
is an integer scalar that
specifies the level of tracing inside minline.
| Name | Condition | Description |
nf |
level > 1 | number calls to f |
beta |
level > 1 | step factor |
f(x) |
level > 1 | objective value |
bmin |
level > 1 | final step |
fmin |
level > 1 | final objective |
maxdx
if present, maxdx specifies the maximum absolute change; that is,
| beta dir | < maxdx for all i
i i
and maxdx must have the same type and dimension as xref.
If maxdx is not present,
the vector defined by
maxdx = 100 betain (|dir | + |dir| / 100)
i i
is used.
nf
if present, maxf specifies the maximum number of evaluations
of f to allow. If minline terminates because of this limit,
nf is set to maxf + 1
2 2
(2 + beta * 0 - 1) + (2 + beta * 1 - 1)
with respect to beta.
clear
function f(x) begin
return (x(1) - 1.)^2 + (x(2) - 1.)^2
end
xref = {2., 2.}
betain = 1 / 3.
dir = {0., 1.}
minline(function f, xref, betain, dir)
returns
-1