Show
Ignore:
Timestamp:
08/08/09 13:43:13 (15 years ago)
Author:
smidl
Message:

changes in mpdf -> compile OK, broken tests!

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/bdm/stat/emix.cpp

    r477 r488  
    199199        return aprgiw; 
    200200}; 
     201 
     202vec mmix::samplecond(const vec &cond) { 
     203        //Sample which component 
     204        vec cumDist = cumsum ( w ); 
     205        double u0; 
     206#pragma omp critical 
     207        u0 = UniRNG.sample(); 
     208 
     209        int i = 0; 
     210        while ( ( cumDist ( i ) < u0 ) && ( i < ( w.length() - 1 ) ) ) { 
     211                i++; 
     212        } 
     213 
     214        return Coms ( i )->samplecond(cond); 
     215} 
    201216 
    202217}