New method "add" as in GaussianFactorGraph
parent
c0fb3a271b
commit
c51264ac98
|
@ -31,6 +31,11 @@ class EqualityFactorGraph: public FactorGraph<LinearEquality> {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<EqualityFactorGraph> shared_ptr;
|
typedef boost::shared_ptr<EqualityFactorGraph> shared_ptr;
|
||||||
|
|
||||||
|
/// Add a linear inequality, forwards arguments to LinearInequality.
|
||||||
|
template <class... Args> void add(Args &&... args) {
|
||||||
|
emplace_shared<LinearEquality>(std::forward<Args>(args)...);
|
||||||
|
}
|
||||||
|
|
||||||
/// Compute error of a guess.
|
/// Compute error of a guess.
|
||||||
double error(const VectorValues& x) const {
|
double error(const VectorValues& x) const {
|
||||||
double total_error = 0.;
|
double total_error = 0.;
|
||||||
|
|
|
@ -47,6 +47,11 @@ public:
|
||||||
return Base::equals(other, tol);
|
return Base::equals(other, tol);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Add a linear inequality, forwards arguments to LinearInequality.
|
||||||
|
template <class... Args> void add(Args &&... args) {
|
||||||
|
emplace_shared<LinearInequality>(std::forward<Args>(args)...);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compute error of a guess.
|
* Compute error of a guess.
|
||||||
* Infinity error if it violates an inequality; zero otherwise. */
|
* Infinity error if it violates an inequality; zero otherwise. */
|
||||||
|
|
Loading…
Reference in New Issue