diff --git a/src/test_circle_1.m b/src/test_circle_1.m new file mode 100644 index 0000000000000000000000000000000000000000..a3fa0504da231f7b834a606cf34331b4c8a4f612 --- /dev/null +++ b/src/test_circle_1.m @@ -0,0 +1,26 @@ +if exist('graphics_toolkit','file') + graphics_toolkit('fltk') +end + +A = [4 1.5; 1.5 3]; +b = [1; 2]; +f = @(x) x + (x > 1) .* (x - 1); +phi = @(x) f(norm(x,2)); +J = @(x) .5*dot(A*x,x) - dot(b,x) + phi(x); + +scale = 1.0; + +t = -5:0.1:5; +x = scale*cos(t); +y = scale*sin(t); +z = arrayfun(@(vec1, vec2) J([vec1; vec2]), x, y); + +hold on +plot3(x,y,z); + +title 'scale = 1' + +# Minimum taken from test-circle.cc with scale=1 + +plot3(-1.487905e-01, +9.888687e-01, J([-1.487905e-01; +9.888687e-01]), 'r+'); +hold off