From 5c86ad7e49eae4333deef017509869f39e3a326b Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Sat, 22 Feb 2014 17:13:13 -0500 Subject: [PATCH 1/2] Fixed examples not being built due to branch "adding-scripts-simplify" --- CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c6f5852b9..d03f11ede 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -295,9 +295,7 @@ add_subdirectory(gtsam) add_subdirectory(tests) # Build examples -if (GTSAM_BUILD_EXAMPLES) - add_subdirectory(examples) -endif(GTSAM_BUILD_EXAMPLES) +add_subdirectory(examples) # Matlab toolbox if (GTSAM_INSTALL_MATLAB_TOOLBOX) From 2fd94015581ffacd46580976bf63c9b05b2a700f Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Sat, 22 Feb 2014 17:13:32 -0500 Subject: [PATCH 2/2] Added dogleg mode switch in SolverComparer --- examples/SolverComparer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/SolverComparer.cpp b/examples/SolverComparer.cpp index ec980b960..2f0c71a40 100644 --- a/examples/SolverComparer.cpp +++ b/examples/SolverComparer.cpp @@ -95,6 +95,7 @@ int lastStep; int nThreads; int relinSkip; bool incremental; +bool dogleg; bool batch; bool compare; bool perturb; @@ -126,6 +127,7 @@ int main(int argc, char *argv[]) { ("threads", po::value(&nThreads)->default_value(-1), "Number of threads, or -1 to use all processors") ("relinSkip", po::value(&relinSkip)->default_value(10), "Fluid relinearization check every arg steps") ("incremental", "Run in incremental mode using ISAM2 (default)") + ("dogleg", "When in incremental mode, solve with Dogleg instead of Gauss-Newton in iSAM2") ("batch", "Run in batch mode, requires an initialization from --read-solution") ("compare", po::value >()->multitoken(), "Compare two solution files") ("perturb", po::value(&perturbationNoise), "Perturb a solution file with the specified noise") @@ -141,6 +143,7 @@ int main(int argc, char *argv[]) { stats = (vm.count("stats") > 0); const int modesSpecified = int(batch) + int(compare) + int(perturb) + int(stats); incremental = (vm.count("incremental") > 0 || modesSpecified == 0); + dogleg = (vm.count("dogleg") > 0); if(compare) { const vector& compareFiles = vm["compare"].as >(); if(compareFiles.size() != 2) { @@ -233,6 +236,8 @@ int main(int argc, char *argv[]) { void runIncremental() { ISAM2Params params; + if(dogleg) + params.optimizationParams = ISAM2DoglegParams(); params.relinearizeSkip = relinSkip; params.enablePartialRelinearizationCheck = true; ISAM2 isam2(params);