Loading [MathJax]/extensions/MathMenu.js
DGtal 2.0.0
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

◆ LabelledMapMemFunctor()

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

Definition at line 1275 of file LabelledMap.h.

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

Member Function Documentation

◆ fctNM()

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

Definition at line 1282 of file LabelledMap.h.

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 }

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

◆ fctNMpq()

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.

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 }

References _sA, _sL, _sP, and _sV.

Field Documentation

◆ _p

double DGtal::detail::LabelledMapMemFunctor::_p

Definition at line 1270 of file LabelledMap.h.

Referenced by fctNM(), and LabelledMapMemFunctor().

◆ _q

double DGtal::detail::LabelledMapMemFunctor::_q

Definition at line 1270 of file LabelledMap.h.

Referenced by fctNM(), and LabelledMapMemFunctor().

◆ _sA

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

Definition at line 1274 of file LabelledMap.h.

Referenced by fctNM(), fctNMpq(), and LabelledMapMemFunctor().

◆ _sL

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

Definition at line 1271 of file LabelledMap.h.

Referenced by fctNM(), fctNMpq(), and LabelledMapMemFunctor().

◆ _sP

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

Definition at line 1273 of file LabelledMap.h.

Referenced by fctNM(), fctNMpq(), and LabelledMapMemFunctor().

◆ _sV

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

Definition at line 1272 of file LabelledMap.h.

Referenced by fctNM(), fctNMpq(), and LabelledMapMemFunctor().


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