20 #include "../wrappers/rng/rng.h" 30 : Pdf<ColumnVector> ( center.rows() )
31 , _samples(DimensionGet())
34 assert (center.rows() == width.rows());
35 _Lower = center - width/2.0;
36 _Higher = center + width/2.0;
38 for (
int i=1 ; i < width.rows()+1 ; i++ )
40 _Height = _Height / width(i);
44 Uniform::Uniform (
int dimension)
45 :
Pdf<ColumnVector>(dimension)
48 _Lower.resize(dimension);
57 <<
"\nWidth: \n" << u.
WidthGet() << endl;
70 for (
int i=1; i<input.rows()+1; i++)
72 if ( ( input(i)>
_Higher(i) ) || ( input(i) <
_Lower(i) ) )
return 0;
81 list_samples.resize(num_samples);
82 vector<Sample<ColumnVector> >::iterator rit = list_samples.begin();
87 while (rit != list_samples.end())
131 assert(center.rows() == width.rows());
132 _Lower = center - width/2.0;
135 for (
int i=1 ; i < width.rows()+1 ; i++ )
Class PDF: Virtual Base class representing Probability Density Functions.
void ValueSet(const T &value)
Set the value of the Sample.
unsigned int DimensionGet() const
Get the dimension of the argument.
Class representing a probability (a double between 0 and 1)
virtual void DimensionSet(unsigned int dim)
Set the dimension of the argument.