From eaa8176de156932c3f8b13a7dcb0689bab1b1116 Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Thu, 31 Dec 2009 10:30:44 +0000 Subject: [PATCH] correct behavior when entire columns are zero --- cpp/GaussianBayesNet.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpp/GaussianBayesNet.cpp b/cpp/GaussianBayesNet.cpp index b863f242c..fcdd3691d 100644 --- a/cpp/GaussianBayesNet.cpp +++ b/cpp/GaussianBayesNet.cpp @@ -107,7 +107,8 @@ VectorConfig backSubstituteTranspose(const GaussianBayesNet& bn, VectorConfig gy; BOOST_FOREACH(GaussianConditional::shared_ptr cg, bn) { const string& j = cg->key(); - gy.insert(j,gx[j]); // initialize result + Vector gyj = gx.contains(j) ? gx[j] : zero(cg->dim()); + gy.insert(j,gyj); // initialize result } // we loop from first-eliminated to last-eliminated