gtsam 4.2
gtsam
Loading...
Searching...
No Matches
EqualityFactorGraph.h
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2
3 * GTSAM Copyright 2010, Georgia Tech Research Corporation,
4 * Atlanta, Georgia 30332-0415
5 * All Rights Reserved
6 * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7
8 * See LICENSE for the license information
9
10 * -------------------------------------------------------------------------- */
11
18
19#pragma once
20
23
24namespace gtsam {
25
30class EqualityFactorGraph: public FactorGraph<LinearEquality> {
31public:
32 typedef boost::shared_ptr<EqualityFactorGraph> shared_ptr;
33
35 template <class... Args> void add(Args &&... args) {
36 emplace_shared<LinearEquality>(std::forward<Args>(args)...);
37 }
38
40 double error(const VectorValues& x) const {
41 double total_error = 0.;
42 for (const sharedFactor& factor : *this) {
43 if (factor)
44 total_error += factor->error(x);
45 }
46 return total_error;
47 }
48};
49
51template<> struct traits<EqualityFactorGraph> : public Testable<
52 EqualityFactorGraph> {
53};
54
55} // \ namespace gtsam
56
Factor Graph Base Class.
LinearEquality derived from Base with constrained noise model.
Global functions in a separate testing namespace.
Definition chartTesting.h:28
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition concepts.h:30
A helper that implements the traits interface for GTSAM types.
Definition Testable.h:151
FactorGraph()
Definition FactorGraph.h:142
IsDerived< DERIVEDFACTOR > emplace_shared(Args &&... args)
Definition FactorGraph.h:192
boost::shared_ptr< LinearEquality > sharedFactor
Definition FactorGraph.h:101
VectorValues represents a collection of vector-valued variables associated each with a unique integer...
Definition VectorValues.h:74
Collection of all Linear Equality constraints Ax=b of a Programming problem as a Factor Graph.
Definition EqualityFactorGraph.h:30
double error(const VectorValues &x) const
Compute error of a guess.
Definition EqualityFactorGraph.h:40
void add(Args &&... args)
Add a linear inequality, forwards arguments to LinearInequality.
Definition EqualityFactorGraph.h:35