EstimateDiameter.hpp
Go to the documentation of this file.
1 // ========================================================================================
2 // ApproxMVBB
3 // Copyright (C) 2014 by Gabriel Nützi <nuetzig (at) imes (d0t) mavt (d0t) ethz (døt) ch>
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 // ========================================================================================
9 #ifndef ApproxMVBB_Diameter_EstimateDiameter_hpp
10 #define ApproxMVBB_Diameter_EstimateDiameter_hpp
11 
14 
15 #include <random>
16 
17 namespace ApproxMVBB{
18 
24  public:
25 
26  DiameterEstimator(std::size_t seed = RandomGenerators::defaultSeed) : m_gen(seed) {}
27 
39  double const**theList,
40  const int first,
41  const int last,
42  const int dim,
43  double epsilon);
44 
45  private:
46 
47  double estimateDiameterInOneList(Diameter::TypeSegment *theDiam,
48  double const**theList,
49  const int first,
50  const int last,
51  const int dim,
52  double _epsilon_ );
53 
54 
57  int _verbose_when_reducing_ = 0;
58  inline void _VerboseWhenReducing(){ _verbose_when_reducing_ = 1; }
59  inline void _NoVerboseWhenReducing(){ _verbose_when_reducing_ = 0;}
60  inline int _GetVerboseWhenReducing(){ return _verbose_when_reducing_ ;}
61 
62 
64  int _reduction_mode_in_iterative_ = 1;
65  inline void _SetReductionModeInIterative( int m )
66  {
67  switch ( m ) {
68  case 0 :
69  case 1 :
70  _reduction_mode_in_iterative_ = m;
71  break;
72  case 2 :
73  default :
74  break;
75  }
76  }
77  inline int _GetReductionModeInIterative(){return _reduction_mode_in_iterative_ ;}
78 
80  int _reduction_mode_of_diameter_ = 1;
81  inline void _SetReductionModeOfDiameter( int m )
82  {
83  switch ( m ) {
84  case 0 :
85  case 1 :
86  case 2 :
87  _reduction_mode_of_diameter_ = m;
88  break;
89  default :
90  break;
91  }
92  }
93  int _GetReductionModeOfDiameter(){return _reduction_mode_of_diameter_; }
94 
95  /* 'reduction' of double normals
96  */
97  int _reduction_mode_of_dbleNorm_ = 1;
98  inline void _SetReductionModeOfDbleNorm( int m )
99  {
100  switch ( m ) {
101  case 0 :
102  case 1 :
103  case 2 :
104  _reduction_mode_of_dbleNorm_ = m;
105  break;
106  default :
107  break;
108  }
109  }
110  inline int _GetReductionModeOfDbleNorm(){return _reduction_mode_of_dbleNorm_ ;}
111 
112  /* reduction by processing couple of double normals
113  */
114  int _try_to_reduce_Q_ = 1;
115 
116  inline void _DoTryToReduceQ() { _try_to_reduce_Q_ = 1;}
117  inline void _DoNotTryToReduceQ(){ _try_to_reduce_Q_ = 0;}
118  inline int _GetTryToReduceQ(){return _try_to_reduce_Q_ ; }
119 
120 
121  int _Q_scan_ = 0;
122  inline void _SetQscanToForward(){ _Q_scan_ = 1;}
123  inline void _SetQscanToBackward(){ _Q_scan_ = 0;}
124  inline int _GetQscan(){return _Q_scan_ ;}
125 
126 
127  int _tight_bounds_ = 0;
128  inline void _DoTryToGetTightBounds(){ _tight_bounds_ = 1;}
129  inline void _DoNotTryToGetTightBounds(){ _tight_bounds_ = 0;}
130  inline int _GetTightBounds(){ return _tight_bounds_ ; }
134 
136  int getRandomInt( unsigned int min, unsigned int max ){
137  if ( min <= max ){
138  return static_cast<int>(RandomGenerators::DefaultUniformUIntDistribution<unsigned int>{min,max}(m_gen));
139  }else{
140  return static_cast<int>(RandomGenerators::DefaultUniformUIntDistribution<unsigned int>{max,min}(m_gen));
141  }
142  }
143 
144 };
145 }
146 
147 #endif
These are some container definitions.
int getRandomInt(unsigned int min, unsigned int max)
#define APPROXMVBB_EXPORT
Definition: Platform.hpp:60
static const uint64_t defaultSeed
RandomGenerators::DefaultRandomGen m_gen
Random number generator.
std::uniform_int_distribution< T > DefaultUniformUIntDistribution
auto estimateDiameter(const MatrixBase< Derived > &points, const PREC epsilon, std::size_t seed=RandomGenerators::defaultSeed) -> std::pair< VectorStat< Dimension >, VectorStat< Dimension > >
DiameterEstimator(std::size_t seed=RandomGenerators::defaultSeed)


asr_approx_mvbb
Author(s): Gassner Nikolai
autogenerated on Mon Jun 10 2019 12:38:08