Revision 493, 1.0 kB
(checked in by vbarta, 15 years ago)
|
fixed UIREGISTER
|
Rev | Line | |
---|
[447] | 1 | /*! |
---|
| 2 | \file |
---|
| 3 | \brief Support for testing descendants of mpdf. |
---|
| 4 | \author Vaclav Barta. |
---|
| 5 | |
---|
| 6 | ----------------------------------- |
---|
| 7 | BDM++ - C++ library for Bayesian Decision Making under Uncertainty |
---|
| 8 | |
---|
| 9 | Using IT++ for numerical operations |
---|
| 10 | ----------------------------------- |
---|
| 11 | */ |
---|
| 12 | |
---|
| 13 | #ifndef MPDF_HARNESS_H |
---|
| 14 | #define MPDF_HARNESS_H |
---|
| 15 | |
---|
| 16 | #include "bdmroot.h" |
---|
| 17 | #include "itpp_ext.h" |
---|
| 18 | #include "shared_ptr.h" |
---|
| 19 | #include "base/bdmbase.h" |
---|
| 20 | #include "base/user_info.h" |
---|
| 21 | |
---|
[477] | 22 | namespace bdm { |
---|
[447] | 23 | |
---|
[477] | 24 | class mpdf_harness : public root { |
---|
[447] | 25 | private: |
---|
[477] | 26 | shared_ptr<mpdf> hmpdf; |
---|
| 27 | vec cond; |
---|
| 28 | vec mean; |
---|
[484] | 29 | vec variance; |
---|
[477] | 30 | int nsamples; |
---|
| 31 | mat R; |
---|
| 32 | double tolerance; |
---|
[447] | 33 | |
---|
[477] | 34 | public: |
---|
| 35 | static void test_config ( const char *config_file_name ); |
---|
[447] | 36 | |
---|
[477] | 37 | mpdf_harness() : nsamples ( 1000 ), tolerance ( 0.1 ) { } |
---|
[447] | 38 | |
---|
[477] | 39 | virtual void test ( const char *config_name, int idx ); |
---|
[456] | 40 | |
---|
[477] | 41 | void from_setting ( const Setting &set ); |
---|
[447] | 42 | |
---|
| 43 | protected: |
---|
[477] | 44 | mpdf *get_mpdf() { |
---|
| 45 | return hmpdf.get(); |
---|
| 46 | } |
---|
[484] | 47 | |
---|
| 48 | private: |
---|
| 49 | void check_mean(); |
---|
| 50 | |
---|
| 51 | // assumes R is valid |
---|
| 52 | void check_covariance(); |
---|
[447] | 53 | }; |
---|
[493] | 54 | UIREGISTER(mpdf_harness); |
---|
[447] | 55 | |
---|
| 56 | } |
---|
| 57 | |
---|
| 58 | #endif |
---|