Factor.cpp
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 
20 // \callgraph
21 
22 #include <iostream>
23 
24 #include <gtsam/inference/Factor.h>
25 
26 namespace gtsam {
27 
28  /* ************************************************************************* */
29  void Factor::print(const std::string& s, const KeyFormatter& formatter) const
30  {
31  return this->printKeys(s, formatter);
32  }
33 
34  /* ************************************************************************* */
35  void Factor::printKeys(const std::string& s, const KeyFormatter& formatter) const {
36  std::cout << (s.empty() ? "" : s + " ");
37  for (Key key : keys_) std::cout << " " << formatter(key);
38  std::cout << std::endl;
39  }
40 
41  /* ************************************************************************* */
42  bool Factor::equals(const This& other, double tol) const {
43  return keys_ == other.keys_;
44  }
45 
46 }
bool equals(const This &other, double tol=1e-9) const
check equality
Definition: Factor.cpp:42
KeyVector keys_
The keys involved in this factor.
Definition: Factor.h:72
const KeyFormatter & formatter
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition: Key.h:35
RealScalar s
virtual void print(const std::string &s="Factor", const KeyFormatter &formatter=DefaultKeyFormatter) const
print
Definition: Factor.cpp:29
traits
Definition: chartTesting.h:28
virtual void printKeys(const std::string &s="Factor", const KeyFormatter &formatter=DefaultKeyFormatter) const
print only keys
Definition: Factor.cpp:35
const G double tol
Definition: Group.h:83
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:61
The base class for all factors.


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:42:03