00001 
00013 #ifndef MPDF_HARNESS_H
00014 #define MPDF_HARNESS_H
00015 
00016 #include "bdmroot.h"
00017 #include "itpp_ext.h"
00018 #include "shared_ptr.h"
00019 #include "base/bdmbase.h"
00020 #include "base/user_info.h"
00021 
00022 namespace bdm {
00023 
00024 class mpdf_harness : public root {
00025 private:
00026         shared_ptr<mpdf> hmpdf;
00027         vec cond;
00028         vec mean;
00029         vec variance;
00030         int nsamples;
00031         mat R;
00032         double tolerance;
00033 
00034 public:
00035         static void test_config ( const char *config_file_name );
00036 
00037         mpdf_harness() : nsamples ( 1000 ), tolerance ( 0.1 ) { }
00038 
00039         virtual void test ( const char *config_name, int idx );
00040 
00041         void from_setting ( const Setting &set );
00042 
00043 protected:
00044         mpdf *get_mpdf() {
00045                 return hmpdf.get();
00046         }
00047 
00048 private:
00049         void check_mean();
00050 
00051         
00052         void check_covariance();
00053 };
00054 UIREGISTER(mpdf_harness);
00055 
00056 }
00057 
00058 #endif