DGtal  0.9.3beta
Public Member Functions | Data Fields
DGtal::detail::LabelledMapMemFunctor Struct Reference

#include <DGtal/base/LabelledMap.h>

Public Member Functions

 LabelledMapMemFunctor (double p, double q, unsigned int sL, unsigned int sV, unsigned int sP, unsigned int sA)
 
double fctNM (unsigned int N, unsigned int M) const
 
double fctNMpq (unsigned int N, unsigned int M, double p, double q) const
 

Data Fields

double _p
 
double _q
 
unsigned int _sL
 
unsigned int _sV
 
unsigned int _sP
 
unsigned int _sA
 

Detailed Description

Functor used to compute the best parameters for minimizing the memory usage of a LabelledMap structure.

Definition at line 1268 of file LabelledMap.h.

Constructor & Destructor Documentation

DGtal::detail::LabelledMapMemFunctor::LabelledMapMemFunctor ( double  p,
double  q,
unsigned int  sL,
unsigned int  sV,
unsigned int  sP,
unsigned int  sA 
)
inline

Member Function Documentation

double DGtal::detail::LabelledMapMemFunctor::fctNM ( unsigned int  N,
unsigned int  M 
) const
inline

Definition at line 1282 of file LabelledMap.h.

References _sP.

1283  {
1284  double alpha0 = _sL + _sV * ( N+1 );
1285  double beta0 = _sV * M + _sA + _sP;
1286  return alpha0
1287  + beta0 * _q * pow(1.0 - _p, (double)N+1)
1288  * ( 1.0 + pow(1.0 - _p, (double)M-1 )
1289  / ( 1.0 - pow(1.0 - _p, (double)M ) ) );
1290  }
double DGtal::detail::LabelledMapMemFunctor::fctNMpq ( unsigned int  N,
unsigned int  M,
double  p,
double  q 
) const
inline

Definition at line 1292 of file LabelledMap.h.

References _sP.

1293  {
1294  double alpha0 = _sL + _sV * ( N+1 );
1295  double beta0 = _sV * M + _sA + _sP;
1296  return alpha0
1297  + beta0 * q * pow(1.0 - p, (double)N+1)
1298  * ( 1.0 + pow(1.0 - p, (double)M-1 )
1299  / ( 1.0 - pow(1.0 - p, (double)M ) ) );
1300  }

Field Documentation

double DGtal::detail::LabelledMapMemFunctor::_p

Definition at line 1270 of file LabelledMap.h.

double DGtal::detail::LabelledMapMemFunctor::_q

Definition at line 1270 of file LabelledMap.h.

unsigned int DGtal::detail::LabelledMapMemFunctor::_sA

Definition at line 1274 of file LabelledMap.h.

unsigned int DGtal::detail::LabelledMapMemFunctor::_sL

Definition at line 1271 of file LabelledMap.h.

unsigned int DGtal::detail::LabelledMapMemFunctor::_sP

Definition at line 1273 of file LabelledMap.h.

Referenced by fctNM(), and fctNMpq().

unsigned int DGtal::detail::LabelledMapMemFunctor::_sV

Definition at line 1272 of file LabelledMap.h.


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