added flags for dataset timing tests to change the number of trials

release/4.3a0
Alex Cunningham 2011-06-13 17:14:24 +00:00
parent fa4faa274a
commit 322f61c537
2 changed files with 17 additions and 2 deletions

View File

@ -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<Pose2Graph>, shared_ptr<Pose2Values> > 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");

View File

@ -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<Pose2Graph>, shared_ptr<Pose2Values> > 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");