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  /* ************************************************************************* */
47  double Factor::error(const HybridValues& c) const {
48  throw std::runtime_error("Factor::error is not implemented");
49  }
50 
51 
52 }
const gtsam::Symbol key('X', 0)
virtual void print(const std::string &s="Factor", const KeyFormatter &formatter=DefaultKeyFormatter) const
print
Definition: Factor.cpp:29
Scalar Scalar * c
Definition: benchVecAdd.cpp:17
KeyVector keys_
The keys involved in this factor.
Definition: Factor.h:87
virtual void printKeys(const std::string &s="Factor", const KeyFormatter &formatter=DefaultKeyFormatter) const
print only keys
Definition: Factor.cpp:35
const KeyFormatter & formatter
virtual double error(const HybridValues &c) const
Definition: Factor.cpp:47
RealScalar s
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
traits
Definition: chartTesting.h:28
const G double tol
Definition: Group.h:86
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:102
The base class for all factors.
bool equals(const This &other, double tol=1e-9) const
check equality
Definition: Factor.cpp:42


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:34:13