75 for(
uint i=0; i<_dim; ++i )
122 tmp.Noise::operator=( *this );
143 srand( (
unsigned int)time(0) );
206 double uniformRandomNumber1, uniformRandomNumber2;
208 while ( norm >= 1.0 )
212 norm = uniformRandomNumber1*uniformRandomNumber1 + uniformRandomNumber2*uniformRandomNumber2;
215 double gaussianRandomNumber1 =
sqrt( -2.0 *
log(norm)/norm ) * uniformRandomNumber1;
216 double gaussianRandomNumber2 =
sqrt( -2.0 *
log(norm)/norm ) * uniformRandomNumber2;
218 return _mean +
sqrt( _variance ) * (gaussianRandomNumber1+gaussianRandomNumber2)/2.0;
IntermediateState sqrt(const Expression &arg)
void init(unsigned _dim=0)
Provides a time grid consisting of vector-valued optimization variables at each grid point...
Allows to pass back messages to the calling function.
Base class for generating pseudo-random noise for simulating the Process.
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
returnValue setStatus(BlockStatus _status)
#define CLOSE_NAMESPACE_ACADO
double getUniformRandomNumber(double _lowerLimit, double _upperLimit) const
BlockStatus getStatus() const
virtual returnValue step(DVector &_w)
void rhs(const real_t *x, real_t *f)
Generates pseudo-random Gaussian noise for simulating the Process.
GenericVector< double > DVector
Noise & operator=(const Noise &rhs)
uint getNumPoints() const
DVector getVector(uint pointIdx) const
GaussianNoise & operator=(const GaussianNoise &rhs)
virtual returnValue init(uint seed=0)
virtual GaussianNoise * clone() const
#define BEGIN_NAMESPACE_ACADO
uint getNumValues() const
double getGaussianRandomNumber(double _mean, double _variance) const
#define ACADOERROR(retval)
IntermediateState log(const Expression &arg)