DGtal  1.1.0
ExactPredicateLpSeparableMetric.h
1 
17 #pragma once
18 
31 #if defined(ExactPredicateLpSeparableMetric_RECURSES)
32 #error Recursive header files inclusion detected in ExactPredicateLpSeparableMetric.h
33 #else // defined(ExactPredicateLpSeparableMetric_RECURSES)
34 
35 #define ExactPredicateLpSeparableMetric_RECURSES
36 
37 #if !defined ExactPredicateLpSeparableMetric_h
38 
39 #define ExactPredicateLpSeparableMetric_h
40 
42 // Inclusions
43 #include <iostream>
44 #include <cmath>
45 #include "DGtal/base/Common.h"
46 #include "DGtal/math/BasicMathFunctions.h"
47 #include "DGtal/kernel/CInteger.h"
48 #include "DGtal/kernel/CSpace.h"
49 #include "DGtal/kernel/CInteger.h"
51 
52 namespace DGtal
53 {
54 
56 // template class ExactPredicateLpSeparableMetric
85  template <typename TSpace, DGtal::uint32_t p,
86  typename TRawValue=DGtal::int64_t>
88  {
89  // ----------------------- Standard services ------------------------------
90  public:
92  typedef TSpace Space;
94 
96  typedef typename Space::Point Point;
98  typedef typename Point::Coordinate Abscissa;
100  typedef typename Space::Vector Vector;
101 
103  typedef TRawValue RawValue;
105 
107  typedef double Value;
108 
111 
116 
117 
122 
128  {
129  boost::ignore_unused_variable_warning( other );
130  }
131 
137  Self & operator= ( const Self & other )
138  {
139  boost::ignore_unused_variable_warning( other );
140  return *this;
141  }
142 
143  // ----------------------- Interface --------------------------------------
144  public:
145 
146  // ----------------------- CMetricSpace --------------------------------------
155  Value operator()(const Point & aP, const Point &aQ) const;
156 
168  Closest closest(const Point &origin,
169  const Point &first,
170  const Point &second) const;
171 
180  RawValue rawDistance(const Point & aP, const Point &aQ) const;
181 
182  // ----------------------- CSeparableMetric --------------------------------------
204  bool hiddenBy(const Point &u,
205  const Point &v,
206  const Point &w,
207  const Point &startingPoint,
208  const Point &endPoint,
209  const typename Point::UnsignedComponent dim) const;
210 
211 
216  void selfDisplay ( std::ostream & out ) const;
217 
222  bool isValid() const;
223 
224 
245  const Abscissa &vdim,
246  const RawValue &nu,
247  const RawValue &nv,
248  const Abscissa &lower,
249  const Abscissa &upper) const;
250 
251  }; // end of class ExactPredicateLpSeparableMetric
252 
253 
255 // L_2 specialization //
257 
258 
259  template <typename TSpace,
260  typename TRawValue>
261  class ExactPredicateLpSeparableMetric<TSpace, 2, TRawValue>
262  {
263  // ----------------------- Standard services ------------------------------
264  public:
265 
267  typedef TSpace Space;
269  typedef typename Space::Point Point;
271  typedef typename Point::Coordinate Abscissa;
273  typedef typename Space::Vector Vector;
274 
276  typedef TRawValue RawValue;
277 
279  typedef double Value;
280 
283 
288 
289 
294 
295 
301  {
302  boost::ignore_unused_variable_warning( other );
303  }
304 
310  Self & operator= ( const Self & other )
311  {
312  boost::ignore_unused_variable_warning( other );
313  return *this;
314  }
315 
316 
317  // ----------------------- Interface --------------------------------------
318  public:
319 
320  // ----------------------- CLocalMetric --------------------------------------
330  Value local(const Point & aP, const Vector &aDir) const;
331 
332 
333  // ----------------------- CMetric --------------------------------------
342  Value operator()(const Point & aP, const Point &aQ) const;
343 
355  Closest closest(const Point &origin,
356  const Point &first,
357  const Point &second) const;
358 
359 
370  RawValue rawDistance(const Point &aP, const Point &aQ) const;
371 
372  // ----------------------- CSeparableMetric --------------------------------------
391  bool hiddenBy(const Point &u,
392  const Point &v,
393  const Point &w,
394  const Point &startingPoint,
395  const Point &endPoint,
396  const typename Point::UnsignedComponent dim) const;
397 
398  // ----------------------- Other services --------------------------------------
403  void selfDisplay ( std::ostream & out ) const;
404 
409  bool isValid() const;
410 
411  // ------------------------- Protected Datas ------------------------------
412  private:
413 
414 
432  const Abscissa &vdim,
433  const RawValue &nu,
434  const RawValue &nv,
435  const Abscissa &lower,
436  const Abscissa &upper) const;
437 
438 
439  }; // end of class ExactPredicateLpSeparableMetric
440 
447  template <typename T, DGtal::uint32_t p, typename P>
448  std::ostream&
449  operator<< ( std::ostream & out, const ExactPredicateLpSeparableMetric<T,p,P> & object );
450 
451 } // namespace DGtal
452 
453 
455 // Includes inline functions.
456 #include "DGtal/geometry/volumes/distance/ExactPredicateLpSeparableMetric.ih"
457 
458 // //
460 
461 #endif // !defined ExactPredicateLpSeparableMetric_h
462 
463 #undef ExactPredicateLpSeparableMetric_RECURSES
464 #endif // else defined(ExactPredicateLpSeparableMetric_RECURSES)
DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >
Definition: ExactPredicateLpSeparableMetric.h:262
DGtal::ExactPredicateLpSeparableMetric::Self
ExactPredicateLpSeparableMetric< TSpace, p, RawValue > Self
Self type.
Definition: ExactPredicateLpSeparableMetric.h:110
DGtal::ExactPredicateLpSeparableMetric::operator()
Value operator()(const Point &aP, const Point &aQ) const
DGtal::concepts::CSpace
Aim: Defines the concept describing a digital space, ie a cartesian product of integer lines.
Definition: CSpace.h:106
DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::Vector
Space::Vector Vector
Type for vectors.
Definition: ExactPredicateLpSeparableMetric.h:273
DGtal::concepts::CInteger
Aim: Concept checking for Integer Numbers. More precisely, this concept is a refinement of both CEucl...
Definition: CInteger.h:88
DGtal::uint32_t
boost::uint32_t uint32_t
unsigned 32-bit integer.
Definition: BasicTypes.h:63
DGtal::ExactPredicateLpSeparableMetric::operator=
Self & operator=(const Self &other)
Definition: ExactPredicateLpSeparableMetric.h:137
lower
Vector lower(const Vector &z, unsigned int k)
Definition: viewDualSurface.cpp:190
DGtal::PointVector< dim, Integer >::Coordinate
Component Coordinate
Type for Point elements.
Definition: PointVector.h:617
DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::Point
Space::Point Point
Type for points.
Definition: ExactPredicateLpSeparableMetric.h:269
DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::Self
ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue > Self
Self type.
Definition: ExactPredicateLpSeparableMetric.h:282
DGtal::ExactPredicateLpSeparableMetric::ExactPredicateLpSeparableMetric
ExactPredicateLpSeparableMetric()
DGtal::ExactPredicateLpSeparableMetric::RawValue
TRawValue RawValue
Type for internal distance values.
Definition: ExactPredicateLpSeparableMetric.h:103
dim
unsigned int dim(const Vector &z)
Definition: viewDualSurface.cpp:174
DGtal::Closest
Closest
Definition: Common.h:143
DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::ExactPredicateLpSeparableMetric
ExactPredicateLpSeparableMetric()
DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::local
Value local(const Point &aP, const Vector &aDir) const
DGtal::ExactPredicateLpSeparableMetric::Point
Space::Point Point
Type for points.
Definition: ExactPredicateLpSeparableMetric.h:96
DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::Value
double Value
Type for distance values.
Definition: ExactPredicateLpSeparableMetric.h:279
DGtal::ExactPredicateLpSeparableMetric::Vector
Space::Vector Vector
Type for vectors.
Definition: ExactPredicateLpSeparableMetric.h:100
DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::isValid
bool isValid() const
DGtal::ExactPredicateLpSeparableMetric::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CSpace< TSpace >))
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition: ClosedIntegerHalfPlane.h:49
DGtal::ExactPredicateLpSeparableMetric::binarySearchHidden
Abscissa binarySearchHidden(const Abscissa &udim, const Abscissa &vdim, const RawValue &nu, const RawValue &nv, const Abscissa &lower, const Abscissa &upper) const
DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::Space
TSpace Space
Copy the space type.
Definition: ExactPredicateLpSeparableMetric.h:267
DGtal::ExactPredicateLpSeparableMetric::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CInteger< RawValue >))
DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::binarySearchHidden
Abscissa binarySearchHidden(const Abscissa &udim, const Abscissa &vdim, const RawValue &nu, const RawValue &nv, const Abscissa &lower, const Abscissa &upper) const
DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::operator()
Value operator()(const Point &aP, const Point &aQ) const
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
DGtal::ExactPredicateLpSeparableMetric::Abscissa
Point::Coordinate Abscissa
Type for points.
Definition: ExactPredicateLpSeparableMetric.h:98
DGtal::ExactPredicateLpSeparableMetric::hiddenBy
bool hiddenBy(const Point &u, const Point &v, const Point &w, const Point &startingPoint, const Point &endPoint, const typename Point::UnsignedComponent dim) const
DGtal::ExactPredicateLpSeparableMetric::Value
double Value
Type for distance values.
Definition: ExactPredicateLpSeparableMetric.h:107
DGtal::ExactPredicateLpSeparableMetric
Aim: implements separable l_p metrics with exact predicates.
Definition: ExactPredicateLpSeparableMetric.h:88
upper
Vector upper(const Vector &z, unsigned int k)
Definition: viewDualSurface.cpp:197
DGtal::PointVector< dim, Integer >
DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::closest
Closest closest(const Point &origin, const Point &first, const Point &second) const
DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::ExactPredicateLpSeparableMetric
ExactPredicateLpSeparableMetric(const Self &other)
Definition: ExactPredicateLpSeparableMetric.h:300
DGtal::ExactPredicateLpSeparableMetric::rawDistance
RawValue rawDistance(const Point &aP, const Point &aQ) const
DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::RawValue
TRawValue RawValue
Type for internal distance values.
Definition: ExactPredicateLpSeparableMetric.h:276
DGtal::int64_t
boost::int64_t int64_t
signed 94-bit integer.
Definition: BasicTypes.h:74
DGtal::ExactPredicateLpSeparableMetric::isValid
bool isValid() const
DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::~ExactPredicateLpSeparableMetric
~ExactPredicateLpSeparableMetric()
DGtal::ExactPredicateLpSeparableMetric::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::ExactPredicateLpSeparableMetric::ExactPredicateLpSeparableMetric
ExactPredicateLpSeparableMetric(const Self &other)
Definition: ExactPredicateLpSeparableMetric.h:127
DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::rawDistance
RawValue rawDistance(const Point &aP, const Point &aQ) const
DGtal::PointVector< dim, Integer >::UnsignedComponent
NumberTraits< Component >::UnsignedVersion UnsignedComponent
Unsigned version of the components.
Definition: PointVector.h:620
DGtal::ExactPredicateLpSeparableMetric::closest
Closest closest(const Point &origin, const Point &first, const Point &second) const
DGtal::ExactPredicateLpSeparableMetric::~ExactPredicateLpSeparableMetric
~ExactPredicateLpSeparableMetric()
DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::Abscissa
Point::Coordinate Abscissa
Type for points.
Definition: ExactPredicateLpSeparableMetric.h:271
DGtal::ExactPredicateLpSeparableMetric< TSpace, 2, TRawValue >::hiddenBy
bool hiddenBy(const Point &u, const Point &v, const Point &w, const Point &startingPoint, const Point &endPoint, const typename Point::UnsignedComponent dim) const
DGtal::ExactPredicateLpSeparableMetric::Space
TSpace Space
Copy the space type.
Definition: ExactPredicateLpSeparableMetric.h:92