Marmote Core
The project aims at realizing the prototype of a software environment dedicated to modeling with Markov chains.
Public Member Functions | List of all members
psiSampler Class Reference

Abstraction for algorithms that produce samples of some unspecified distribution. More...

#include <psiSampler.h>

Inheritance diagram for psiSampler:
algorithmicSampler

Public Member Functions

 psiSampler (markovChain *model)
 constructor from a markovChain object More...
 
 ~psiSampler ()
 standard destructor More...
 
virtual double sample ()
 drawing a (pseudo)random value according to the distribution. More...
 
virtual void iidSample (int n, double *sample)
 drawing an i.i.d. sample from the distribution. The result is returned in an array (that must have been already allocated) passed as a parameter. The Distribution class offers the default implementation with repeated call to sample(). More...
 
void iidSample (int n, double *sample, int *cost)
 Version of iidSample with a cost function. More...
 

Detailed Description

Abstraction for algorithms that produce samples of some unspecified distribution.

Constructor & Destructor Documentation

psiSampler::psiSampler ( markovChain model)

constructor from a markovChain object

Parameters
modelthe Markov Chain
psiSampler::~psiSampler ( )

standard destructor

Member Function Documentation

void psiSampler::iidSample ( int  n,
double *  sample 
)
virtual

drawing an i.i.d. sample from the distribution. The result is returned in an array (that must have been already allocated) passed as a parameter. The Distribution class offers the default implementation with repeated call to sample().

Parameters
nthe number of values to sample
samplean array to be filled with the sample

Implements algorithmicSampler.

void psiSampler::iidSample ( int  n,
double *  sample,
int *  cost 
)

Version of iidSample with a cost function.

Parameters
nsize of the sample
samplearray where to store the sample
costarray containing the cost function
double psiSampler::sample ( )
virtual

drawing a (pseudo)random value according to the distribution.

Returns
a sample

Implements algorithmicSampler.


The documentation for this class was generated from the following files: