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
21#include <gtsam/config.h>
22
23#ifdef GTSAM_ALLOW_DEPRECATED_SINCE_V43
24
27
28namespace gtsam {
29
34class EqualityFactorGraph: public FactorGraph<LinearEquality> {
35public:
36 typedef std::shared_ptr<EqualityFactorGraph> shared_ptr;
37
39 template <class... Args> void add(Args &&... args) {
40 emplace_shared<LinearEquality>(std::forward<Args>(args)...);
41 }
42
44 double error(const VectorValues& x) const {
45 double total_error = 0.;
46 for (const sharedFactor& factor : *this) {
47 if (factor)
48 total_error += factor->error(x);
49 }
50 return total_error;
51 }
52};
53
55template<> struct traits<EqualityFactorGraph> : public Testable<
56 EqualityFactorGraph> {
57};
58
59} // \ namespace gtsam
60
61#endif // GTSAM_ALLOW_DEPRECATED_SINCE_V43
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 Group.h:37
A helper that implements the traits interface for GTSAM types.
Definition Testable.h:152
A factor graph is a bipartite graph with factor nodes connected to variable nodes.
Definition FactorGraph.h:58