gKitGL
 All Classes Namespaces Functions Variables Typedefs Enumerator Friends
Public Member Functions
gk::Cdf Class Reference

construction d'une fonction de repartition et choix aleatoire d'un element en fonction de la fonction de repartition. More...

#include <Cdf.h>

List of all members.

Public Member Functions

 Cdf (const int reserve=0)
 constructeur, indique le nombre d'elements (optionnel).
void insert (const float v)
 insere un element dans la fonction de repartition.
float sampleSlow (int &id) const
 choisit un element, renvoie son indice et la probabilite de l'avoir choisi.
float sample (const float u, int &id) const
 choisit un element, renvoie son indice et la probabilite de l'avoir choisi.
float sample (Sampler &sampler, int &id) const
float pdf (const int id) const
 renvoie la probabilite d'avoir selectionne un element.
float sampleUniform (Sampler &sampler, int &id) const
 choisit un element uniformement, renvoie son indice et la probabilite de l'avoir choisi.
float pdfUniform (const int id) const
 renvoie la probabilite d'avoir selection un element.
float total () const
 renvoie le total de la fonction de repartition.

Detailed Description

construction d'une fonction de repartition et choix aleatoire d'un element en fonction de la fonction de repartition.


Member Function Documentation

float gk::Cdf::sampleSlow ( int &  id) const [inline]

choisit un element, renvoie son indice et la probabilite de l'avoir choisi.

utilise une recherche lineaire.

float gk::Cdf::sample ( const float  u,
int &  id 
) const [inline]

choisit un element, renvoie son indice et la probabilite de l'avoir choisi.

utilise une recherche dichotomique dans l'ensemble de valeurs strictement croissant.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerator Friends