File tree 1 file changed +24
-0
lines changed
1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,30 @@ TEST(GncOptimizer, gncConstructor) {
98
98
CHECK (gnc.equals (gnc2));
99
99
}
100
100
101
+ /* ************************************************************************* */
102
+ TEST (GncOptimizer, solverParameterParsing) {
103
+ // has to have Gaussian noise models !
104
+ auto fg = example::createReallyNonlinearFactorGraph (); // just a unary factor
105
+ // on a 2D point
106
+
107
+ Point2 p0 (3 , 3 );
108
+ Values initial;
109
+ initial.insert (X (1 ), p0);
110
+
111
+ LevenbergMarquardtParams lmParams;
112
+ lmParams.setMaxIterations (0 ); // forces not to perform optimization
113
+ GncParams<LevenbergMarquardtParams> gncParams (lmParams);
114
+ auto gnc = GncOptimizer<GncParams<LevenbergMarquardtParams>>(fg, initial,
115
+ gncParams);
116
+ Values result = gnc.optimize ();
117
+
118
+ // check that LM did not perform optimization and result is the same as the initial guess
119
+ DOUBLES_EQUAL (fg.error (initial), fg.error (result), tol);
120
+
121
+ // also check the params:
122
+ DOUBLES_EQUAL (0.0 , gncParams.baseOptimizerParams .maxIterations , tol);
123
+ }
124
+
101
125
/* ************************************************************************* */
102
126
TEST (GncOptimizer, gncConstructorWithRobustGraphAsInput) {
103
127
auto fg = example::sharedNonRobustFactorGraphWithOutliers ();
You can’t perform that action at this time.
0 commit comments