From 761d41d55e64508af223587a5f4543e26b795067 Mon Sep 17 00:00:00 2001
From: Elias Pipping <elias.pipping@fu-berlin.de>
Date: Tue, 31 Jul 2012 14:55:12 +0200
Subject: [PATCH] A test with one minimum

---
 src/test_circle_1.m | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 src/test_circle_1.m

diff --git a/src/test_circle_1.m b/src/test_circle_1.m
new file mode 100644
index 00000000..a3fa0504
--- /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
-- 
GitLab