root/library/tests/mpdf_harness.h @ 484

Revision 484, 1.1 kB (checked in by vbarta, 15 years ago)

repeating failing mpdf tests; mpdf_harness configs now have optional cond (0 by default) and mandatory variance

Line 
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#define BDMLIB // not an ideal way to prevent double registration of UI factories...
17
18#include "bdmroot.h"
19#include "itpp_ext.h"
20#include "shared_ptr.h"
21#include "base/bdmbase.h"
22#include "base/user_info.h"
23
24namespace bdm {
25
26class mpdf_harness : public root {
27private:
28        shared_ptr<mpdf> hmpdf;
29        vec cond;
30        vec mean;
31        vec variance;
32        int nsamples;
33        mat R;
34        double tolerance;
35
36public:
37        static void test_config ( const char *config_file_name );
38
39        mpdf_harness() : nsamples ( 1000 ), tolerance ( 0.1 ) { }
40
41        virtual void test ( const char *config_name, int idx );
42
43        void from_setting ( const Setting &set );
44
45protected:
46        mpdf *get_mpdf() {
47                return hmpdf.get();
48        }
49
50private:
51        void check_mean();
52
53        // assumes R is valid
54        void check_covariance();
55};
56
57}
58
59#endif
Note: See TracBrowser for help on using the browser.