eliminate is now const

release/4.3a0
Frank Dellaert 2009-11-12 04:53:28 +00:00
parent a38ebece1e
commit 81a353dd2c
2 changed files with 4 additions and 3 deletions

View File

@ -287,13 +287,13 @@ void LinearFactor::append_factor(LinearFactor::shared_ptr f, const size_t m,
*/
/* ************************************************************************* */
pair<ConditionalGaussian::shared_ptr, LinearFactor::shared_ptr>
LinearFactor::eliminate(const string& key)
LinearFactor::eliminate(const string& key) const
{
bool verbose = false;
if (verbose) cout << "LinearFactor::eliminate(" << key << ")" << endl;
// if this factor does not involve key, we exit with empty CG and LF
iterator it = As_.find(key);
const_iterator it = As_.find(key);
if (it==As_.end()) {
// Conditional Gaussian is just a parent-less node with P(x)=1
LinearFactor::shared_ptr lf(new LinearFactor);

View File

@ -232,7 +232,8 @@ public:
* @param key the key of the node to be eliminated
* @return a new factor and a conditional gaussian on the eliminated variable
*/
std::pair<boost::shared_ptr<ConditionalGaussian>, shared_ptr> eliminate(const std::string& key);
std::pair<boost::shared_ptr<ConditionalGaussian>, shared_ptr>
eliminate(const std::string& key) const;
/**
* Take the factor f, and append to current matrices. Not very general.