Changeset 129
- Timestamp:
- 06/25/08 17:14:36 (17 years ago)
- Files:
-
- 6 modified
Legend:
- Unmodified
- Added
- Removed
-
CMakeLists.txt
r125 r129 29 29 FIND_PACKAGE(ITPP REQUIRED) 30 30 FIND_PACKAGE(ACML COMPONENTS) 31 FIND_PACKAGE(XSD REQUIRED)32 FIND_PACKAGE(XERCES REQUIRED)31 # FIND_PACKAGE(XSD REQUIRED) 32 # FIND_PACKAGE(XERCES REQUIRED) 33 33 34 34 IF(ITPP_FOUND) … … 51 51 ENDIF(XERCES_FOUND) 52 52 53 # Local ettings should be written to file called CMakeLists.local 54 # Use this option for machine-specific options, such as prallel architectures 55 INCLUDE(CMakeLists.local OPTIONAL) 53 56 54 57 # Recurse into the "dbm" and "tests" subdirectories. This does not actually -
bdm/CMakeLists.txt
r112 r129 4 4 SET(BdmStat stat/libDS.cpp stat/libDS.h stat/libFN.cpp stat/libFN.h stat/libBM.cpp stat/libBM.h stat/libEF.cpp stat/libEF.h stat/loggers.cpp stat/loggers.h stat/emix.cpp stat/emix.h) 5 5 SET(BdmEstim estim/libKF.cpp estim/libKF.h estim/libPF.cpp estim/libPF.h estim/arx.cpp estim/arx.h) 6 SET(BdmUI userinfo.cpp userinfo.h) 6 7 8 add_library (bdm itpp_ext.cpp osutils.cpp osutils.h ${BdmMath} ${BdmStat} ${BdmEstim}) 7 9 8 add_library (bdm itpp_ext.cpp userinfo.cpp userinfo.h osutils.cpp osutils.h ${BdmMath} ${BdmStat} ${BdmEstim})9 -
bdm/estim/libPF.h
r125 r129 147 147 double WL = 0.0; 148 148 149 cout << est.mean(); 150 151 for ( i=0;i<n;i++ ) { 149 #pragma omp parallel for 150 for ( i=0;i<n;i++ ) { 152 151 //generate new samples from paramater evolution model; 153 152 _samples ( i ) = par.samplecond ( _samples ( i ), llsP ( i ) ); … … 155 154 Bms[i]->bayes ( dt ); 156 155 lls ( i ) = Bms[i]->_ll(); // lls above is also in proposal her must be lls(i) =, not +=!! 157 158 156 if ( lls ( i ) >mlls ) mlls=lls ( i ); //find maximum likelihood (for numerical stability) 159 157 } 160 158 161 cout << min(lls) << "'" << max(lls)<<endl;162 163 159 if ( false) { 160 #pragma omp parallel for reduction(+:sumLWL,sumL2WL) private(WL) 164 161 for ( i=0;i<n;i++ ) { 165 162 WL = _w ( i ) *exp ( llsP ( i ) ); //using old weights! … … 172 169 double sum_w=0.0; 173 170 // compute weights 171 #pragma omp parallel for 174 172 for ( i=0;i<n;i++ ) { 175 173 _w ( i ) *= exp ( lls ( i ) - mlls ); // multiply w by likelihood … … 189 187 // Resample Bms! 190 188 189 #pragma omp parallel for 191 190 for ( i=0;i<n;i++ ) { 192 191 if ( ind ( i ) !=i ) {//replace the current Bm by a new one … … 203 202 }; 204 203 cout << '.'; 205 cout << est.mean() << endl;206 204 } 207 205 } -
bdm/stat/libEF.cpp
r102 r129 59 59 for ( i=0; i<rv.count(); i++ ) { 60 60 GamRNG.setup ( alpha ( i ),beta ( i ) ); 61 #pragma omp critical 61 62 smp ( i ) = GamRNG(); 62 63 } -
bdm/stat/libEF.h
r124 r129 205 205 double evalpdflog ( const vec &val ) const {return lnk;} 206 206 vec sample() const { 207 vec smp ( rv.count() ); UniRNG.sample_vector ( rv.count(),smp ); 207 vec smp ( rv.count() ); 208 #pragma omp critical 209 UniRNG.sample_vector ( rv.count(),smp ); 208 210 return low+elem_mult(distance,smp); 209 211 } -
tests/CMakeLists.txt
r125 r129 31 31 32 32 add_executable (blas_test blas_test.cpp) 33 target_link_libraries (blas_test ${BdmLibs})33 target_link_libraries (blas_test itpp) 34 34 35 35 add_executable (test0 test0.cpp)