VariableSlots.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 
19 
20 #include <iostream>
21 
22 using namespace std;
23 
24 namespace gtsam {
25 
26 const size_t VariableSlots::Empty = numeric_limits<size_t>::max();
27 
29 void VariableSlots::print(const std::string& str) const {
30  if(this->empty())
31  cout << "empty" << endl;
32  else {
33  cout << str << "\n";
34  cout << "Var:\t";
35  for(const value_type& slot: *this) { cout << slot.first << "\t"; }
36  cout << "\n";
37 
38  for(size_t i=0; i<this->begin()->second.size(); ++i) {
39  cout << " \t";
40  for(const value_type& slot: *this) {
41  if(slot.second[i] == Empty)
42  cout << "x" << "\t";
43  else
44  cout << slot.second[i] << "\t";
45  }
46  cout << "\n";
47  }
48  }
49 }
50 
52 bool VariableSlots::equals(const VariableSlots& rhs, double tol) const {
53  return *this == rhs;
54 }
55 
56 }
void print(const Matrix &A, const string &s, ostream &stream)
Definition: Matrix.cpp:155
#define max(a, b)
Definition: datatypes.h:20
Definition: Half.h:150
VariableSlots describes the structure of a combined factor in terms of where each block comes from in...
Definition: pytypes.h:928
traits
Definition: chartTesting.h:28
const G double tol
Definition: Group.h:83


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