Changeset 644
- Timestamp:
- 09/29/09 15:34:50 (15 years ago)
- Location:
- library/bdm
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/estim/particles.cpp
r638 r644 23 23 //renormalize 24 24 double sw=sum(_w); 25 if (! isfinite(sw)) {25 if (!std::_finite(sw)) { 26 26 for (int i=0;i<n;i++){ 27 if (! isfinite(_w(i))) {_w(i)=0;}27 if (!std::_finite(_w(i))) {_w(i)=0;} 28 28 } 29 29 sw = sum(_w); 30 if (! isfinite(sw)) {30 if (!std::_finite(sw)) { 31 31 bdm_error("Particle filter is lost; no particle is good enough."); 32 32 } -
library/bdm/stat/exp_family.h
r637 r644 302 302 for (int i=0; i<beta.length(); i++){ 303 303 GamRNG.setup(beta(i),1); 304 y(i)=GamRNG.sample(); 304 #pragma omp critical 305 y(i)=GamRNG(); 305 306 } 306 307 return y/sum(y);