diff --git a/gtsam/linear/VectorValues.cpp b/gtsam/linear/VectorValues.cpp index bf1579eac..371a5b26d 100644 --- a/gtsam/linear/VectorValues.cpp +++ b/gtsam/linear/VectorValues.cpp @@ -393,7 +393,14 @@ namespace gtsam { ss << " \n \n"; // Print out all rows. +#ifdef GTSAM_USE_TBB + // TBB uses un-ordered map, so inefficiently order them: + std::map ordered; + for (const auto& kv : *this) ordered.emplace(kv); + for (const auto& kv : ordered) { +#else for (const auto& kv : *this) { +#endif ss << " "; ss << "" << keyFormatter(kv.first) << "" << kv.second.transpose() << ""; diff --git a/gtsam/linear/tests/testVectorValues.cpp b/gtsam/linear/tests/testVectorValues.cpp index 521cc2289..81b15b3e2 100644 --- a/gtsam/linear/tests/testVectorValues.cpp +++ b/gtsam/linear/tests/testVectorValues.cpp @@ -272,6 +272,7 @@ TEST(VectorValues, html) { "\n" ""; string actual = vv.html(); + cout << actual << endl; EXPECT(actual == expected); }