DGtal  1.3.beta
Public Types | Public Member Functions | Data Fields
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.

66  : myV0( v0 ), myV0OverR( v0 / r ), myR( r ) {}

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:
DGtal::functors::HatFunction::myV0
Scalar myV0
Definition: ScalarFunctors.h:60
DGtal::functors::HatFunction::myR
Scalar myR
Definition: ScalarFunctors.h:62
DGtal::functors::HatFunction::myV0OverR
Scalar myV0OverR
Definition: ScalarFunctors.h:61