DGtal  1.3.beta
ExactPredicateLpPowerSeparableMetric.h
1 
17 #pragma once
18 
31 #if defined(ExactPredicateLpPowerSeparableMetric_RECURSES)
32 #error Recursive header files inclusion detected in ExactPredicateLpPowerSeparableMetric.h
33 #else // defined(ExactPredicateLpPowerSeparableMetric_RECURSES)
34 
35 #define ExactPredicateLpPowerSeparableMetric_RECURSES
36 
37 #if !defined ExactPredicateLpPowerSeparableMetric_h
38 
39 #define ExactPredicateLpPowerSeparableMetric_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 ExactPredicateLpPowerSeparableMetric
85  template <typename TSpace, DGtal::uint32_t p,
86  typename TPromoted=DGtal::int64_t>
88  {
89  // ----------------------- Standard services ------------------------------
90  public:
91 
92 
94  typedef TSpace Space;
96 
98  typedef typename Space::Point Point;
100  typedef typename Point::Coordinate Abscissa;
102  typedef typename Space::Vector Vector;
103 
105  typedef TPromoted Promoted;
106 
108  typedef TPromoted Weight;
110 
112  typedef TPromoted Value;
113 
118 
119 
124 
129 
135 
136  // ----------------------- Interface --------------------------------------
137  public:
138 
139  // ----------------------- CPowerMetric --------------------------------------
140 
141 
153  const Point &aQ,
154  const Weight &aWq) const;
155 
156 
170  DGtal::Closest closestPower(const Point &origin,
171  const Point &first,
172  const Weight &wF,
173  const Point &second,
174  const Weight &wS) const;
175 
176  // ----------------------- CPowerSeparableMetric --------------------------------------
177 
202  bool hiddenByPower(const Point &u,
203  const Weight &wu,
204  const Point &v,
205  const Weight &wv,
206  const Point &w,
207  const Weight &ww,
208  const Point &startingPoint,
209  const Point &endPoint,
210  const typename Point::UnsignedComponent dim) const;
211 
212 
217  void selfDisplay ( std::ostream & out ) const;
218 
223  bool isValid() const;
224 
225  // ------------------------- Protected Datas ------------------------------
226  private:
227 
237  Promoted exactDistanceRepresentation(const Point &aP, const Point &aQ) const;
238 
256  const Abscissa &vdim,
257  const Promoted &nu,
258  const Promoted &nv,
259  const Abscissa &lower,
260  const Abscissa &upper) const;
261 
262 
263  // ------------------------- Private Datas --------------------------------
264  private:
265 
266 
267  // ------------------------- Internals ------------------------------------
268  private:
269 
270  }; // end of class ExactPredicateLpPowerSeparableMetric
271 
272 
274 // L_2 specialization //
276 
277 
278  template <typename TSpace,
279  typename TPromoted>
280  class ExactPredicateLpPowerSeparableMetric<TSpace, 2, TPromoted>
281  {
282  // ----------------------- Standard services ------------------------------
283  public:
284 
286  typedef TSpace Space;
288  typedef typename Space::Point Point;
290  typedef typename Point::Coordinate Abscissa;
292  typedef typename Space::Vector Vector;
293 
295  typedef TPromoted Promoted;
296 
298  typedef TPromoted Weight;
299 
301  typedef TPromoted Value;
306 
307 
312 
313 
318 
324  { return *this;}
325 
326 
327  // ----------------------- Interface --------------------------------------
328  public:
329 
341  const Point &aQ,
342  const Weight &aWq) const;
343 
344 
358  DGtal::Closest closestPower(const Point &origin,
359  const Point &first,
360  const Weight &wF,
361  const Point &second,
362  const Weight &wS) const;
363 
364 
375  Promoted exactDistanceRepresentation(const Point &aP, const Point &aQ) const;
376 
377  // ----------------------- CSeparableMetric --------------------------------------
399  bool hiddenByPower(const Point &u,
400  const Weight &wu,
401  const Point &v,
402  const Weight &wv,
403  const Point &w,
404  const Weight &ww,
405  const Point &startingPoint,
406  const Point &endPoint,
407  const typename Point::UnsignedComponent dim) const;
408 
409  // ----------------------- Other services --------------------------------------
414  void selfDisplay ( std::ostream & out ) const;
415 
420  bool isValid() const;
421 
422  // ------------------------- Protected Datas ------------------------------
423  private:
424 
425 
443  const Abscissa &vdim,
444  const Promoted &nu,
445  const Promoted &nv,
446  const Abscissa &lower,
447  const Abscissa &upper) const;
448 
449 
450  // ------------------------- Private Datas --------------------------------
451  private:
452 
453  // ------------------------- Internals ------------------------------------
454  private:
455 
456  }; // end of class ExactPredicateLpPowerSeparableMetric
457 
464  template <typename T, DGtal::uint32_t p , typename P>
465  std::ostream&
466  operator<< ( std::ostream & out, const ExactPredicateLpPowerSeparableMetric<T,p,P> & object );
467 
468 } // namespace DGtal
469 
470 
472 // Includes inline functions.
473 #include "DGtal/geometry/volumes/distance/ExactPredicateLpPowerSeparableMetric.ih"
474 
475 // //
477 
478 #endif // !defined ExactPredicateLpPowerSeparableMetric_h
479 
480 #undef ExactPredicateLpPowerSeparableMetric_RECURSES
481 #endif // else defined(ExactPredicateLpPowerSeparableMetric_RECURSES)
DGtal::ExactPredicateLpPowerSeparableMetric::exactDistanceRepresentation
Promoted exactDistanceRepresentation(const Point &aP, const Point &aQ) const
DGtal::ExactPredicateLpPowerSeparableMetric::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::ExactPredicateLpPowerSeparableMetric
Aim: implements weighted separable l_p metrics with exact predicates.
Definition: ExactPredicateLpPowerSeparableMetric.h:87
DGtal::ExactPredicateLpPowerSeparableMetric::Value
TPromoted Value
Type for Value (alias)
Definition: ExactPredicateLpPowerSeparableMetric.h:112
DGtal::ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted >::Vector
Space::Vector Vector
Type for vectors.
Definition: ExactPredicateLpPowerSeparableMetric.h:292
DGtal::concepts::CSpace
Aim: Defines the concept describing a digital space, ie a cartesian product of integer lines.
Definition: CSpace.h:105
DGtal::concepts::CInteger
Aim: Concept checking for Integer Numbers. More precisely, this concept is a refinement of both CEucl...
Definition: CInteger.h:87
DGtal::uint32_t
boost::uint32_t uint32_t
unsigned 32-bit integer.
Definition: BasicTypes.h:63
lower
Vector lower(const Vector &z, unsigned int k)
Definition: viewDualSurface.cpp:190
DGtal::ExactPredicateLpPowerSeparableMetric::Space
TSpace Space
Copy the space type.
Definition: ExactPredicateLpPowerSeparableMetric.h:94
DGtal::PointVector< dim, Integer >::Coordinate
Component Coordinate
Type for Point elements.
Definition: PointVector.h:617
DGtal::ExactPredicateLpPowerSeparableMetric::ExactPredicateLpPowerSeparableMetric
ExactPredicateLpPowerSeparableMetric()
aPoint
const Point aPoint(3, 4)
DGtal::ExactPredicateLpPowerSeparableMetric::~ExactPredicateLpPowerSeparableMetric
~ExactPredicateLpPowerSeparableMetric()
DGtal::ExactPredicateLpPowerSeparableMetric::powerDistance
Weight powerDistance(const Point &aPoint, const Point &aQ, const Weight &aWq) const
dim
unsigned int dim(const Vector &z)
Definition: viewDualSurface.cpp:174
DGtal::Closest
Closest
Definition: Common.h:147
DGtal::ExactPredicateLpPowerSeparableMetric::closestPower
DGtal::Closest closestPower(const Point &origin, const Point &first, const Weight &wF, const Point &second, const Weight &wS) const
DGtal::ExactPredicateLpPowerSeparableMetric::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CSpace< TSpace >))
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
DGtal::ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted >::Point
Space::Point Point
Type for points.
Definition: ExactPredicateLpPowerSeparableMetric.h:288
DGtal::ExactPredicateLpPowerSeparableMetric::Vector
Space::Vector Vector
Type for vectors.
Definition: ExactPredicateLpPowerSeparableMetric.h:102
DGtal::ExactPredicateLpPowerSeparableMetric::ExactPredicateLpPowerSeparableMetric
ExactPredicateLpPowerSeparableMetric(const ExactPredicateLpPowerSeparableMetric &)
Definition: ExactPredicateLpPowerSeparableMetric.h:128
DGtal::ExactPredicateLpPowerSeparableMetric::Abscissa
Point::Coordinate Abscissa
Type for points.
Definition: ExactPredicateLpPowerSeparableMetric.h:100
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::ExactPredicateLpPowerSeparableMetric::binarySearchHidden
Abscissa binarySearchHidden(const Abscissa &udim, const Abscissa &vdim, const Promoted &nu, const Promoted &nv, const Abscissa &lower, const Abscissa &upper) const
DGtal::ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted >::Promoted
TPromoted Promoted
Type for internal distance values.
Definition: ExactPredicateLpPowerSeparableMetric.h:295
DGtal::ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted >::Value
TPromoted Value
Type for Value (alias)
Definition: ExactPredicateLpPowerSeparableMetric.h:301
DGtal::ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted >::Space
TSpace Space
Copy the space type.
Definition: ExactPredicateLpPowerSeparableMetric.h:286
DGtal::ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted >::Weight
TPromoted Weight
Type for internal distance values.
Definition: ExactPredicateLpPowerSeparableMetric.h:298
DGtal::ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted >::ExactPredicateLpPowerSeparableMetric
ExactPredicateLpPowerSeparableMetric(const ExactPredicateLpPowerSeparableMetric &)
Definition: ExactPredicateLpPowerSeparableMetric.h:317
DGtal::ExactPredicateLpPowerSeparableMetric::hiddenByPower
bool hiddenByPower(const Point &u, const Weight &wu, const Point &v, const Weight &wv, const Point &w, const Weight &ww, const Point &startingPoint, const Point &endPoint, const typename Point::UnsignedComponent dim) const
DGtal::ExactPredicateLpPowerSeparableMetric::Weight
TPromoted Weight
Type for internal distance values.
Definition: ExactPredicateLpPowerSeparableMetric.h:108
upper
Vector upper(const Vector &z, unsigned int k)
Definition: viewDualSurface.cpp:197
DGtal::ExactPredicateLpPowerSeparableMetric::Promoted
TPromoted Promoted
Type for internal distance values.
Definition: ExactPredicateLpPowerSeparableMetric.h:105
DGtal::PointVector< dim, Integer >
DGtal::ExactPredicateLpPowerSeparableMetric::isValid
bool isValid() const
DGtal::int64_t
boost::int64_t int64_t
signed 94-bit integer.
Definition: BasicTypes.h:74
DGtal::ExactPredicateLpPowerSeparableMetric::Point
Space::Point Point
Type for points.
Definition: ExactPredicateLpPowerSeparableMetric.h:98
Point
MyPointD Point
Definition: testClone2.cpp:383
DGtal::PointVector< dim, Integer >::UnsignedComponent
NumberTraits< Component >::UnsignedVersion UnsignedComponent
Unsigned version of the components.
Definition: PointVector.h:620
DGtal::ExactPredicateLpPowerSeparableMetric< TSpace, 2, TPromoted >::Abscissa
Point::Coordinate Abscissa
Type for points.
Definition: ExactPredicateLpPowerSeparableMetric.h:290
DGtal::ExactPredicateLpPowerSeparableMetric::operator=
ExactPredicateLpPowerSeparableMetric & operator=(const ExactPredicateLpPowerSeparableMetric &)
Definition: ExactPredicateLpPowerSeparableMetric.h:134