added 1 more unit test: delta is perpendicular to gradient of original system

release/4.3a0
Luca 2014-02-20 12:35:07 -05:00
parent dec6430d9b
commit a0bc4b0a5a
1 changed files with 6 additions and 1 deletions

View File

@ -323,9 +323,14 @@ TEST(NonlinearOptimizer, MoreOptimization) {
double factor = actualGradient[0][0]/delta[0][0];
EXPECT(assert_equal(actualGradient,factor*delta));
// Still pointing downhill !
// Still pointing downhill wrt actual gradient !
EXPECT_DOUBLES_EQUAL( 0.0105584,dot(-1*actualGradient,delta),1e-5);
// delta.print("This is the delta value computed by LM with diagonal damping");
// Still pointing downhill wrt expected gradient (IT DOES NOT! actually they are perpendicular)
EXPECT_DOUBLES_EQUAL( 0.0,dot(-1*expectedGradient,delta),1e-5);
// Check errors at convergence and errors in direction of solution (does not decrease!)
EXPECT_DOUBLES_EQUAL(46.0254859,fg.error(actual.retract(delta)),1e-5);