Skip to content
Snippets Groups Projects
Commit 0f3c7854 authored by Elias Pipping's avatar Elias Pipping Committed by Elias Pipping
Browse files

Adjust octave code to new minimise() interface

parent 1ee8f2a4
No related branches found
No related tags found
No related merge requests found
...@@ -38,11 +38,9 @@ Make a minimisation step of x -> 1/2<Ax,x> - <b,x> + H(|x|) using DUNE starting ...@@ -38,11 +38,9 @@ Make a minimisation step of x -> 1/2<Ax,x> - <b,x> + H(|x|) using DUNE starting
Functional::SmallVector start; Functional::SmallVector start;
Dune::octaveToDune<dim>(current, start); Dune::octaveToDune<dim>(current, start);
Functional::SmallVector correction; Dune::minimise(J, start);
Dune::minimise(J, start, correction);
ColumnVector ret(dim); Dune::duneToOctave<dim>(start, current);
Dune::duneToOctave<dim>(correction, ret);
return octave_value(ret); return octave_value(current);
} }
...@@ -26,8 +26,8 @@ oldvec = [279; 0]; # Something random that takes a couple of iterations ...@@ -26,8 +26,8 @@ oldvec = [279; 0]; # Something random that takes a couple of iterations
olddiff = [ 0; 0]; olddiff = [ 0; 0];
for i = 1:10 # Something random for i = 1:10 # Something random
newdiff = duneminimise(oldvec); newvec = duneminimise(oldvec);
newvec = oldvec + newdiff; newdiff = newvec - oldvec;
line([oldvec(1) newvec(1)], ... line([oldvec(1) newvec(1)], ...
[oldvec(2) newvec(2)], ... [oldvec(2) newvec(2)], ...
[duneevaluate(oldvec) duneevaluate(newvec)], ... [duneevaluate(oldvec) duneevaluate(newvec)], ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment