DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Data Fields
DGtal::detail::LabelledMapMemFunctor Struct Reference

#include <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 1267 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

Definition at line 1274 of file LabelledMap.h.

: _p( p ), _q( q ), _sL( sL ), _sV( sV ), _sP( sP ), _sA( sA )
{}

Member Function Documentation

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

Definition at line 1281 of file LabelledMap.h.

References _p, _q, _sA, _sL, _sP, and _sV.

Referenced by DGtal::detail::argminLabelledMapMemoryUsageForGeometricDistribution().

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

Definition at line 1291 of file LabelledMap.h.

References _sA, _sL, _sP, and _sV.

{
double alpha0 = _sL + _sV * ( N+1 );
double beta0 = _sV * M + _sA + _sP;
return alpha0
+ beta0 * q * pow(1.0 - p, (double)N+1)
* ( 1.0 + pow(1.0 - p, (double)M-1 )
/ ( 1.0 - pow(1.0 - p, (double)M ) ) );
}

Field Documentation

double DGtal::detail::LabelledMapMemFunctor::_p

Definition at line 1269 of file LabelledMap.h.

Referenced by fctNM().

double DGtal::detail::LabelledMapMemFunctor::_q

Definition at line 1269 of file LabelledMap.h.

Referenced by fctNM().

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

Definition at line 1273 of file LabelledMap.h.

Referenced by fctNM(), and fctNMpq().

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

Definition at line 1270 of file LabelledMap.h.

Referenced by fctNM(), and fctNMpq().

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

Definition at line 1272 of file LabelledMap.h.

Referenced by fctNM(), and fctNMpq().

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

Definition at line 1271 of file LabelledMap.h.

Referenced by fctNM(), and fctNMpq().


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