Changeset 580

Show
Ignore:
Timestamp:
08/22/09 15:36:24 (15 years ago)
Author:
smidl
Message:

randun test - fails because of wierd behavior of mod on line 388 of itpp_ext.cpp
mod gives different results in assignment and when called from gdb

Location:
library
Files:
1 added
2 modified

Legend:

Unmodified
Added
Removed
  • library/bdm/itpp_ext.cpp

    r579 r580  
    378378 
    379379class RandunStorage{ 
    380         const double A; 
    381         const double M; 
     380        const int A; 
     381        const int M; 
    382382        static double seed; 
    383383        static int counter; 
     
    385385                RandunStorage(): A(16807), M(2147483647) {}; 
    386386                void set_seed(double seed0){seed=seed0;} 
    387                 double get(){seed=mod(A*seed,M); counter++; return seed/M;} 
     387                double get(){ 
     388                        int tmp=mod(A*seed,M);  
     389                        seed =tmp; 
     390                        counter++;  
     391                        return seed/M;} 
    388392}; 
    389393static RandunStorage randun_global_storage; 
  • library/tests/CMakeLists.txt

    r563 r580  
    4040# using UnitTest++ 
    4141add_executable(testsuite datalink_test.cpp egiw_test.cpp emix_test.cpp epdf_test.cpp logger_test.cpp merger_test.cpp  
    42         mpdf_test.cpp rectangular_support_test.cpp rv_test.cpp shared_ptr_test.cpp square_mat_test.cpp testsuite.cpp user_info_test.cpp) 
     42        mpdf_test.cpp randun_test.cpp rectangular_support_test.cpp rv_test.cpp shared_ptr_test.cpp square_mat_test.cpp testsuite.cpp user_info_test.cpp) 
    4343target_link_libraries(testsuite testutil unittest) 
    4444LINK_EXEC(testsuite)