util.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 
10 #ifndef ApproxMVBB_Diameter_Utils_util_hpp
11 #define ApproxMVBB_Diameter_Utils_util_hpp
12 
13 
14 #include <cmath>
15 
17 #include ApproxMVBB_TypeDefs_INCLUDE_FILE
18 
19 
22 
23 namespace ApproxMVBB{
24 namespace Diameter{
25 
27  double constsquareDiameter,
28  double const**theList,
29  const int first,
30  int *last,
31  const int dim,
32  const int _reduction_mode_ );
33 
35  double constsquareDiameter,
36  double const**theList,
37  const int first,
38  int *last,
39  const int dim,
40  const int _reduction_mode_,
41  double *bound );
42 
43  APPROXMVBB_EXPORT int _FarthestPointFromSphere( TypeSegment *theSeg,
44  double const**theList,
45  const int first,
46  int *last,
47  const int dim,
48  const int _reduction_mode_ );
49 
50 
51 
52 
53  APPROXMVBB_EXPORT void _CountPointsInSpheres( TypeSegment *theSeg,
54  double constsquareDiameter,
55  double const**theList,
56  const int first,
57  const int last,
58  const int dim );
59 
60 
61 
62 
63  APPROXMVBB_EXPORT double _MaximalSegmentInTwoLists( TypeSegment *theSeg,
64  const int index1,
65  double const**theList1,
66  int *first1,
67  int *last1,
68  double const**theList2,
69  int *first2,
70  int *last2,
71  int dim );
72 
73  APPROXMVBB_EXPORT double _MaximalSegmentInOneList( TypeSegment *theSeg,
74  const int index,
75  double const**theList,
76  int *first,
77  int *last,
78  const int dim );
79 
81  double const*ref,
82  double const**theList,
83  const int first,
84  const int last,
85  const int dim );
86 
87 
88 
89 
90 
91 
92 
93  APPROXMVBB_EXPORT double _QuadraticDiameterInOneList( TypeSegment *theDiam,
94  double const**theList,
95  const int first,
96  const int last,
97  const int dim );
98 
99  APPROXMVBB_EXPORT double _QuadraticDiameterInTwoLists( TypeSegment *theDiam,
100  int *index1,
101  int *index2,
102  double const**theList1,
103  const int first1,
104  const int last1,
105  double const**theList2,
106  const int first2,
107  const int last2,
108  const int dim );
109 
110 
111  APPROXMVBB_EXPORT void _SwapPoints( double const**theList, const int i, const int j );
112 
113  struct TypeCounter{
114  int c1;
115  int c2;
116  } ;
117 
119  APPROXMVBB_EXPORT void _AddToCounter( TypeCounter *c, const int i );
120  APPROXMVBB_EXPORT double _GetCounterAverage( TypeCounter *c, const int i );
121 
122  #ifdef _STATS_
123  APPROXMVBB_EXPORT void _InitScalarProductCounter();
124  APPROXMVBB_EXPORT double _GetScalarProductAverage( int n );
125  #endif
126 
127  /* square distances
128  */
129  APPROXMVBB_EXPORT double _SquareDistance( double const*a, double const*b, const int dim );
130  APPROXMVBB_EXPORT double _SquareDistance3D( double const*a, double const*b );
131  APPROXMVBB_EXPORT double _SquareDistance2D( double const*a, double const*b );
132 
133  /* dot products
134  ab.cd = ( (b[i]-a[i]) . (d[i]-c[i]) )
135  */
136  APPROXMVBB_EXPORT double _ScalarProduct( double const*a, double const*b, double const*c, double const*d, const int dim );
137  APPROXMVBB_EXPORT double _ScalarProduct3D( double const*a, double const*b, double const*c, double const*d );
138  APPROXMVBB_EXPORT double _ScalarProduct2D( double const*a, double const*b, double const*c, double const*d );
139 
140 
141  APPROXMVBB_EXPORT int _FindPointInList( double const**theList,
142  const int first,
143  const int last,
144  double x0,
145  double x1 );
146 
147 
148 }
149 }
150 
151 #endif
152 
153 
APPROXMVBB_EXPORT int _FarthestPointFromSphere(TypeSegment *theSeg, double const **theList, const int first, int *last, const int dim, const int _reduction_mode_)
Definition: util.cpp:867
These are some container definitions.
APPROXMVBB_EXPORT double _MaximalSegmentInOneList(TypeSegment *theSeg, const int index, double const **theList, int *first, int *last, const int dim)
Definition: util.cpp:1115
APPROXMVBB_EXPORT double _SquareDistance3D(double const *a, double const *b)
Definition: util.cpp:1324
APPROXMVBB_EXPORT void _SwapPoints(double const **theList, const int i, const int j)
Definition: util.cpp:1249
#define APPROXMVBB_EXPORT
Definition: Platform.hpp:60
APPROXMVBB_EXPORT void _CountPointsInSpheres(TypeSegment *theSeg, double constsquareDiameter, double const **theList, const int first, const int last, const int dim)
APPROXMVBB_EXPORT int _FindPointInList(double const **theList, const int first, const int last, double x0, double x1)
Definition: util.cpp:1400
APPROXMVBB_EXPORT double _QuadraticDiameterInTwoLists(TypeSegment *theDiam, int *index1, int *index2, double const **theList1, const int first1, const int last1, double const **theList2, const int first2, const int last2, const int dim)
Definition: util.cpp:1511
APPROXMVBB_EXPORT double _QuadraticDiameterInOneList(TypeSegment *theDiam, double const **theList, const int first, const int last, const int dim)
Definition: util.cpp:1442
APPROXMVBB_EXPORT double _MaximalSegmentInTwoLists(TypeSegment *theSeg, const int index1, double const **theList1, int *first1, int *last1, double const **theList2, int *first2, int *last2, int dim)
Definition: util.cpp:1001
APPROXMVBB_EXPORT int _LastPointOutsideSphereWithDiameter(TypeSegment *theSeg, double constsquareDiameter, double const **theList, const int first, int *last, const int dim, const int _reduction_mode_)
Definition: util.cpp:44
APPROXMVBB_EXPORT double _ScalarProduct(double const *a, double const *b, double const *c, double const *d, const int dim)
Definition: util.cpp:1354
APPROXMVBB_EXPORT double _GetCounterAverage(TypeCounter *c, const int i)
Definition: util.cpp:1275
APPROXMVBB_EXPORT void _InitCounter(TypeCounter *c)
Definition: util.cpp:1259
APPROXMVBB_EXPORT double _SquareDistance2D(double const *a, double const *b)
Definition: util.cpp:1337
APPROXMVBB_EXPORT double _ScalarProduct2D(double const *a, double const *b, double const *c, double const *d)
Definition: util.cpp:1388
APPROXMVBB_EXPORT double _MaximalDistanceFromPoint(int *index, double const *ref, double const **theList, const int first, const int last, const int dim)
Definition: util.cpp:1178
APPROXMVBB_EXPORT void _AddToCounter(TypeCounter *c, const int i)
Definition: util.cpp:1263
APPROXMVBB_EXPORT int _LastPointOutsideSphereAndBoundWithDiameter(TypeSegment *theSeg, double constsquareDiameter, double const **theList, const int first, int *last, const int dim, const int _reduction_mode_, double *bound)
Definition: util.cpp:386
APPROXMVBB_EXPORT double _SquareDistance(double const *a, double const *b, const int dim)
Definition: util.cpp:1303
APPROXMVBB_EXPORT double _ScalarProduct3D(double const *a, double const *b, double const *c, double const *d)
Definition: util.cpp:1375


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