Fixed erroneous first return of Normal Variable
authorDuy Nguyen <duy@soe.ucsc.edu>
Mon Aug 24 18:31:59 2009 -0700 (5 months ago)
changeset 4736fef6ccee5897
parent 4735 f011cf863e07
child 4737 5e4fb3918879
Fixed erroneous first return of Normal Variable
src/core/random-variable.cc
     1.1 --- a/src/core/random-variable.cc	Mon Aug 24 13:35:41 2009 +0200
     1.2 +++ b/src/core/random-variable.cc	Mon Aug 24 18:31:59 2009 -0700
     1.3 @@ -778,23 +778,19 @@
     1.4    double m_bound;     // Bound on value's difference from the mean (absolute value)
     1.5    bool   m_nextValid; // True if next valid
     1.6    double m_next;      // The algorithm produces two values at a time
     1.7 -  static bool   m_static_nextValid;
     1.8 -  static double m_static_next;
     1.9  };
    1.10  
    1.11 -bool         NormalVariableImpl::m_static_nextValid = false;
    1.12 -double       NormalVariableImpl::m_static_next;
    1.13  const double NormalVariableImpl::INFINITE_VALUE = 1e307;
    1.14  
    1.15  NormalVariableImpl::NormalVariableImpl() 
    1.16    : m_mean(0.0), m_variance(1.0), m_bound(INFINITE_VALUE), m_nextValid(false){}
    1.17  
    1.18 -NormalVariableImpl::NormalVariableImpl(double m, double v, double b/*=INFINITE_VALUE*/)
    1.19 +NormalVariableImpl::NormalVariableImpl(double m, double v, double b)
    1.20    : m_mean(m), m_variance(v), m_bound(b), m_nextValid(false) { }
    1.21  
    1.22  NormalVariableImpl::NormalVariableImpl(const NormalVariableImpl& c)
    1.23    : RandomVariableBase(c), m_mean(c.m_mean), m_variance(c.m_variance),
    1.24 -    m_bound(c.m_bound) { }
    1.25 +    m_bound(c.m_bound), m_nextValid(false) { }
    1.26  
    1.27  double NormalVariableImpl::GetValue()
    1.28  {