Added dogleg mode switch in SolverComparer
parent
5c86ad7e49
commit
2fd9401558
|
@ -95,6 +95,7 @@ int lastStep;
|
||||||
int nThreads;
|
int nThreads;
|
||||||
int relinSkip;
|
int relinSkip;
|
||||||
bool incremental;
|
bool incremental;
|
||||||
|
bool dogleg;
|
||||||
bool batch;
|
bool batch;
|
||||||
bool compare;
|
bool compare;
|
||||||
bool perturb;
|
bool perturb;
|
||||||
|
@ -126,6 +127,7 @@ int main(int argc, char *argv[]) {
|
||||||
("threads", po::value<int>(&nThreads)->default_value(-1), "Number of threads, or -1 to use all processors")
|
("threads", po::value<int>(&nThreads)->default_value(-1), "Number of threads, or -1 to use all processors")
|
||||||
("relinSkip", po::value<int>(&relinSkip)->default_value(10), "Fluid relinearization check every arg steps")
|
("relinSkip", po::value<int>(&relinSkip)->default_value(10), "Fluid relinearization check every arg steps")
|
||||||
("incremental", "Run in incremental mode using ISAM2 (default)")
|
("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")
|
("batch", "Run in batch mode, requires an initialization from --read-solution")
|
||||||
("compare", po::value<vector<string> >()->multitoken(), "Compare two solution files")
|
("compare", po::value<vector<string> >()->multitoken(), "Compare two solution files")
|
||||||
("perturb", po::value<double>(&perturbationNoise), "Perturb a solution file with the specified noise")
|
("perturb", po::value<double>(&perturbationNoise), "Perturb a solution file with the specified noise")
|
||||||
|
@ -141,6 +143,7 @@ int main(int argc, char *argv[]) {
|
||||||
stats = (vm.count("stats") > 0);
|
stats = (vm.count("stats") > 0);
|
||||||
const int modesSpecified = int(batch) + int(compare) + int(perturb) + int(stats);
|
const int modesSpecified = int(batch) + int(compare) + int(perturb) + int(stats);
|
||||||
incremental = (vm.count("incremental") > 0 || modesSpecified == 0);
|
incremental = (vm.count("incremental") > 0 || modesSpecified == 0);
|
||||||
|
dogleg = (vm.count("dogleg") > 0);
|
||||||
if(compare) {
|
if(compare) {
|
||||||
const vector<string>& compareFiles = vm["compare"].as<vector<string> >();
|
const vector<string>& compareFiles = vm["compare"].as<vector<string> >();
|
||||||
if(compareFiles.size() != 2) {
|
if(compareFiles.size() != 2) {
|
||||||
|
@ -233,6 +236,8 @@ int main(int argc, char *argv[]) {
|
||||||
void runIncremental()
|
void runIncremental()
|
||||||
{
|
{
|
||||||
ISAM2Params params;
|
ISAM2Params params;
|
||||||
|
if(dogleg)
|
||||||
|
params.optimizationParams = ISAM2DoglegParams();
|
||||||
params.relinearizeSkip = relinSkip;
|
params.relinearizeSkip = relinSkip;
|
||||||
params.enablePartialRelinearizationCheck = true;
|
params.enablePartialRelinearizationCheck = true;
|
||||||
ISAM2 isam2(params);
|
ISAM2 isam2(params);
|
||||||
|
|
Loading…
Reference in New Issue