changed get_delta to const ( using find operator of a map instead of [] )

release/4.3a0
Manohar Paluri 2009-08-28 14:55:33 +00:00
parent 017ad6a66f
commit 1ce50a8258
1 changed files with 6 additions and 1 deletions

View File

@ -51,7 +51,12 @@ public:
ChordalBayesNet convert() const;
/** get delta functions by key */
DeltaFunction::shared_ptr get_delta(const std::string& key) {return delta_nodes[key];}
DeltaFunction::shared_ptr get_delta(const std::string& key) const
{
const_delta_iterator cg = delta_nodes.find(key);
assert( cg != delta_nodes.end() );
return cg->second;
}
/** check equality */
bool equals(const ConstrainedChordalBayesNet& cbn) const;