DGtal  1.5.beta
DGtal::functors::HatFunction< TScalar > Struct Template Reference

#include <DGtal/math/ScalarFunctors.h>

Public Types

typedef TScalar Scalar
 
typedef Scalar argument_type
 
typedef Scalar value_type
 

Public Member Functions

 HatFunction (Scalar v0, Scalar r)
 
Scalar operator() (Scalar d) const
 

Data Fields

Scalar myV0
 
Scalar myV0OverR
 
Scalar myR
 

Detailed Description

template<typename TScalar>
struct DGtal::functors::HatFunction< TScalar >

The hat function of value v0 at 0 with a linear decrease to 0 at value r. A function Scalar -> Scalar.

Definition at line 55 of file ScalarFunctors.h.

Member Typedef Documentation

◆ argument_type

template<typename TScalar >
typedef Scalar DGtal::functors::HatFunction< TScalar >::argument_type

Definition at line 57 of file ScalarFunctors.h.

◆ Scalar

template<typename TScalar >
typedef TScalar DGtal::functors::HatFunction< TScalar >::Scalar

Definition at line 56 of file ScalarFunctors.h.

◆ value_type

template<typename TScalar >
typedef Scalar DGtal::functors::HatFunction< TScalar >::value_type

Definition at line 58 of file ScalarFunctors.h.

Constructor & Destructor Documentation

◆ HatFunction()

template<typename TScalar >
DGtal::functors::HatFunction< TScalar >::HatFunction ( Scalar  v0,
Scalar  r 
)
inline

Definition at line 65 of file ScalarFunctors.h.

Member Function Documentation

◆ operator()()

template<typename TScalar >
Scalar DGtal::functors::HatFunction< TScalar >::operator() ( Scalar  d) const
inline

Definition at line 67 of file ScalarFunctors.h.

68  { // d >= 0
69  ASSERT( d >= 0.0 );
70  if ( d >= myR ) return 0.0;
71  return myV0 - myV0OverR * d;
72  }

References DGtal::functors::HatFunction< TScalar >::myR, DGtal::functors::HatFunction< TScalar >::myV0, and DGtal::functors::HatFunction< TScalar >::myV0OverR.

Field Documentation

◆ myR

template<typename TScalar >
Scalar DGtal::functors::HatFunction< TScalar >::myR

◆ myV0

template<typename TScalar >
Scalar DGtal::functors::HatFunction< TScalar >::myV0

◆ myV0OverR

template<typename TScalar >
Scalar DGtal::functors::HatFunction< TScalar >::myV0OverR

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