Skip to content

Commit

Permalink
use faster key storage
Browse files Browse the repository at this point in the history
  • Loading branch information
varunagrawal committed Jan 2, 2025
1 parent 6c516cc commit f42ed21
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gtsam/discrete/TableFactor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static Eigen::SparseVector<double> ComputeSparseTable(
});
sparseTable.reserve(nrValues);

std::set<Key> allKeys(dt.keys().begin(), dt.keys().end());
KeySet allKeys(dt.keys().begin(), dt.keys().end());

/**
* @brief Functor which is called by the DecisionTree for each leaf.
Expand All @@ -102,13 +102,13 @@ static Eigen::SparseVector<double> ComputeSparseTable(
auto op = [&](const Assignment<Key>& assignment, double p) {
if (p > 0) {
// Get all the keys involved in this assignment
std::set<Key> assignmentKeys;
KeySet assignmentKeys;
for (auto&& [k, _] : assignment) {
assignmentKeys.insert(k);
}

// Find the keys missing in the assignment
std::vector<Key> diff;
KeyVector diff;
std::set_difference(allKeys.begin(), allKeys.end(),
assignmentKeys.begin(), assignmentKeys.end(),
std::back_inserter(diff));
Expand Down

0 comments on commit f42ed21

Please sign in to comment.