Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hybrid Incremental Inference #1267

Merged
merged 4 commits into from
Aug 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions gtsam/hybrid/HybridFactor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,15 @@ void HybridFactor::print(const std::string &s,
if (c < continuousKeys_.size() - 1) {
std::cout << " ";
} else {
std::cout << (discreteKeys_.size() > 0 ? ";" : "");
std::cout << (discreteKeys_.size() > 0 ? "; " : "");
}
}
for (auto &&discreteKey : discreteKeys_) {
std::cout << " " << formatter(discreteKey.first);
for (size_t d = 0; d < discreteKeys_.size(); d++) {
std::cout << formatter(discreteKeys_.at(d).first);
if (d < discreteKeys_.size() - 1) {
std::cout << " ";
}

}
std::cout << "]";
}
Expand Down
4 changes: 2 additions & 2 deletions gtsam/hybrid/tests/testGaussianMixtureFactor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ TEST(GaussianMixtureFactor, Sum) {
// Check that number of keys is 3
EXPECT_LONGS_EQUAL(3, mixtureFactorA.keys().size());

// Check that number of discrete keys is 1 // TODO(Frank): should not exist?
// Check that number of discrete keys is 1
EXPECT_LONGS_EQUAL(1, mixtureFactorA.discreteKeys().size());

// Create sum of two mixture factors: it will be a decision tree now on both
Expand Down Expand Up @@ -104,7 +104,7 @@ TEST(GaussianMixtureFactor, Printing) {
GaussianMixtureFactor mixtureFactor({X(1), X(2)}, {m1}, factors);

std::string expected =
R"(Hybrid x1 x2; 1 ]{
R"(Hybrid [x1 x2; 1]{
Choice(1)
0 Leaf :
A[x1] = [
Expand Down
Loading