-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
225 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
function Xsp = formquad_model_improvement(x_k, Cres, Gres, Hres, Mdir, np, Low, Upp, delta, Model, combinemodels) | ||
|
||
n = length(x_k); | ||
|
||
% Update for modelimp; Cres unchanged b/c xk_in unchanged | ||
[G, H] = combinemodels(Cres, Gres, Hres); | ||
|
||
% Evaluate model-improving points to pick best one | ||
% ! May eventually want to normalize Mdir first for infty norm | ||
% Plus directions | ||
[Mdir1, np1] = bmpts(x_k, Mdir(1:n - np, :), Low, Upp, delta, Model.Par(3)); | ||
for i = 1:n - np1 | ||
D = Mdir1(i, :); | ||
Res(i, 1) = D * (G + .5 * H * D'); | ||
end | ||
[a1, b] = min(Res(1:n - np1, 1)); | ||
Xsp = Mdir1(b, :); | ||
% Minus directions | ||
[Mdir1, np2] = bmpts(x_k, -Mdir(1:n - np, :), Low, Upp, delta, Model.Par(3)); | ||
for i = 1:n - np2 | ||
D = Mdir1(i, :); | ||
Res(i, 1) = D * (G + .5 * H * D'); | ||
end | ||
[a2, b] = min(Res(1:n - np2, 1)); | ||
if a2 < a1 | ||
Xsp = Mdir1(b, :); | ||
end | ||
|
||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
function [Mdir, np, valid, Gres, Hres, Mind] = gaussnewton(X, F, delta, xk_in, np_max, Pars, vf, aux) | ||
|
||
Gres = aux{xk_in}'; | ||
[n, m] = size(Gres); | ||
Hres = zeros(n, n, m); | ||
|
||
% silly things to make everything compatible in pounders | ||
valid = true; | ||
np = n; | ||
|
||
Mdir = []; % because valid is always true, pounders should never try to read this. | ||
Mind = []; % ditto above | ||
|
||
end |
Oops, something went wrong.