fix TBB ordering issue

release/4.3a0
Frank Dellaert 2022-02-12 11:19:04 -05:00
parent 8dcde7bc58
commit d57e5d5c45
2 changed files with 8 additions and 0 deletions

View File

@ -393,7 +393,14 @@ namespace gtsam {
ss << " </thead>\n <tbody>\n";
// Print out all rows.
#ifdef GTSAM_USE_TBB
// TBB uses un-ordered map, so inefficiently order them:
std::map<Key,Vector> ordered;
for (const auto& kv : *this) ordered.emplace(kv);
for (const auto& kv : ordered) {
#else
for (const auto& kv : *this) {
#endif
ss << " <tr>";
ss << "<th>" << keyFormatter(kv.first) << "</th><td>"
<< kv.second.transpose() << "</td>";

View File

@ -272,6 +272,7 @@ TEST(VectorValues, html) {
"</table>\n"
"</div>";
string actual = vv.html();
cout << actual << endl;
EXPECT(actual == expected);
}