void DblMatrix::WriteRandom(double Min, double Max, bool Int) { for(int j=0; j<GetHeight(); j++) for(int i=0; i<GetWidth(); i++) { if(Int) (*this)[j][i] = (double)RandInt((int)Min, (int)Max); else (*this)[j][i] = RandDbl(Min, Max); } }
void DblVector::WriteRandom(double Min, double Max, unsigned int Size, bool Int) { if(Size>0) { clear(); assign(Size, 0.0); } for(unsigned int i=0; i<size(); i++) { if(Int==true) (*this)[i] = (double)RandInt((int)Min, (int)Max); else (*this)[i] = RandDbl(Min, Max); } }
inline double Noise::Uniform(const double &low, const double &high) { return(RandDbl() * (high - low)) + low; }
inline bool Bernoulli(const float &rate) { return ((rate > veryCloseToOne) || (RandDbl() < rate)); }