DGtal 2.2.0
Loading...
Searching...
No Matches
DGtal::ParallelIIEstimator< TEstimator, TSplitter > Class Template Reference

Run an Integral Invariant estimator in parallel. More...

#include <DGtal/geometry/surfaces/estimation/ParallelIIEstimator.h>

Public Types

using Estimator = TEstimator
using Splitter = TSplitter
using Domain = typename TEstimator::Domain
using Scalar = typename TEstimator::Scalar
using KSpace = typename TEstimator::KSpace
using PointPredicate = typename TEstimator::PointPredicate
using Surfel = typename KSpace::Surfel
using SurfelSet = typename KSpace::SurfelSet
using EstimatorQuantity = typename TEstimator::Quantity
using Quantity = EstimatorQuantity
using Boundary = LightImplicitDigitalSurface<KSpace, PointPredicate>
using Surface = DigitalSurface<Boundary>
using Visitor = DepthFirstVisitor<Surface>
using VisitorRange = GraphVisitorRange<Visitor>

Public Member Functions

template<typename... Args>
 ParallelIIEstimator (Splitter splitter, int32_t nbThread, Args &&... args)
 Constructor.
void clear ()
Scalar h () const
void attach (ConstAlias< KSpace > K, ConstAlias< PointPredicate > aPointPredicate)
void setParams (double dRadius)
bool isValid () const
template<typename ItA, typename ItB>
void init (double h_, ItA ite, ItB itb)
template<typename It>
Quantity eval (It it)
template<typename It, typename Oit>
Oit eval (It itb, It ite, Oit result)
void selfDisplay (std::ostream &out) const

Private Attributes

std::vector< Estimator > myEstimators
Splitter mySplitter
CountedConstPtrOrConstPtr< PointPredicate > myPointPredicate
CountedConstPtrOrConstPtr< KSpace > myKSpace
double myH
double myRadius

Detailed Description

template<class TEstimator, typename TSplitter>
class DGtal::ParallelIIEstimator< TEstimator, TSplitter >

Run an Integral Invariant estimator in parallel.

This class is meant as an almost perfect replacement of other IIEstimator. The only difference is the constructor, which needs both a domain splitter instance and the number of threads.

Template Parameters
TEstimatorThe model of Estimator
TSplitterThe function to split the domain

Definition at line 53 of file ParallelIIEstimator.h.

Member Typedef Documentation

◆ Boundary

template<class TEstimator, typename TSplitter>
using DGtal::ParallelIIEstimator< TEstimator, TSplitter >::Boundary = LightImplicitDigitalSurface<KSpace, PointPredicate>

Definition at line 69 of file ParallelIIEstimator.h.

◆ Domain

template<class TEstimator, typename TSplitter>
using DGtal::ParallelIIEstimator< TEstimator, TSplitter >::Domain = typename TEstimator::Domain

Definition at line 58 of file ParallelIIEstimator.h.

◆ Estimator

template<class TEstimator, typename TSplitter>
using DGtal::ParallelIIEstimator< TEstimator, TSplitter >::Estimator = TEstimator

Definition at line 56 of file ParallelIIEstimator.h.

◆ EstimatorQuantity

template<class TEstimator, typename TSplitter>
using DGtal::ParallelIIEstimator< TEstimator, TSplitter >::EstimatorQuantity = typename TEstimator::Quantity

Definition at line 65 of file ParallelIIEstimator.h.

◆ KSpace

template<class TEstimator, typename TSplitter>
using DGtal::ParallelIIEstimator< TEstimator, TSplitter >::KSpace = typename TEstimator::KSpace

Definition at line 61 of file ParallelIIEstimator.h.

◆ PointPredicate

template<class TEstimator, typename TSplitter>
using DGtal::ParallelIIEstimator< TEstimator, TSplitter >::PointPredicate = typename TEstimator::PointPredicate

Definition at line 62 of file ParallelIIEstimator.h.

◆ Quantity

template<class TEstimator, typename TSplitter>
using DGtal::ParallelIIEstimator< TEstimator, TSplitter >::Quantity = EstimatorQuantity

Definition at line 66 of file ParallelIIEstimator.h.

◆ Scalar

template<class TEstimator, typename TSplitter>
using DGtal::ParallelIIEstimator< TEstimator, TSplitter >::Scalar = typename TEstimator::Scalar

Definition at line 59 of file ParallelIIEstimator.h.

◆ Splitter

template<class TEstimator, typename TSplitter>
using DGtal::ParallelIIEstimator< TEstimator, TSplitter >::Splitter = TSplitter

Definition at line 57 of file ParallelIIEstimator.h.

◆ Surface

template<class TEstimator, typename TSplitter>
using DGtal::ParallelIIEstimator< TEstimator, TSplitter >::Surface = DigitalSurface<Boundary>

Definition at line 70 of file ParallelIIEstimator.h.

◆ Surfel

template<class TEstimator, typename TSplitter>
using DGtal::ParallelIIEstimator< TEstimator, TSplitter >::Surfel = typename KSpace::Surfel

Definition at line 63 of file ParallelIIEstimator.h.

◆ SurfelSet

template<class TEstimator, typename TSplitter>
using DGtal::ParallelIIEstimator< TEstimator, TSplitter >::SurfelSet = typename KSpace::SurfelSet

Definition at line 64 of file ParallelIIEstimator.h.

◆ Visitor

template<class TEstimator, typename TSplitter>
using DGtal::ParallelIIEstimator< TEstimator, TSplitter >::Visitor = DepthFirstVisitor<Surface>

Definition at line 71 of file ParallelIIEstimator.h.

◆ VisitorRange

template<class TEstimator, typename TSplitter>
using DGtal::ParallelIIEstimator< TEstimator, TSplitter >::VisitorRange = GraphVisitorRange<Visitor>

Definition at line 72 of file ParallelIIEstimator.h.

Constructor & Destructor Documentation

◆ ParallelIIEstimator()

template<class TEstimator, typename TSplitter>
template<typename... Args>
DGtal::ParallelIIEstimator< TEstimator, TSplitter >::ParallelIIEstimator ( Splitter splitter,
int32_t nbThread,
Args &&... args )

Constructor.

Template Parameters
ArgsThe estimator constructor arguments
Parameters
splitterThe domain splitter instance used to partition the domain.
nbThreadThe number of thread to run in parallel. -1 means as many as possible
argsConstructor arguments to underlying estimators

References splitter.

Member Function Documentation

◆ attach()

template<class TEstimator, typename TSplitter>
void DGtal::ParallelIIEstimator< TEstimator, TSplitter >::attach ( ConstAlias< KSpace > K,
ConstAlias< PointPredicate > aPointPredicate )

Attach a shape, defined as a functor spel -> boolean

Parameters
[in]Kthe cellular grid space in which the shape is defined.
aPointPredicatethe shape of interest. The alias can be secured if some counted pointer is handed.

References K.

◆ clear()

template<class TEstimator, typename TSplitter>
void DGtal::ParallelIIEstimator< TEstimator, TSplitter >::clear ( )

Clears the object. It is now invalid.

◆ eval() [1/2]

template<class TEstimator, typename TSplitter>
template<typename It>
Quantity DGtal::ParallelIIEstimator< TEstimator, TSplitter >::eval ( It it)

– Estimation –

Compute the integral invariant volume at surfel *it of a shape, then apply the VolumeFunctor to extract some geometric information.

Template Parameters
SurfelConstIteratortype of Iterator on a Surfel
Parameters
[in]ititerator pointing on the surfel of the shape where we wish to evaluate some geometric information.
Returns
quantity (normal vector) at surfel *it

◆ eval() [2/2]

template<class TEstimator, typename TSplitter>
template<typename It, typename Oit>
Oit DGtal::ParallelIIEstimator< TEstimator, TSplitter >::eval ( It itb,
It ite,
Oit result )

– Estimation –

Compute the integral invariant volume for a range of surfels [itb,ite) on a shape, then apply the VolumeFunctor to extract some geometric information. Return the result on an OutputIterator (param).

Template Parameters
OutputIteratortype of Iterator of an array of Quantity
SurfelConstIteratortype of Iterator on a Surfel
Parameters
[in]itbiterator defining the start of the range of surfels where we wish to compute some geometric information.
[in]iteiterator defining the end of the range of surfels where we wish to compute some geometric information.
[in]resultoutput iterator of results of the computation.
Returns
the updated output iterator after all outputs.

◆ h()

template<class TEstimator, typename TSplitter>
Scalar DGtal::ParallelIIEstimator< TEstimator, TSplitter >::h ( ) const
Returns
the grid step.

◆ init()

template<class TEstimator, typename TSplitter>
template<typename ItA, typename ItB>
void DGtal::ParallelIIEstimator< TEstimator, TSplitter >::init ( double h_,
ItA ite,
ItB itb )

Model of CDigitalSurfaceLocalEstimator. Initialisation.

Template Parameters
SurfelConstIteratorany model of forward readable iterator on Surfel.
Parameters
[in]h_grid size (must be >0).
[in]iteiterator on the first surfel of the surface.
[in]itbiterator after the last surfel of the surface.

◆ isValid()

template<class TEstimator, typename TSplitter>
bool DGtal::ParallelIIEstimator< TEstimator, TSplitter >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.

◆ selfDisplay()

template<class TEstimator, typename TSplitter>
void DGtal::ParallelIIEstimator< TEstimator, TSplitter >::selfDisplay ( std::ostream & out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

◆ setParams()

template<class TEstimator, typename TSplitter>
void DGtal::ParallelIIEstimator< TEstimator, TSplitter >::setParams ( double dRadius)

Set specific parameters: the radius of the ball.

Parameters
[in]dRadiusthe "digital" radius of the kernel (buy may be non integer).

Field Documentation

◆ myEstimators

template<class TEstimator, typename TSplitter>
std::vector<Estimator> DGtal::ParallelIIEstimator< TEstimator, TSplitter >::myEstimators
private

Definition at line 177 of file ParallelIIEstimator.h.

◆ myH

template<class TEstimator, typename TSplitter>
double DGtal::ParallelIIEstimator< TEstimator, TSplitter >::myH
private

Definition at line 183 of file ParallelIIEstimator.h.

◆ myKSpace

template<class TEstimator, typename TSplitter>
CountedConstPtrOrConstPtr<KSpace> DGtal::ParallelIIEstimator< TEstimator, TSplitter >::myKSpace
private

Definition at line 181 of file ParallelIIEstimator.h.

◆ myPointPredicate

template<class TEstimator, typename TSplitter>
CountedConstPtrOrConstPtr<PointPredicate> DGtal::ParallelIIEstimator< TEstimator, TSplitter >::myPointPredicate
private

Definition at line 180 of file ParallelIIEstimator.h.

◆ myRadius

template<class TEstimator, typename TSplitter>
double DGtal::ParallelIIEstimator< TEstimator, TSplitter >::myRadius
private

Definition at line 184 of file ParallelIIEstimator.h.

◆ mySplitter

template<class TEstimator, typename TSplitter>
Splitter DGtal::ParallelIIEstimator< TEstimator, TSplitter >::mySplitter
private

Definition at line 178 of file ParallelIIEstimator.h.


The documentation for this class was generated from the following file: