From 017ad6a66f9494f27bc5bb467d28704b823f0461 Mon Sep 17 00:00:00 2001 From: Manohar Paluri Date: Fri, 28 Aug 2009 14:35:02 +0000 Subject: [PATCH] error checking for find operation on map --- cpp/ChordalBayesNet.cpp | 1 + cpp/ConditionalGaussian.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cpp/ChordalBayesNet.cpp b/cpp/ChordalBayesNet.cpp index 3b0053d52..47e6b8e57 100644 --- a/cpp/ChordalBayesNet.cpp +++ b/cpp/ChordalBayesNet.cpp @@ -53,6 +53,7 @@ boost::shared_ptr ChordalBayesNet::optimize(const boost::shared_ptrsecond->solve(*result); // Solve it result->insert(key,x); // store result in partial solution } diff --git a/cpp/ConditionalGaussian.h b/cpp/ConditionalGaussian.h index 84d5e5560..977f4710d 100644 --- a/cpp/ConditionalGaussian.h +++ b/cpp/ConditionalGaussian.h @@ -112,7 +112,7 @@ namespace gtsam { /** * adds a parent */ - void add(std::string key, Matrix S){ parents_.insert(make_pair(key, S)); } + void add(const std::string key, Matrix S){ parents_.insert(make_pair(key, S)); } /** equals function */ bool equals(const ConditionalGaussian &cg) const;