Changeset 197 for bdm/estim/mixef.cpp

Show
Ignore:
Timestamp:
11/04/08 14:54:33 (16 years ago)
Author:
smidl
Message:

opravy v bdm

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • bdm/estim/mixef.cpp

    r195 r197  
    3131                int ind=floor(ndat*UniRNG.sample()); 
    3232                Coms ( i )->bayes ( Data.get_col ( ind ),1.0 ); 
     33                //flatten back to oringinal 
     34                Coms(i)->flatten(Com0); 
    3335        } 
    3436 
     
    139141        return tmp; 
    140142} 
     143 
     144void MixEF::flatten(const BMEF* M2){ 
     145        const MixEF* Mix2=dynamic_cast<const MixEF*>(M2); 
     146        it_assert_debug(Mix2->n==n,"Different no of coms"); 
     147        //Flatten each component 
     148        for (int i=0; i<n;i++){ 
     149                Coms(i)->flatten(Mix2->Coms(i)); 
     150        } 
     151        //Faltten weights 
     152        weights.flatten(&(Mix2->weights)); 
     153}