gtsam
Loading...
Searching...
No Matches
InequalityFactorGraph.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
29
30namespace gtsam {
31
36class InequalityFactorGraph: public FactorGraph<LinearInequality> {
37private:
38 typedef FactorGraph<LinearInequality> Base;
39
40public:
41 typedef std::shared_ptr<InequalityFactorGraph> shared_ptr;
42
44 void print(
45 const std::string& str = "",
46 const KeyFormatter& keyFormatter = DefaultKeyFormatter) const override {
47 Base::print(str, keyFormatter);
48 }
49
51 bool equals(const InequalityFactorGraph& other, double tol = 1e-9) const {
52 return Base::equals(other, tol);
53 }
54
56 template <class... Args> void add(Args &&... args) {
57 emplace_shared<LinearInequality>(std::forward<Args>(args)...);
58 }
59
63 double error(const VectorValues& x) const {
64 for (const sharedFactor& factor : *this) {
65 if (factor)
66 if (factor->error(x) > 1e-7)
67 return std::numeric_limits<double>::infinity();
68 }
69 return 0.0;
70 }
71};
72
74template<>
75struct traits<InequalityFactorGraph> : public Testable<InequalityFactorGraph> {
76};
77
78} // \ namespace gtsam
79
80#endif // GTSAM_ALLOW_DEPRECATED_SINCE_V43
Factor Graph Base Class.
Factor Graph Base Class.
Factor Graph Values.
LinearInequality derived from Base with constrained noise model.
Global functions in a separate testing namespace.
Definition chartTesting.h:28
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition Matrix.cpp:143
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