Patate Lib  0.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Grenaille::DistWeightFunc< DataPoint, WeightKernel > Class Template Reference

Inherits Grenaille::Concept::WeightFuncConcept< Point >.

Detailed Description

template<class DataPoint, class WeightKernel>
class Grenaille::DistWeightFunc< DataPoint, WeightKernel >

Weighting function based on the euclidean distance between a query and a reference position.

The query is assumed to be expressed in centered coordinates (ie. relatively to the evaluation position).

This class inherits BaseWeightFunc. It can be specialized for any DataPoint, and uses a generic 1D BaseWeightKernel.

Warning
it assumes that the evaluation scale t is strictly positive

Public Types

typedef DataPoint::Scalar Scalar
 Scalar type from DataPoint.
 
typedef DataPoint::VectorType VectorType
 Vector type from DataPoint.
 
- Public Types inherited from Grenaille::Concept::WeightFuncConcept< Point >
typedef DataPoint::Scalar Scalar
 
typedef DataPoint::VectorType VectorType
 

Public Member Functions

 DistWeightFunc (const Scalar &_t=Scalar(1.))
 Constructor that defines the current evaluation scale. More...
 
Scalar w (const VectorType &_q, const DataPoint &) const
 Compute the weight of the given query with respect to its coordinates. More...
 
VectorType spacedw (const VectorType &_q, const DataPoint &) const
 First order derivative in space (for each spatial dimension \(\mathsf{x})\). More...
 
Scalar scaledw (const VectorType &_q, const DataPoint &) const
 First order derivative in scale \(t\). More...
 
Scalar evalScale () const
 Access to the evaluation scale set during the initialization.
 
- Public Member Functions inherited from Grenaille::Concept::WeightFuncConcept< Point >
Scalar w (const VectorType &relativeQuery, const DataPoint &attributes) const
 Apply the weight function to a query.
 
VectorType spacedw (const VectorType &relativeQuery, const DataPoint &attributes) const
 Apply the weight function differenciated in space to a query.
 
Scalar scaledw (const VectorType &relativeQuery, const DataPoint &attributes) const
 Apply the weight function differenciated in scale to a query.
 
Scalar evalScale () const
 Read access to the evaluation scale.
 

Protected Attributes

Scalar m_t
 Evaluation scale.
 
WeightKernel m_wk
 1D function applied to weight queries
 

Constructor & Destructor Documentation

template<class DataPoint , class WeightKernel >
Grenaille::DistWeightFunc< DataPoint, WeightKernel >::DistWeightFunc ( const Scalar _t = Scalar(1.))
inline

Constructor that defines the current evaluation scale.

Warning
t > 0

Member Function Documentation

template<class DataPoint , class WeightKernel >
DistWeightFunc< DataPoint, WeightKernel >::Scalar DistWeightFunc::scaledw ( const VectorType _q,
const DataPoint &   
) const
inline

First order derivative in scale \(t\).

\( \frac{\delta \frac{\left|\mathbf{q}\right|}{t}}{\delta t} \nabla w(\frac{\left|\mathbf{q}\right|}{t}) = - \frac{\left|\mathbf{q}\right|}{t^2} \nabla{w(\frac{\left|\mathbf{q}\right|}{t})} \)

where \( \left|\mathbf{q}\right| \) represents the norm of the query coordinates expressed in centered basis.

template<class DataPoint , class WeightKernel >
DistWeightFunc< DataPoint, WeightKernel >::VectorType DistWeightFunc::spacedw ( const VectorType _q,
const DataPoint &   
) const
inline

First order derivative in space (for each spatial dimension \(\mathsf{x})\).

\( \frac{\delta \frac{\left|\mathbf{q}_\mathsf{x}\right|}{t}}{\delta \mathsf{x}} \nabla w(\frac{\left|\mathbf{q}_\mathsf{x}\right|}{t}) = \frac{ \nabla{w(\frac{\left|\mathbf{q}_\mathsf{x}\right|}{t})}}{t} \)

where \( \left|\mathbf{q}_\mathsf{x}\right| \) represents the norm of the query coordinates expressed in centered basis, for each spatial dimensions \( \mathsf{x}\).

template<class DataPoint , class WeightKernel >
DistWeightFunc< DataPoint, WeightKernel >::Scalar DistWeightFunc::w ( const VectorType _q,
const DataPoint &   
) const
inline

Compute the weight of the given query with respect to its coordinates.

As the query \(\mathbf{q}\) is expressed in a centered basis, the WeightKernel is directly applied to the norm of its coordinates with respect to the current scale \( t \) :

\( w(\frac{\left|\mathbf{q}_\mathsf{x}\right|}{t}) \)