From 72dfdfaaa5ac578b9a75eda2b2e3e899ae82e16f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9d=C3=A9ric=20Fourmy?= <mfourmy@laas.fr> Date: Wed, 26 Feb 2020 14:56:20 +0100 Subject: [PATCH] Problem::print more adapted to numerous stateblock --- src/problem/problem.cpp | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/problem/problem.cpp b/src/problem/problem.cpp index 973221d7f..53b222ba1 100644 --- a/src/problem/problem.cpp +++ b/src/problem/problem.cpp @@ -960,18 +960,28 @@ void Problem::print(int depth, bool constr_by, bool metric, bool state_blocks) c { cout << (F->isFixed() ? " Fix" : " Est") << ", ts=" << std::setprecision(5) << F->getTimeStamp().get(); - cout << ",\t x = ( " << std::setprecision(2) << F->getState().transpose() << " )"; - cout << endl; - } - if (state_blocks) - { - cout << " sb:"; - for (const auto& sb : F->getStateBlockVec()) - { - cout << " " << (sb->isFixed() ? "Fix" : "Est"); + cout << ",\t x = ( " << std::setprecision(2) << endl; + for (auto sb_name: F->getStructure()){ + auto sb = F->getStateBlock(sb_name); + cout << " " << sb_name; + if (state_blocks){ + cout << "," << (sb->isFixed() ? "Fix" : "Est"); + } + cout << ": " << sb->getState().transpose() << "\n"; } - cout << endl; + cout << " )" << endl; + // cout << ",\t x = ( " << std::setprecision(2) << F->getState().transpose() << " )"; + // cout << endl; } + // if (state_blocks) + // { + // cout << " sb:"; + // for (const auto& sb : F->getStateBlockVec()) + // { + // cout << " " << (sb->isFixed() ? "Fix" : "Est"); + // } + // cout << endl; + // } if (depth >= 2) { // Captures ======================================================================================= -- GitLab