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 std::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 
51 template<> struct traits<EqualityFactorGraph> : public Testable<
52  EqualityFactorGraph> {
53 };
54 
55 } // \ namespace gtsam
56 
gtsam::EqualityFactorGraph::shared_ptr
std::shared_ptr< EqualityFactorGraph > shared_ptr
Definition: EqualityFactorGraph.h:32
LinearEquality.h
LinearEquality derived from Base with constrained noise model.
gtsam::EqualityFactorGraph::add
void add(Args &&... args)
Add a linear inequality, forwards arguments to LinearInequality.
Definition: EqualityFactorGraph.h:35
gtsam::EqualityFactorGraph
Definition: EqualityFactorGraph.h:30
x
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Definition: gnuplot_common_settings.hh:12
pruning_fixture::factor
DecisionTreeFactor factor(D &C &B &A, "0.0 0.0 0.0 0.60658897 0.61241912 0.61241969 0.61247685 0.61247742 0.0 " "0.0 0.0 0.99995287 1.0 1.0 1.0 1.0")
gtsam::FactorGraph
Definition: BayesTree.h:34
gtsam::VectorValues
Definition: VectorValues.h:74
gtsam::EqualityFactorGraph::error
double error(const VectorValues &x) const
Compute error of a guess.
Definition: EqualityFactorGraph.h:40
gtsam
traits
Definition: SFMdata.h:40
gtsam::Testable
Definition: Testable.h:152
gtsam::traits
Definition: Group.h:36
FactorGraph.h
Factor Graph Base Class.
args
Definition: pytypes.h:2210
gtsam::FactorGraph< LinearEquality >::sharedFactor
std::shared_ptr< LinearEquality > sharedFactor
Shared pointer to a factor.
Definition: FactorGraph.h:62


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:30