Constraint.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 #pragma once
19 
20 #include <gtsam_unstable/dllexport.h>
22 #include <boost/assign.hpp>
23 
24 namespace gtsam {
25 
26  class Domain;
27 
32  class Constraint : public DiscreteFactor {
33 
34  public:
35 
36  typedef boost::shared_ptr<Constraint> shared_ptr;
37 
38  protected:
39 
41  Constraint(const KeyVector& js) :
42  DiscreteFactor(js) {
43  }
44 
47  DiscreteFactor(boost::assign::cref_list_of<1>(j)) {
48  }
49 
51  Constraint(Key j1, Key j2) :
52  DiscreteFactor(boost::assign::cref_list_of<2>(j1)(j2)) {
53  }
54 
56  template<class KeyIterator>
57  Constraint(KeyIterator beginKey, KeyIterator endKey) :
58  DiscreteFactor(beginKey, endKey) {
59  }
60 
61  public:
62 
65 
67  Constraint();
68 
70  ~Constraint() override {}
71 
75 
76  /*
77  * Ensure Arc-consistency
78  * @param j domain to be checked
79  * @param domains all other domains
80  */
81  virtual bool ensureArcConsistency(size_t j, std::vector<Domain>& domains) const = 0;
82 
84  virtual shared_ptr partiallyApply(const Values&) const = 0;
85 
86 
88  virtual shared_ptr partiallyApply(const std::vector<Domain>&) const = 0;
90  };
91 // DiscreteFactor
92 
93 }// namespace gtsam
~Constraint() override
Virtual destructor.
Definition: Constraint.h:70
Constraint(Key j)
Construct unary factor.
Definition: Constraint.h:46
Constraint()
Default constructor for I/O.
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Definition: Key.h:86
traits
Definition: chartTesting.h:28
Constraint(const KeyVector &js)
Construct n-way factor.
Definition: Constraint.h:41
Constraint(KeyIterator beginKey, KeyIterator endKey)
construct from container
Definition: Constraint.h:57
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:61
std::ptrdiff_t j
boost::shared_ptr< Constraint > shared_ptr
Definition: Constraint.h:36
virtual shared_ptr partiallyApply(const Values &) const =0
Partially apply known values.
Constraint(Key j1, Key j2)
Construct binary factor.
Definition: Constraint.h:51
virtual bool ensureArcConsistency(size_t j, std::vector< Domain > &domains) const =0


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:41:51