From a0bc4b0a5ad9e42bfc59e1368713161420aba03e Mon Sep 17 00:00:00 2001 From: Luca Date: Thu, 20 Feb 2014 12:35:07 -0500 Subject: [PATCH] added 1 more unit test: delta is perpendicular to gradient of original system --- tests/testNonlinearOptimizer.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/testNonlinearOptimizer.cpp b/tests/testNonlinearOptimizer.cpp index 99970c082..49ad4b758 100644 --- a/tests/testNonlinearOptimizer.cpp +++ b/tests/testNonlinearOptimizer.cpp @@ -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);