g2o
Public Member Functions | List of all members
IncrementalEdgesCompare Struct Reference

Sort Edges for inserting them sequentially. More...

Public Member Functions

bool operator() (SparseOptimizer::Edge *const &e1, SparseOptimizer::Edge *const &e2)
 
bool operator() (SparseOptimizer::Edge *const &e1, SparseOptimizer::Edge *const &e2)
 
bool operator() (SparseOptimizer::Edge *const &e1, SparseOptimizer::Edge *const &e2)
 
bool operator() (const EdgeInformation &e1, const EdgeInformation &e2)
 
bool operator() (SparseOptimizer::Edge *const &e1, SparseOptimizer::Edge *const &e2)
 

Detailed Description

Sort Edges for inserting them sequentially.

Definition at line 67 of file g2o.cpp.

Member Function Documentation

bool IncrementalEdgesCompare::operator() ( const EdgeInformation e1,
const EdgeInformation e2 
)
inline

Definition at line 52 of file g2o_incremental.cpp.

References EdgeInformation::fromId, and EdgeInformation::toId.

53  {
54  int i11 = e1.fromId, i12 = e1.toId;
55  if (i11 > i12)
56  swap(i11, i12);
57  int i21 = e2.fromId, i22 = e2.toId;
58  if (i21 > i22)
59  swap(i21, i22);
60  if (i12 < i22)
61  return true;
62  if (i12 > i22)
63  return false;
64  return i11 < i21;
65  }
bool IncrementalEdgesCompare::operator() ( SparseOptimizer::Edge *const &  e1,
SparseOptimizer::Edge *const &  e2 
)
inline

Definition at line 58 of file g2o-unfold.cpp.

59  {
60  const SparseOptimizer::Vertex* to1 = static_cast<const SparseOptimizer::Vertex*>(e1->vertex(0));
61  const SparseOptimizer::Vertex* to2 = static_cast<const SparseOptimizer::Vertex*>(e2->vertex(0));
62 
63  int i11 = e1->vertex(0)->id(), i12 = e1->vertex(1)->id();
64  if (i11 > i12){
65  swap(i11, i12);
66  }
67  int i21 = e2->vertex(0)->id(), i22 = e2->vertex(1)->id();
68  if (i21 > i22){
69  swap(i21, i22);
70  }
71  if (i12 < i22)
72  return true;
73  if (i12 > i22)
74  return false;
75  if (to1->dimension() != to2->dimension()) { // push the odometry to be the first
76  return to1->dimension() > to2->dimension();
77  }
78  return (i11<i21);
79  }
bool IncrementalEdgesCompare::operator() ( SparseOptimizer::Edge *const &  e1,
SparseOptimizer::Edge *const &  e2 
)
inline

Definition at line 59 of file generate_commands.cpp.

60  {
61  const SparseOptimizer::Vertex* to1 = static_cast<const SparseOptimizer::Vertex*>(e1->vertices()[0]);
62  const SparseOptimizer::Vertex* to2 = static_cast<const SparseOptimizer::Vertex*>(e2->vertices()[0]);
63 
64  int i11 = e1->vertices()[0]->id(), i12 = e1->vertices()[1]->id();
65  if (i11 > i12){
66  swap(i11, i12);
67  }
68  int i21 = e2->vertices()[0]->id(), i22 = e2->vertices()[1]->id();
69  if (i21 > i22){
70  swap(i21, i22);
71  }
72  if (i12 < i22)
73  return true;
74  if (i12 > i22)
75  return false;
76  if (to1->dimension() != to2->dimension()) { // push the odometry to be the first
77  return to1->dimension() > to2->dimension();
78  }
79  return (i11<i21);
80  }
bool IncrementalEdgesCompare::operator() ( SparseOptimizer::Edge *const &  e1,
SparseOptimizer::Edge *const &  e2 
)
inline

Definition at line 65 of file converteSegmentLine.cpp.

66  {
67  const SparseOptimizer::Vertex* to1 = static_cast<const SparseOptimizer::Vertex*>(e1->vertices()[1]);
68  const SparseOptimizer::Vertex* to2 = static_cast<const SparseOptimizer::Vertex*>(e2->vertices()[1]);
69 
70  int i11 = e1->vertices()[0]->id(), i12 = e1->vertices()[1]->id();
71  if (i11 > i12){
72  swap(i11, i12);
73  }
74  int i21 = e2->vertices()[0]->id(), i22 = e2->vertices()[1]->id();
75  if (i21 > i22){
76  swap(i21, i22);
77  }
78  if (i12 < i22)
79  return true;
80  if (i12 > i22)
81  return false;
82  // push the odometry to be the first
83  return to1->dimension() > to2->dimension();
84  }
bool IncrementalEdgesCompare::operator() ( SparseOptimizer::Edge *const &  e1,
SparseOptimizer::Edge *const &  e2 
)
inline

Definition at line 68 of file g2o.cpp.

69  {
70  const SparseOptimizer::Vertex* to1 = static_cast<const SparseOptimizer::Vertex*>(e1->vertices()[1]);
71  const SparseOptimizer::Vertex* to2 = static_cast<const SparseOptimizer::Vertex*>(e2->vertices()[1]);
72 
73  int i11 = e1->vertices()[0]->id(), i12 = e1->vertices()[1]->id();
74  if (i11 > i12){
75  swap(i11, i12);
76  }
77  int i21 = e2->vertices()[0]->id(), i22 = e2->vertices()[1]->id();
78  if (i21 > i22){
79  swap(i21, i22);
80  }
81  if (i12 < i22)
82  return true;
83  if (i12 > i22)
84  return false;
85  // push the odometry to be the first
86  return to1->dimension() > to2->dimension();
87  }

The documentation for this struct was generated from the following files: