Update script for visual check of "SimplexOptimizerTest" debugging output.
Allow displaying negative values of the objective function.
diff --git a/commons-math-legacy/src/test/gnuplot/legacy/optim/nonlinear/scalar/noderiv/simplex_2D.gnuplot b/commons-math-legacy/src/test/gnuplot/legacy/optim/nonlinear/scalar/noderiv/simplex_2D.gnuplot
index ece6416..83056b3 100644
--- a/commons-math-legacy/src/test/gnuplot/legacy/optim/nonlinear/scalar/noderiv/simplex_2D.gnuplot
+++ b/commons-math-legacy/src/test/gnuplot/legacy/optim/nonlinear/scalar/noderiv/simplex_2D.gnuplot
@@ -32,8 +32,9 @@
numOptim = STATS_blocks
evalColIndex = 1
objColIndex = 2
-xColIndex = 3
-yColIndex = 4
+absObjDiffColIndex = 3
+xColIndex = 4
+yColIndex = 5
set size 1, 1
set origin 0, 0
@@ -46,7 +47,10 @@
numEval = STATS_max
# Objective function range.
- stats file index iOptim u objColIndex nooutput
+ # Using the absolute value of the difference with the objective function
+ # at the optimum in order to be able to display the logarithm even if the
+ # objective function can be negative.
+ stats file index iOptim u absObjDiffColIndex nooutput
numSpx = STATS_blank
minObj = STATS_min
maxObj = STATS_max
@@ -89,11 +93,11 @@
plot \
file index iOptim \
every ::0::2 \
- u 0:(log($2)) \
- w l lc "black" title "log_{10}f", \
+ u 0:(log($3)) \
+ w l lc "black" title "log_{10}|f(x) - f(optimum)|", \
'' index iOptim \
every ::0::2:iSpx \
- u 0:(log($2)) \
+ u 0:(log($3)) \
w lp pt 1 lc "black" lw 2 notitle
# Simplex.
@@ -107,10 +111,14 @@
every :::(iSpx - showSpx < 0 ? 0 : iSpx - showSpx)::iSpx \
u xColIndex:yColIndex \
w l notitle, \
- '' index "Optimum" u 1:2 ps 5 pt 4 notitle
+ '' index "Optimum" \
+ u 1:2 ps 2.5 pt 4 title "Expected", \
+ '' index iOptim \
+ every :::lastSpx::lastSpx \
+ u xColIndex:yColIndex ps 1.5 pt 6 title "Found"
unset multiplot
- pause 0.1
+ pause 0.15
}
pause 1