From 08f5b074a0da77663283f7824b66839df8d919e8 Mon Sep 17 00:00:00 2001 From: Alex Cunningham Date: Fri, 20 Nov 2009 14:29:11 +0000 Subject: [PATCH] Added verbosity selector for the SQP demo to remove printouts every time it runs --- cpp/testSQP.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cpp/testSQP.cpp b/cpp/testSQP.cpp index 8a89b747e..f8c5ded1c 100644 --- a/cpp/testSQP.cpp +++ b/cpp/testSQP.cpp @@ -338,6 +338,7 @@ Matrix grad_g2(const VectorConfig& config, const std::string& key) { * should be the same. */ TEST (SQP, two_pose ) { + bool verbose = false; // position (1, 1) constraint for x1 VectorConfig feas; feas.insert("x1", Vector_(2, 1.0, 1.0)); @@ -404,7 +405,7 @@ TEST (SQP, two_pose ) { fg.push_back(c); } } - fg.print("Linearized graph"); + if (verbose) fg.print("Linearized graph"); // create an ordering Ordering ordering; @@ -412,13 +413,13 @@ TEST (SQP, two_pose ) { // optimize linear graph to get full delta config VectorConfig delta = fg.optimize(ordering).scale(-1.0); - delta.print("Delta Config"); + if (verbose) delta.print("Delta Config"); // update both state variables state = state.exmap(delta); - state.print("newState"); + if (verbose) state.print("newState"); state_lam = state_lam.exmap(delta); - state_lam.print("newStateLam"); + if (verbose) state_lam.print("newStateLam"); } // verify