root/library/tests/epdf_harness.h @ 1064

Revision 1064, 1.7 kB (checked in by mido, 14 years ago)

astyle applied all over the library

  • Property svn:eol-style set to native
RevLine 
[436]1/*!
2  \file
3  \brief Support for testing descendants of epdf.
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 EPDF_HARNESS_H
14#define EPDF_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"
[481]21#include "stat/emix.h"
[730]22#include <stat/discrete.h>
[436]23
[477]24namespace bdm {
[436]25
[477]26class epdf_harness : public root {
[436]27private:
[1064]28    shared_ptr<epdf> hepdf;
29    vec mean;
30    vec variance;
31    shared_ptr<rectangular_support> support;
32    int nsamples;
33    mat R;
34    shared_ptr<RV> mrv;
35    double tolerance;
[436]36
37public:
[1064]38    static void test_config ( const char *config_file_name );
[436]39
[1064]40    epdf_harness() : nsamples ( 1000 ), tolerance ( 0.1 ) { }
[436]41
[1064]42    virtual void test ( const char *config_name, int idx );
[456]43
[1064]44    void from_setting ( const Setting &set );
[439]45
46protected:
[1064]47    epdf *get_epdf() {
48        return hepdf.get();
49    }
[456]50
[1064]51    double get_tolerance() const {
52        return tolerance;
53    }
[481]54
55private:
[1064]56    // assumes support is valid
57    void check_support_mean();
[481]58
[1064]59    // assumes support is valid
60    void check_support_integral();
[481]61
[1064]62    // assumes R is valid - it probably shouldn't, but calling it
63    // unconditionally leads to a lot of not implemented
64    // functions...
65    void check_sample_mean();
[481]66
[1064]67    // assumes R is valid
68    void check_covariance();
[481]69
[1064]70    // assumes marginal_rv is valid
71    void check_cond_mean ( mprod &mep );
[481]72
[1064]73    // assumes marginal_rv and R are valid
74    void check_cond_covariance ( mprod &mep );
[436]75};
[722]76UIREGISTER ( epdf_harness );
[436]77
78}
79
80#endif
Note: See TracBrowser for help on using the browser.