L2Norm.h
Go to the documentation of this file.
1 #ifndef GfxTL__L2NORM_HEADER__
2 #define GfxTL__L2NORM_HEADER__
3 #include <GfxTL/MathHelper.h>
6 
7 namespace GfxTL
8 {
10  {
11  public:
13 
14  void MaskElementSize(unsigned int s)
15  {
16  m_maskElemSize = s;
17  }
18 
19  const unsigned int MaskElementSize() const
20  {
21  return m_maskElemSize;
22  }
23 
24  protected:
25  unsigned int m_maskElemSize;
26  };
27 
28  template< unsigned int SizeT >
30  {
31  public:
32  const unsigned int MaskElementSize() const
33  {
34  return m_maskElemSize;
35  }
36 
37  void MaskElementSize(unsigned int s)
38  {
39  assert(s == SizeT);
40  }
41 
42  protected:
43  enum { m_maskElemSize = SizeT };
44  };
45 
46  template< class VectorKernelT, class MaskElemSizeT = FixedMaskElementSize< 1 > >
48  : public VectorKernelT
49  , public MaskElemSizeT
50  {
51  typedef VectorKernelT VectorKernelType;
52  typedef MaskElemSizeT MaskElementSizeType;
53 
54  template< class ScalarAT, class ScalarBT >
55  struct DistanceType
56  {
57  typedef typename ScalarTypeConversion< ScalarAT,
58  ScalarBT >::DifferenceType Type;
59  };
60 
61  template< class PointAT, class PointBT >
62  typename DistanceType
63  <
66  >::Type
67  Distance(const PointAT& p, const PointBT& v) const
68  {
69  typedef typename DistanceType
70  <
73  >::Type DistType;
74  DistType d = p[0] - v[0], di;
75  d *= d;
76  for (unsigned int i = 1; i < VectorKernelT::m_dim; ++i)
77  {
78  di = p[i] - v[i];
79  d += di * di;
80  }
81  return std::sqrt(d);
82  }
83 
84  template< class PointAT, class PointBT >
85  typename DistanceType
86  <
89  >::Type
90  SqrDistance(const PointAT& p, const PointBT& v) const
91  {
92  typedef typename DistanceType
93  <
96  >::Type DistType;
97  DistType d = p[0] - v[0], di;
98  d *= d;
99  for (unsigned int i = 1; i < VectorKernelT::m_dim; ++i)
100  {
101  di = p[i] - v[i];
102  d += di * di;
103  }
104  return d;
105  }
106 
107  template< class PointAT, class PointBT >
108  typename DistanceType
109  <
112  >::Type
113  SqrDistance(const PointAT& p, const PointBT& v,
114  typename DistanceType
115  <
118  >::Type abortDist) const
119  {
120  typedef typename DistanceType
121  <
124  >::Type DistType;
125  DistType d = p[0] - v[0], di;
126  d *= d;
127  for (unsigned int i = 1; i < VectorKernelT::m_dim && d < abortDist; ++i)
128  {
129  di = p[i] - v[i];
130  d += di * di;
131  }
132  return d;
133  }
134 
135  template< class PointAT, class PointBT, class MaskAT, class MaskBT >
136  typename DistanceType
137  <
140  >::Type
141  SqrDistance(const PointAT& p, const MaskAT& ma, const PointBT& v,
142  const MaskBT& mb) const
143  {
144  typedef typename DistanceType
145  <
148  >::Type DistType;
149  DistType d = 0, dj;
150  for (unsigned int i = 0; i < VectorKernelT::m_dim / MaskElemSizeT::m_maskElemSize; ++i)
151  {
152  if (!(ma[i] && mb[i]))
153  {
154  continue;
155  }
156  for (unsigned int j = 0; j < MaskElemSizeT::m_maskElemSize; ++j)
157  {
158  dj = p[i * MaskElemSizeT::m_maskElemSize + j] - v[i * MaskElemSizeT::m_maskElemSize + j];
159  d += dj * dj;
160  }
161  }
162  return d;
163  }
164 
165  template< class PointAT, class PointBT, class MaskAT, class MaskBT >
166  typename DistanceType
167  <
170  >::Type
171  SqrDistance(const PointAT& p, const MaskAT& ma, const PointBT& v,
172  const MaskBT& mb,
173  typename DistanceType
174  <
177  >::Type abortDist) const
178  {
179  typedef typename DistanceType
180  <
183  >::Type DistType;
184  DistType d = 0, dj;
185  for (unsigned int i = 0; i < VectorKernelT::m_dim / MaskElemSizeT::m_maskElemSize && d < abortDist; ++i)
186  {
187  if (!(ma[i] && mb[i]))
188  {
189  continue;
190  }
191  for (unsigned int j = 0; j < MaskElemSizeT::m_maskElemSize && d < abortDist; ++j)
192  {
193  dj = p[i * MaskElemSizeT::m_maskElemSize + j] - v[i * MaskElemSizeT::m_maskElemSize + j];
194  d += dj * dj;
195  }
196  }
197  return d;
198  }
199 
200  template< class PointAT, class PointBT, class MaskBT >
201  typename DistanceType
202  <
205  >::Type
206  SqrDistance(const PointAT& p, const PointBT& v,
207  const MaskBT& mb) const
208  {
209  typedef typename DistanceType
210  <
213  >::Type DistType;
214  DistType d = 0, dj;
215  for (unsigned int i = 0; i < VectorKernelT::m_dim / MaskElemSizeT::m_maskElemSize; ++i)
216  {
217  if (!mb[i])
218  {
219  continue;
220  }
221  for (unsigned int j = 0; j < MaskElemSizeT::m_maskElemSize; ++j)
222  {
223  dj = p[i * MaskElemSizeT::m_maskElemSize + j] - v[i * MaskElemSizeT::m_maskElemSize + j];
224  d += dj * dj;
225  }
226  }
227  return d;
228  }
229 
230  template< class PointAT, class PointBT, class MaskBT >
231  typename DistanceType
232  <
235  >::Type
236  SqrDistance(const PointAT& p, const PointBT& v,
237  const MaskBT& mb,
238  typename DistanceType
239  <
242  >::Type abortDist) const
243  {
244  typedef typename DistanceType
245  <
248  >::Type DistType;
249  DistType d = 0, dj;
250  for (unsigned int i = 0; i < VectorKernelT::m_dim / MaskElemSizeT::m_maskElemSize && d < abortDist; ++i)
251  {
252  if (!mb[i])
253  {
254  continue;
255  }
256  for (unsigned int j = 0; j < MaskElemSizeT::m_maskElemSize && d < abortDist; ++j)
257  {
258  dj = p[i * MaskElemSizeT::m_maskElemSize + j] - v[i * MaskElemSizeT::m_maskElemSize + j];
259  d += dj * dj;
260  }
261  }
262  return d;
263  }
264 
265  template< class PointAT, class PointBT, class MaskAT, class MaskBT >
266  typename DistanceType
267  <
270  >::Type
271  Distance(const PointAT& p, const PointBT& v, const MaskAT& ma,
272  const MaskBT& mb) const
273  {
274  return std::sqrt(SqrDistance(p, v, ma, mb));
275  }
276 
277  template< class ScalarT >
278  ScalarT RootOfDistance(ScalarT sqrDistance) const
279  {
280  return std::sqrt(sqrDistance);
281  }
282 
283  template< class DistScalarT, class DiffScalarT >
284  DistScalarT IncrementalBoxSqrDistance(DistScalarT boxSqrDist, DiffScalarT boxDiff,
285  DiffScalarT cutDiff) const
286  {
287  return boxSqrDist - ((DistScalarT)boxDiff * (DistScalarT)boxDiff)
288  + ((DistScalarT)cutDiff * (DistScalarT)cutDiff);
289  }
290 
291  template< class PointAT, class PointBT >
292  typename DistanceType
293  <
296  >::Type
297  BoxSqrDistance(const PointAT& a, const PointBT& min,
298  const PointBT& max) const
299  {
300  typename DistanceType
301  <
304  >::Type sqrDist = 0, t;
305  for (unsigned int i = 0; i < VectorKernelT::m_dim; ++i)
306  {
307  if (a[i] < min[i])
308  {
309  t = min[i] - a[i];
310  sqrDist += t * t;
311  }
312  else if (a[i] > max[i])
313  {
314  t = a[i] - max[i];
315  sqrDist += t * t;
316  }
317  }
318  return sqrDist;
319  }
320 
321  template< class PointAT, class PointBT >
322  typename DistanceType
323  <
326  >::Type
327  MaxBoxSqrDistance(const PointAT& a, const PointBT& min,
328  const PointBT& max) const
329  {
330  typedef typename DistanceType
331  <
334  >::Type DistType;
335  DistType sqrDist = 0, t;
336  for (unsigned int i = 0; i < VectorKernelT::m_dim; ++i)
337  sqrDist += (t = std::max(Math< DistType >::Abs(min[i] - a[i]),
338  Math< DistType >::Abs(max[i] - a[i]))) * t;
339  return sqrDist;
340  }
341 
342  template< class PointAT, class MaskAT, class PointBT >
343  typename DistanceType
344  <
347  >::Type
348  BoxSqrDistance(const PointAT& a, const MaskAT& mask, const PointBT& min,
349  const PointBT& max) const
350  {
351  typename DistanceType
352  <
355  >::Type sqrDist = 0, t;
356  for (unsigned int i = 0; i < VectorKernelT::m_dim / MaskElemSizeT::m_maskElemSize; ++i)
357  {
358  if (!mask[i])
359  {
360  continue;
361  }
362  for (unsigned int j = 0; j < MaskElemSizeT::m_maskElemSize; ++j)
363  {
364  if (min[i * MaskElemSizeT::m_maskElemSize + j] > max[i * MaskElemSizeT::m_maskElemSize + j])
365  {
366  continue;
367  }
368  if (a[i * MaskElemSizeT::m_maskElemSize + j] < min[i * MaskElemSizeT::m_maskElemSize + j])
369  {
370  t = min[i * MaskElemSizeT::m_maskElemSize + j] - a[i * MaskElemSizeT::m_maskElemSize + j];
371  sqrDist += t * t;
372  }
373  else if (a[i * MaskElemSizeT::m_maskElemSize + j] > max[i * MaskElemSizeT::m_maskElemSize + j])
374  {
375  t = a[i * MaskElemSizeT::m_maskElemSize + j] - max[i * MaskElemSizeT::m_maskElemSize + j];
376  sqrDist += t * t;
377  }
378  }
379  }
380  return sqrDist;
381  }
382 
383  template< class PointAT, class MaskAT, class PointBT >
384  typename DistanceType
385  <
388  >::Type
389  MaxBoxSqrDistance(const PointAT& a, const MaskAT& mask,
390  const PointBT& min, const PointBT& max) const
391  {
392  typedef typename DistanceType
393  <
396  >::Type DistType;
397  DistType sqrDist = 0, t;
398  for (unsigned int i = 0; i < VectorKernelT::m_dim / MaskElemSizeT::m_maskElemSize; ++i)
399  {
400  if (!mask[i])
401  {
402  continue;
403  }
404  for (unsigned int j = 0; j < MaskElemSizeT::m_maskElemSize; ++j)
405  {
406  if (min[i * MaskElemSizeT::m_maskElemSize + j] > max[i * MaskElemSizeT::m_maskElemSize + j])
407  {
408  continue;
409  }
410  sqrDist += (t = std::max(Math< DistType >::Abs(min[i * MaskElemSizeT::m_maskElemSize + j] - a[i * MaskElemSizeT::m_maskElemSize + j]),
411  Math< DistType >::Abs(max[i * MaskElemSizeT::m_maskElemSize + j] - a[i * MaskElemSizeT::m_maskElemSize + j]))) * t;
412  }
413  }
414  return sqrDist;
415  }
416 
417  template< class PointAT, class PointBT, class WidthT >
418  typename DistanceType
419  <
421  WidthT
422  >::Type
423  AACubeSqrDistance(const PointAT& a, const PointBT& min,
424  WidthT width) const
425  {
426  typename DistanceType
427  <
429  WidthT
430  >::Type sqrDist = 0, t;
431  for (unsigned int i = 0; i < VectorKernelT::m_dim; ++i)
432  {
433  if (min[i] > a[i])
434  {
435  t = min[i] - a[i];
436  sqrDist += t * t;
437  }
438  else if (a[i] > min[i] + width)
439  {
440  t = a[i] - (min[i] + width);
441  sqrDist += t * t;
442  }
443  //t = min[i] - a[i];
444  //if(t > 0)
445  // sqrDist += t * t;
446  //else if(t < -width)
447  //{
448  // t += width;
449  // sqrDist += t * t;
450  //}
451  }
452  return sqrDist;
453  }
454 
455  template< class PointAT, class PointBT >
456  void AssignAsAABoxMin(const PointAT& vec, PointBT* bboxMin) const
457  {
458  for (unsigned int i = 0; i < VectorKernelT::m_dim; ++i)
459  {
460  (*bboxMin)[i] = vec[i];
461  }
462  }
463 
464  template< class PointAT, class PointBT >
465  void AssignAsAABoxMax(const PointAT& vec, PointBT* bboxMax) const
466  {
467  for (unsigned int i = 0; i < VectorKernelT::m_dim; ++i)
468  {
469  (*bboxMax)[i] = vec[i];
470  }
471  }
472 
473  template< class PointAT, class MaskAT, class PointBT >
474  void AssignAsAABoxMinMaskInfinity(const PointAT& vec, const MaskAT& mask,
475  PointBT* bboxMin) const
476  {
477  typedef typename ScalarTypeDeferer< PointBT >::ScalarType ScalarType;
478  for (unsigned int i = 0; i < VectorKernelT::m_dim / MaskElemSizeT::m_maskElemSize; ++i)
479  if (mask[i])
480  for (unsigned int j = 0; j < MaskElemSizeT::m_maskElemSize; ++j)
481  {
482  (*bboxMin)[i * MaskElemSizeT::m_maskElemSize + j] = vec[i * MaskElemSizeT::m_maskElemSize + j];
483  }
484  else
485  for (unsigned int j = 0; j < MaskElemSizeT::m_maskElemSize; ++j)
486  {
487  (*bboxMin)[i * MaskElemSizeT::m_maskElemSize + j] = -std::numeric_limits< ScalarType >::infinity();
488  }
489  }
490 
491  template< class PointAT, class MaskAT, class PointBT >
492  void AssignAsAABoxMinMaskIgnore(const PointAT& vec, const MaskAT& mask,
493  PointBT* bboxMin) const
494  {
495  typedef typename ScalarTypeDeferer< PointBT >::ScalarType ScalarType;
496  for (unsigned int i = 0; i < VectorKernelT::m_dim / MaskElemSizeT::m_maskElemSize; ++i)
497  if (mask[i])
498  for (unsigned int j = 0; j < MaskElemSizeT::m_maskElemSize; ++j)
499  {
500  (*bboxMin)[i * MaskElemSizeT::m_maskElemSize + j] = vec[i * MaskElemSizeT::m_maskElemSize + j];
501  }
502  else
503  for (unsigned int j = 0; j < MaskElemSizeT::m_maskElemSize; ++j)
504  {
505  (*bboxMin)[i * MaskElemSizeT::m_maskElemSize + j] = std::numeric_limits< ScalarType >::infinity();
506  }
507  }
508 
509  template< class PointAT, class MaskAT, class PointBT >
510  void AssignAsAABoxMaxMaskInfinity(const PointAT& vec, const MaskAT& mask,
511  PointBT* bboxMax) const
512  {
513  typedef typename ScalarTypeDeferer< PointBT >::ScalarType ScalarType;
514  for (unsigned int i = 0; i < VectorKernelT::m_dim / MaskElemSizeT::m_maskElemSize; ++i)
515  if (mask[i])
516  for (unsigned int j = 0; j < MaskElemSizeT::m_maskElemSize; ++j)
517  {
518  (*bboxMax)[i * MaskElemSizeT::m_maskElemSize + j] = vec[i * MaskElemSizeT::m_maskElemSize + j];
519  }
520  else
521  for (unsigned int j = 0; j < MaskElemSizeT::m_maskElemSize; ++j)
522  {
523  (*bboxMax)[i * MaskElemSizeT::m_maskElemSize + j] = std::numeric_limits< ScalarType >::infinity();
524  }
525  }
526 
527  template< class PointAT, class MaskAT, class PointBT >
528  void AssignAsAABoxMaxMaskIgnore(const PointAT& vec, const MaskAT& mask,
529  PointBT* bboxMax) const
530  {
531  typedef typename ScalarTypeDeferer< PointBT >::ScalarType ScalarType;
532  for (unsigned int i = 0; i < VectorKernelT::m_dim / MaskElemSizeT::m_maskElemSize; ++i)
533  if (mask[i])
534  for (unsigned int j = 0; j < MaskElemSizeT::m_maskElemSize; ++j)
535  {
536  (*bboxMax)[i * MaskElemSizeT::m_maskElemSize + j] = vec[i * MaskElemSizeT::m_maskElemSize + j];
537  }
538  else
539  for (unsigned int j = 0; j < MaskElemSizeT::m_maskElemSize; ++j)
540  {
541  (*bboxMax)[i * MaskElemSizeT::m_maskElemSize + j] = -std::numeric_limits< ScalarType >::infinity();
542  }
543  }
544 
545  template< class BoxPointT >
546  void InitMaximalAABox(BoxPointT box[2]) const
547  {
549  ScalarType;
550  for (unsigned int i = 0; i < VectorKernelT::m_dim; ++i)
551  {
554  }
555  }
556 
557  template< class PointT, class BoxPointT >
558  void IncludeInAABox(const PointT& p, BoxPointT box[2]) const
559  {
560  for (unsigned int i = 0; i < VectorKernelT::m_dim; ++i)
561  {
562  if (box[0][i] > p[i])
563  {
564  box[0][i] = p[i];
565  }
566  else if (box[1][i] < p[i])
567  {
568  box[1][i] = p[i];
569  }
570  }
571  }
572 
573  template< class PointT, class MaskT, class BoxPointT >
574  void IncludeInAABoxMaskInfinity(const PointT& p, const MaskT& mask, BoxPointT box[2]) const
575  {
577  ScalarType;
578  for (unsigned int i = 0; i < VectorKernelT::m_dim / MaskElemSizeT::m_maskElemSize; ++i)
579  {
580  if (mask[i])
581  for (unsigned int j = 0; j < MaskElemSizeT::m_maskElemSize; ++j)
582  {
583  if (box[0][i * MaskElemSizeT::m_maskElemSize + j] > p[i * MaskElemSizeT::m_maskElemSize + j])
584  {
585  box[0][i * MaskElemSizeT::m_maskElemSize + j] = p[i * MaskElemSizeT::m_maskElemSize + j];
586  }
587  else if (box[1][i * MaskElemSizeT::m_maskElemSize + j] < p[i * MaskElemSizeT::m_maskElemSize + j])
588  {
589  box[1][i * MaskElemSizeT::m_maskElemSize + j] = p[i * MaskElemSizeT::m_maskElemSize + j];
590  }
591  }
592  else
593  for (unsigned int j = 0; j < MaskElemSizeT::m_maskElemSize; ++j)
594  {
595  box[0][i * MaskElemSizeT::m_maskElemSize + j] = -std::numeric_limits< ScalarType >::infinity();
596  box[1][i * MaskElemSizeT::m_maskElemSize + j] = std::numeric_limits< ScalarType >::infinity();
597  }
598  }
599  }
600 
601  template< class PointT, class MaskT, class BoxPointT >
602  void IncludeInAABoxMaskIgnore(const PointT& p, const MaskT& mask, BoxPointT box[2]) const
603  {
604  // typedef typename ScalarTypeDeferer< BoxPointT >::ScalarType
605  // ScalarType;
606  for (unsigned int i = 0; i < VectorKernelT::m_dim / MaskElemSizeT::m_maskElemSize; ++i)
607  if (mask[i])
608  for (unsigned int j = 0; j < MaskElemSizeT::m_maskElemSize; ++j)
609  {
610  if (box[0][i * MaskElemSizeT::m_maskElemSize + j] > p[i * MaskElemSizeT::m_maskElemSize + j])
611  {
612  box[0][i * MaskElemSizeT::m_maskElemSize + j] = p[i * MaskElemSizeT::m_maskElemSize + j];
613  }
614  else if (box[1][i * MaskElemSizeT::m_maskElemSize + j] < p[i * MaskElemSizeT::m_maskElemSize + j])
615  {
616  box[1][i * MaskElemSizeT::m_maskElemSize + j] = p[i * MaskElemSizeT::m_maskElemSize + j];
617  }
618  }
619  }
620  };
621 
622  template< class VectorKernelT >
623  struct L2Norm
624  : public L2NormWithMask< VectorKernelT, FixedMaskElementSize< 1 > >
625  {};
626 
627  template< class MaskElemSizeT >
628  struct MakeL2Norm
629  {
630  template< class VectorKernelT >
631  struct L2NormType
632  : public L2NormWithMask< VectorKernelT, MaskElemSizeT >
633  {};
634  };
635 };
636 
637 #endif
GfxTL::L2NormWithMask::AssignAsAABoxMaxMaskIgnore
void AssignAsAABoxMaxMaskIgnore(const PointAT &vec, const MaskAT &mask, PointBT *bboxMax) const
Definition: L2Norm.h:528
GfxTL::sqrt
VectorXD< D, T > sqrt(const VectorXD< D, T > &a)
Definition: VectorXD.h:662
GfxTL::L2NormWithMask
Definition: L2Norm.h:47
GfxTL::L2NormWithMask::BoxSqrDistance
DistanceType< typename ScalarTypeDeferer< PointAT >::ScalarType, typename ScalarTypeDeferer< PointBT >::ScalarType >::Type BoxSqrDistance(const PointAT &a, const PointBT &min, const PointBT &max) const
Definition: L2Norm.h:297
GfxTL::L2NormWithMask::SqrDistance
DistanceType< typename ScalarTypeDeferer< PointAT >::ScalarType, typename ScalarTypeDeferer< PointBT >::ScalarType >::Type SqrDistance(const PointAT &p, const MaskAT &ma, const PointBT &v, const MaskBT &mb, typename DistanceType< typename ScalarTypeDeferer< PointAT >::ScalarType, typename ScalarTypeDeferer< PointBT >::ScalarType >::Type abortDist) const
Definition: L2Norm.h:171
GfxTL::L2NormWithMask::AssignAsAABoxMinMaskInfinity
void AssignAsAABoxMinMaskInfinity(const PointAT &vec, const MaskAT &mask, PointBT *bboxMin) const
Definition: L2Norm.h:474
GfxTL::FixedMaskElementSize::m_maskElemSize
@ m_maskElemSize
Definition: L2Norm.h:43
GfxTL::max
MatrixXX< C, R, T > max(const MatrixXX< C, R, T > &a, const MatrixXX< C, R, T > &b)
Definition: MatrixXX.h:581
GfxTL::FixedMaskElementSize::MaskElementSize
const unsigned int MaskElementSize() const
Definition: L2Norm.h:32
GfxTL::L2NormWithMask::AssignAsAABoxMax
void AssignAsAABoxMax(const PointAT &vec, PointBT *bboxMax) const
Definition: L2Norm.h:465
GfxTL::L2NormWithMask::AssignAsAABoxMinMaskIgnore
void AssignAsAABoxMinMaskIgnore(const PointAT &vec, const MaskAT &mask, PointBT *bboxMin) const
Definition: L2Norm.h:492
GfxTL::L2NormWithMask::MaskElementSizeType
MaskElemSizeT MaskElementSizeType
Definition: L2Norm.h:52
GfxTL::L2NormWithMask::AssignAsAABoxMin
void AssignAsAABoxMin(const PointAT &vec, PointBT *bboxMin) const
Definition: L2Norm.h:456
GfxTL::L2NormWithMask::SqrDistance
DistanceType< typename ScalarTypeDeferer< PointAT >::ScalarType, typename ScalarTypeDeferer< PointBT >::ScalarType >::Type SqrDistance(const PointAT &p, const PointBT &v, const MaskBT &mb, typename DistanceType< typename ScalarTypeDeferer< PointAT >::ScalarType, typename ScalarTypeDeferer< PointBT >::ScalarType >::Type abortDist) const
Definition: L2Norm.h:236
GfxTL::L2NormWithMask::IncrementalBoxSqrDistance
DistScalarT IncrementalBoxSqrDistance(DistScalarT boxSqrDist, DiffScalarT boxDiff, DiffScalarT cutDiff) const
Definition: L2Norm.h:284
GfxTL::FixedMaskElementSize::MaskElementSize
void MaskElementSize(unsigned int s)
Definition: L2Norm.h:37
GfxTL::ScalarTypeDeferer::ScalarType
PointT::value_type ScalarType
Definition: ScalarTypeDeferer.h:14
GfxTL::min
MatrixXX< C, R, T > min(const MatrixXX< C, R, T > &a, const MatrixXX< C, R, T > &b)
Definition: MatrixXX.h:568
GfxTL::L2NormWithMask::RootOfDistance
ScalarT RootOfDistance(ScalarT sqrDistance) const
Definition: L2Norm.h:278
ScalarTypeConversion.h
GfxTL::L2NormWithMask::Distance
DistanceType< typename ScalarTypeDeferer< PointAT >::ScalarType, typename ScalarTypeDeferer< PointBT >::ScalarType >::Type Distance(const PointAT &p, const PointBT &v, const MaskAT &ma, const MaskBT &mb) const
Definition: L2Norm.h:271
GfxTL::DynamicMaskElementSize
Definition: L2Norm.h:9
GfxTL::L2NormWithMask::SqrDistance
DistanceType< typename ScalarTypeDeferer< PointAT >::ScalarType, typename ScalarTypeDeferer< PointBT >::ScalarType >::Type SqrDistance(const PointAT &p, const MaskAT &ma, const PointBT &v, const MaskBT &mb) const
Definition: L2Norm.h:141
GfxTL::L2NormWithMask::SqrDistance
DistanceType< typename ScalarTypeDeferer< PointAT >::ScalarType, typename ScalarTypeDeferer< PointBT >::ScalarType >::Type SqrDistance(const PointAT &p, const PointBT &v) const
Definition: L2Norm.h:90
GfxTL::DynamicMaskElementSize::MaskElementSize
const unsigned int MaskElementSize() const
Definition: L2Norm.h:19
GfxTL::L2NormWithMask::BoxSqrDistance
DistanceType< typename ScalarTypeDeferer< PointAT >::ScalarType, typename ScalarTypeDeferer< PointBT >::ScalarType >::Type BoxSqrDistance(const PointAT &a, const MaskAT &mask, const PointBT &min, const PointBT &max) const
Definition: L2Norm.h:348
GfxTL::L2NormWithMask::IncludeInAABoxMaskIgnore
void IncludeInAABoxMaskIgnore(const PointT &p, const MaskT &mask, BoxPointT box[2]) const
Definition: L2Norm.h:602
GfxTL::FixedMaskElementSize
Definition: L2Norm.h:29
armarx::ctrlutil::a
double a(double t, double a0, double j)
Definition: CtrlUtil.h:45
GfxTL::L2NormWithMask::InitMaximalAABox
void InitMaximalAABox(BoxPointT box[2]) const
Definition: L2Norm.h:546
GfxTL::L2NormWithMask::SqrDistance
DistanceType< typename ScalarTypeDeferer< PointAT >::ScalarType, typename ScalarTypeDeferer< PointBT >::ScalarType >::Type SqrDistance(const PointAT &p, const PointBT &v, typename DistanceType< typename ScalarTypeDeferer< PointAT >::ScalarType, typename ScalarTypeDeferer< PointBT >::ScalarType >::Type abortDist) const
Definition: L2Norm.h:113
GfxTL::DynamicMaskElementSize::m_maskElemSize
unsigned int m_maskElemSize
Definition: L2Norm.h:25
GfxTL::L2NormWithMask::VectorKernelType
VectorKernelT VectorKernelType
Definition: L2Norm.h:51
armarx::PointT
pcl::PointXYZRGBL PointT
Definition: Common.h:28
GfxTL::L2NormWithMask::AssignAsAABoxMaxMaskInfinity
void AssignAsAABoxMaxMaskInfinity(const PointAT &vec, const MaskAT &mask, PointBT *bboxMax) const
Definition: L2Norm.h:510
GfxTL::DynamicMaskElementSize::MaskElementSize
void MaskElementSize(unsigned int s)
Definition: L2Norm.h:14
max
T max(T t1, T t2)
Definition: gdiam.h:48
armarx::aron::similarity::FloatSimilarity::Type
Type
The Type enum.
Definition: FloatSimilarity.h:8
GfxTL::Math
Definition: MathHelper.h:11
GfxTL::MakeL2Norm
Definition: L2Norm.h:628
GfxTL::L2NormWithMask::MaxBoxSqrDistance
DistanceType< typename ScalarTypeDeferer< PointAT >::ScalarType, typename ScalarTypeDeferer< PointBT >::ScalarType >::Type MaxBoxSqrDistance(const PointAT &a, const MaskAT &mask, const PointBT &min, const PointBT &max) const
Definition: L2Norm.h:389
GfxTL
Definition: AABox.h:8
GfxTL::L2NormWithMask::IncludeInAABoxMaskInfinity
void IncludeInAABoxMaskInfinity(const PointT &p, const MaskT &mask, BoxPointT box[2]) const
Definition: L2Norm.h:574
GfxTL::L2NormWithMask::SqrDistance
DistanceType< typename ScalarTypeDeferer< PointAT >::ScalarType, typename ScalarTypeDeferer< PointBT >::ScalarType >::Type SqrDistance(const PointAT &p, const PointBT &v, const MaskBT &mb) const
Definition: L2Norm.h:206
GfxTL::L2NormWithMask::AACubeSqrDistance
DistanceType< typename ScalarTypeDeferer< PointAT >::ScalarType, WidthT >::Type AACubeSqrDistance(const PointAT &a, const PointBT &min, WidthT width) const
Definition: L2Norm.h:423
GfxTL::MakeL2Norm::L2NormType
Definition: L2Norm.h:631
GfxTL::ScalarTypeConversion
Definition: ScalarTypeConversion.h:7
GfxTL::L2NormWithMask::DistanceType::Type
ScalarTypeConversion< ScalarAT, ScalarBT >::DifferenceType Type
Definition: L2Norm.h:58
armarx::ctrlutil::v
double v(double t, double v0, double a0, double j)
Definition: CtrlUtil.h:39
GfxTL::L2NormWithMask::DistanceType
Definition: L2Norm.h:55
GfxTL::L2Norm
Definition: L2Norm.h:623
GfxTL::L2NormWithMask::Distance
DistanceType< typename ScalarTypeDeferer< PointAT >::ScalarType, typename ScalarTypeDeferer< PointBT >::ScalarType >::Type Distance(const PointAT &p, const PointBT &v) const
Definition: L2Norm.h:67
min
T min(T t1, T t2)
Definition: gdiam.h:42
GfxTL::DynamicMaskElementSize::DynamicMaskElementSize
DynamicMaskElementSize()
Definition: L2Norm.h:12
MathHelper.h
GfxTL::L2NormWithMask::MaxBoxSqrDistance
DistanceType< typename ScalarTypeDeferer< PointAT >::ScalarType, typename ScalarTypeDeferer< PointBT >::ScalarType >::Type MaxBoxSqrDistance(const PointAT &a, const PointBT &min, const PointBT &max) const
Definition: L2Norm.h:327
ScalarTypeDeferer.h
armarx::ctrlutil::s
double s(double t, double s0, double v0, double a0, double j)
Definition: CtrlUtil.h:33
GfxTL::L2NormWithMask::IncludeInAABox
void IncludeInAABox(const PointT &p, BoxPointT box[2]) const
Definition: L2Norm.h:558