From 71bec0bd6f0e9a39f86b528e794333d17c2601b8 Mon Sep 17 00:00:00 2001 From: Davis King Date: Sat, 24 Jul 2010 22:04:07 +0000 Subject: [PATCH] Added an example of using be_verbose() to see the optimization progress. --HG-- extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403780 --- examples/optimization_ex.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/optimization_ex.cpp b/examples/optimization_ex.cpp index 3db0bbf99..1e8fbe924 100755 --- a/examples/optimization_ex.cpp +++ b/examples/optimization_ex.cpp @@ -174,12 +174,13 @@ int main() // The L-BFGS algorithm however uses only O(N) memory. So if you have a // function of a huge number of variables the L-BFGS algorithm is probably // a better choice. - starting_point = 4, 8; + starting_point = 0.8, 1.3; find_min(lbfgs_search_strategy(10), // The 10 here is basically a measure of how much memory L-BFGS will use. - objective_delta_stop_strategy(1e-7), + objective_delta_stop_strategy(1e-7).be_verbose(), // Adding be_verbose() causes a message to be + // printed for each iteration of optimization. &rosen, &rosen_derivative, starting_point, -1); - cout << starting_point << endl; + cout << endl << starting_point << endl; starting_point = -94, 5.2; find_min_using_approximate_derivatives(lbfgs_search_strategy(10),