diff --git a/tests/timeMultifrontalOnDataset.cpp b/tests/timeMultifrontalOnDataset.cpp index a2c446409..b5f553d71 100644 --- a/tests/timeMultifrontalOnDataset.cpp +++ b/tests/timeMultifrontalOnDataset.cpp @@ -34,9 +34,17 @@ int main(int argc, char *argv[]) { else datasetname = "intel"; + // check if there should be a constraint if (argc == 3 && string(argv[2]).compare("-c") == 0) soft_prior = false; + // find the number of trials - default is 10 + size_t nrTrials = 10; + if (argc == 3 && string(argv[2]).compare("-c") != 0) + nrTrials = strtoul(argv[2], NULL, 10); + else if (argc == 4) + nrTrials = strtoul(argv[3], NULL, 10); + pair, shared_ptr > data = load2D(dataset(datasetname)); // Add a prior on the first pose @@ -55,7 +63,6 @@ int main(int argc, char *argv[]) { toc_(2, "linearize"); tictoc_print_(); - const size_t nrTrials = 10; for(size_t trial = 0; trial < nrTrials; ++trial) { tic_(3, "solve"); diff --git a/tests/timeSequentialOnDataset.cpp b/tests/timeSequentialOnDataset.cpp index 8a5ca74ad..66f405cdb 100644 --- a/tests/timeSequentialOnDataset.cpp +++ b/tests/timeSequentialOnDataset.cpp @@ -34,9 +34,17 @@ int main(int argc, char *argv[]) { else datasetname = "intel"; + // check if there should be a constraint if (argc == 3 && string(argv[2]).compare("-c") == 0) soft_prior = false; + // find the number of trials - default is 10 + size_t nrTrials = 10; + if (argc == 3 && string(argv[2]).compare("-c") != 0) + nrTrials = strtoul(argv[2], NULL, 10); + else if (argc == 4) + nrTrials = strtoul(argv[3], NULL, 10); + pair, shared_ptr > data = load2D(dataset(datasetname)); // Add a prior on the first pose @@ -55,7 +63,7 @@ int main(int argc, char *argv[]) { toc_(2, "linearize"); tictoc_print_(); - for(size_t trial = 0; trial < 10; ++trial) { + for(size_t trial = 0; trial < nrTrials; ++trial) { tic_(3, "solve"); tic(1, "construct solver");