MathHelper.hpp
Go to the documentation of this file.
1 
18 #pragma once
19 
20 #include <Eigen/Geometry>
21 #include <cmath>
22 #include "common_type/Pose.hpp"
25 #include "common_type/Point.hpp"
26 
27 namespace ISM {
28  class MathHelper {
29  public:
30 
31  static bool getNextCombination(const std::vector<unsigned int>::iterator first, std::vector<unsigned int>::iterator k, const std::vector<unsigned int>::iterator last)
32  {
33  if ((first == last) || (first == k) || (last == k))
34  return false;
35 
36  std::vector<unsigned int>::iterator it1 = first;
37  std::vector<unsigned int>::iterator it2 = last;
38  it1++;
39  if (last == it1)
40  return false;
41  it1 = last;
42  it1--;
43  it1 = k;
44  it2--;
45  while (first != it1)
46  {
47  if (*--it1 < *it2)
48  {
49  std::vector<unsigned int>::iterator j = k;
50  while (!(*it1 < *j)) ++j;
51  std::iter_swap(it1,j);
52  it1++;
53  j++;
54  it2 = k;
55  std::rotate(it1,j,last);
56  while (last != j)
57  {
58  j++;
59  it2++;
60  }
61  std::rotate(k,it2,last);
62  return true;
63  }
64  }
65  std::rotate(first,k,last);
66  return false;
67  }
68 
69  };
70 
71 }
static bool getNextCombination(const std::vector< unsigned int >::iterator first, std::vector< unsigned int >::iterator k, const std::vector< unsigned int >::iterator last)
Definition: MathHelper.hpp:31
this namespace contains all generally usable classes.


asr_lib_ism
Author(s): Hanselmann Fabian, Heller Florian, Heizmann Heinrich, Kübler Marcel, Mehlhaus Jonas, Meißner Pascal, Qattan Mohamad, Reckling Reno, Stroh Daniel
autogenerated on Wed Jan 8 2020 04:02:40