Changeset 129

Show
Ignore:
Timestamp:
06/25/08 17:14:36 (17 years ago)
Author:
smidl
Message:

preklad na aligatoru

Files:
6 modified

Legend:

Unmodified
Added
Removed
  • CMakeLists.txt

    r125 r129  
    2929FIND_PACKAGE(ITPP REQUIRED) 
    3030FIND_PACKAGE(ACML COMPONENTS) 
    31 FIND_PACKAGE(XSD REQUIRED) 
    32 FIND_PACKAGE(XERCES REQUIRED) 
     31# FIND_PACKAGE(XSD REQUIRED) 
     32# FIND_PACKAGE(XERCES REQUIRED) 
    3333 
    3434IF(ITPP_FOUND) 
     
    5151ENDIF(XERCES_FOUND) 
    5252 
     53# Local ettings should be written to file called CMakeLists.local 
     54# Use this option for machine-specific options, such as prallel architectures 
     55INCLUDE(CMakeLists.local OPTIONAL)       
    5356 
    5457# Recurse into the "dbm" and "tests" subdirectories.  This does not actually 
  • bdm/CMakeLists.txt

    r112 r129  
    44SET(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) 
    55SET(BdmEstim estim/libKF.cpp estim/libKF.h estim/libPF.cpp estim/libPF.h estim/arx.cpp estim/arx.h) 
     6SET(BdmUI userinfo.cpp userinfo.h) 
    67 
     8add_library (bdm itpp_ext.cpp  osutils.cpp osutils.h ${BdmMath} ${BdmStat} ${BdmEstim}) 
    79 
    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  
    147147        double WL = 0.0; 
    148148 
    149 cout << est.mean(); 
    150  
    151         for ( i=0;i<n;i++ ) { 
     149        #pragma omp parallel for 
     150        for ( i=0;i<n;i++ ) {    
    152151                //generate new samples from paramater evolution model; 
    153152                _samples ( i ) = par.samplecond ( _samples ( i ), llsP ( i ) ); 
     
    155154                Bms[i]->bayes ( dt ); 
    156155                lls ( i ) = Bms[i]->_ll(); // lls above is also in proposal her must be lls(i) =, not +=!! 
    157  
    158156                if ( lls ( i ) >mlls ) mlls=lls ( i ); //find maximum likelihood (for numerical stability) 
    159157        } 
    160158 
    161 cout << min(lls) << "'" << max(lls)<<endl; 
    162  
    163159        if ( false) { 
     160                #pragma omp parallel for reduction(+:sumLWL,sumL2WL) private(WL) 
    164161                for ( i=0;i<n;i++ ) { 
    165162                        WL = _w ( i ) *exp ( llsP ( i ) ); //using old weights! 
     
    172169        double sum_w=0.0; 
    173170        // compute weights 
     171        #pragma omp parallel for 
    174172        for ( i=0;i<n;i++ ) { 
    175173                _w ( i ) *= exp ( lls ( i ) - mlls ); // multiply w by likelihood 
     
    189187                // Resample Bms! 
    190188 
     189                #pragma omp parallel for 
    191190                for ( i=0;i<n;i++ ) { 
    192191                        if ( ind ( i ) !=i ) {//replace the current Bm by a new one 
     
    203202                }; 
    204203                cout << '.'; 
    205 cout << est.mean() << endl;              
    206204        } 
    207205} 
  • bdm/stat/libEF.cpp

    r102 r129  
    5959        for ( i=0; i<rv.count(); i++ ) { 
    6060                GamRNG.setup ( alpha ( i ),beta ( i ) ); 
     61                #pragma omp critical 
    6162                smp ( i ) = GamRNG(); 
    6263        } 
  • bdm/stat/libEF.h

    r124 r129  
    205205        double evalpdflog ( const vec &val ) const  {return lnk;} 
    206206        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 ); 
    208210                return low+elem_mult(distance,smp); 
    209211        } 
  • tests/CMakeLists.txt

    r125 r129  
    3131 
    3232add_executable (blas_test blas_test.cpp) 
    33 target_link_libraries (blas_test ${BdmLibs}) 
     33target_link_libraries (blas_test itpp) 
    3434 
    3535add_executable (test0 test0.cpp)