eliminate is now const
parent
a38ebece1e
commit
81a353dd2c
|
@ -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);
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue