Commit 0ec7feb2 authored by Davis King's avatar Davis King

Made the rosen test a little more reasonable.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403930
parent c573d88e
...@@ -63,16 +63,16 @@ namespace ...@@ -63,16 +63,16 @@ namespace
matrix<T,2,1> p = 100*matrix_cast<T>(randm(2,1,rnd)) - 50; matrix<T,2,1> p = 100*matrix_cast<T>(randm(2,1,rnd)) - 50;
T obj = find_min_trust_region(objective_delta_stop_strategy(0, 100), rosen_function_model<T>(), p); T obj = find_min_trust_region(objective_delta_stop_strategy(1e-12, 100), rosen_function_model<T>(), p);
DLIB_TEST_MSG(obj == 0, "obj: " << obj); DLIB_TEST_MSG(std::abs(obj) < 1e-10, "obj: " << obj);
DLIB_TEST_MSG(length(p-ans) == 0, "length(p): " << length(p-ans)); DLIB_TEST_MSG(length(p-ans) < 1e-10, "length(p): " << length(p-ans));
matrix<T,0,1> p2 = 100*matrix_cast<T>(randm(2,1,rnd)) - 50; matrix<T,0,1> p2 = 100*matrix_cast<T>(randm(2,1,rnd)) - 50;
obj = find_max_trust_region(objective_delta_stop_strategy(0, 100), neg_rosen_model<T>(), p2); obj = find_max_trust_region(objective_delta_stop_strategy(1e-12, 100), neg_rosen_model<T>(), p2);
DLIB_TEST_MSG(obj == 0, "obj: " << obj); DLIB_TEST_MSG(std::abs(obj) < 1e-10, "obj: " << obj);
DLIB_TEST_MSG(length(p2-ans) == 0, "length(p2): " << length(p2-ans)); DLIB_TEST_MSG(length(p-ans) < 1e-10, "length(p): " << length(p-ans));
} }
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment