gtsam  4.0.0
gtsam
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 
19 #pragma once
20 
23 
24 namespace gtsam {
25 
30 class EqualityFactorGraph: public FactorGraph<LinearEquality> {
31 public:
32  typedef boost::shared_ptr<EqualityFactorGraph> shared_ptr;
33 
35  double error(const VectorValues& x) const {
36  double total_error = 0.;
37  for (const sharedFactor& factor : *this) {
38  if (factor)
39  total_error += factor->error(x);
40  }
41  return total_error;
42  }
43 };
44 
46 template<> struct traits<EqualityFactorGraph> : public Testable<
47  EqualityFactorGraph> {
48 };
49 
50 } // \ namespace gtsam
51 
A helper that implements the traits interface for GTSAM types.
Definition: Testable.h:150
This class represents a collection of vector-valued variables associated each with a unique integer i...
Definition: VectorValues.h:73
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 factor graph is a bipartite graph with factor nodes connected to variable nodes.
Definition: BayesTree.h:32
boost::shared_ptr< LinearEquality > sharedFactor
Shared pointer to a factor.
Definition: FactorGraph.h:88
double error(const VectorValues &x) const
Compute error of a guess.
Definition: EqualityFactorGraph.h:35
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
LinearEquality derived from Base with constrained noise model.
Factor Graph Base Class.
Collection of all Linear Equality constraints Ax=b of a Programming problem as a Factor Graph.
Definition: EqualityFactorGraph.h:30