Added ordering-less negate()

release/4.3a0
Alex Cunningham 2012-08-20 18:28:19 +00:00
parent 0aa72c986e
commit bac1faa68e
2 changed files with 14 additions and 0 deletions

View File

@ -141,6 +141,12 @@ GaussianFactor::shared_ptr LinearContainerFactor::negate(const Ordering& orderin
return result;
}
/* ************************************************************************* */
NonlinearFactor::shared_ptr LinearContainerFactor::negate() const {
GaussianFactor::shared_ptr antifactor = factor_->negate(); // already has keys in place
return NonlinearFactor::shared_ptr(new LinearContainerFactor(antifactor));
}
/* ************************************************************************* */
} // \namespace gtsam

View File

@ -79,6 +79,14 @@ public:
*/
GaussianFactor::shared_ptr negate(const Ordering& ordering) const;
/**
* Creates the equivalent anti-factor as another LinearContainerFactor,
* so it remains independent of ordering.
*/
NonlinearFactor::shared_ptr negate() const;
/**
* Creates a shared_ptr clone of the factor - needs to be specialized to allow
* for subclasses