DGtal  0.9.3beta
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

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

Definition at line 57 of file ScalarFunctors.h.

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

Definition at line 56 of file ScalarFunctors.h.

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

Definition at line 58 of file ScalarFunctors.h.

Constructor & Destructor Documentation

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

Definition at line 65 of file ScalarFunctors.h.

Member Function Documentation

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  }

Field Documentation

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

Definition at line 62 of file ScalarFunctors.h.

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

Definition at line 60 of file ScalarFunctors.h.

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

Definition at line 61 of file ScalarFunctors.h.


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