| Revision 468, 1.2 kB
            (checked in by vbarta, 16 years ago) | 
        
          | 
added supplementary random test data to agenda 
 | 
      
      
    | Line |  | 
|---|
| 1 | /*! | 
|---|
| 2 | \file | 
|---|
| 3 | \brief Agenda item format for stress tests of BDM matrices. | 
|---|
| 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 SQUARE_MAT_POINT_H | 
|---|
| 14 | #define SQUARE_MAT_POINT_H | 
|---|
| 15 |  | 
|---|
| 16 | #include "itpp_ext.h" | 
|---|
| 17 | #include "bdmroot.h" | 
|---|
| 18 |  | 
|---|
| 19 | /*! Testing matrix operations needs one square symmetrical matrix, one | 
|---|
| 20 | random vector and one random scalar. | 
|---|
| 21 | */ | 
|---|
| 22 | class square_mat_point : public bdm::root | 
|---|
| 23 | { | 
|---|
| 24 | private: | 
|---|
| 25 | itpp::mat matrix; | 
|---|
| 26 | itpp::vec vector; | 
|---|
| 27 | double scalar; | 
|---|
| 28 |  | 
|---|
| 29 | public: | 
|---|
| 30 | square_mat_point():scalar(0) { } | 
|---|
| 31 |  | 
|---|
| 32 | itpp::mat get_matrix() const { | 
|---|
| 33 | return matrix; | 
|---|
| 34 | } | 
|---|
| 35 |  | 
|---|
| 36 | itpp::vec get_vector() const { | 
|---|
| 37 | return vector; | 
|---|
| 38 | } | 
|---|
| 39 |  | 
|---|
| 40 | double get_scalar() const { | 
|---|
| 41 | return scalar; | 
|---|
| 42 | } | 
|---|
| 43 |  | 
|---|
| 44 | void set_parameters(const itpp::mat &m, const itpp::vec &v, double s) { | 
|---|
| 45 | matrix = m; | 
|---|
| 46 | vector = v; | 
|---|
| 47 | scalar = s; | 
|---|
| 48 | } | 
|---|
| 49 |  | 
|---|
| 50 | //! Load from structure with elements: | 
|---|
| 51 | //!  \code | 
|---|
| 52 | //! { matrix = ( "matrix", ... | 
|---|
| 53 | //!   vector = [ ... | 
|---|
| 54 | //!   scalar = ... | 
|---|
| 55 | //! } | 
|---|
| 56 | //! \endcode | 
|---|
| 57 | //! All elements are mandatory. | 
|---|
| 58 | void from_setting(const Setting &set); | 
|---|
| 59 |  | 
|---|
| 60 | void to_setting(Setting &set) const; | 
|---|
| 61 | }; | 
|---|
| 62 |  | 
|---|
| 63 | #endif | 
|---|