root/library/tests/additive_generator.h @ 467

Revision 467, 0.9 kB (checked in by vbarta, 15 years ago)

added a program (square_mat_prep) to generate configurably random matrices, changed square_mat_stress to use the generated agenda

Line 
1/*!
2  \file
3  \brief Generating stress test agenda from random data.
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 ADDITIVE_GENERATOR_H
14#define ADDITIVE_GENERATOR_H
15
16#include "itpp_ext.h"
17#include "generator.h"
18
19/*! Iteratively adds squared random vector to a random matrix.
20 */
21class additive_generator : public generator
22{
23private:
24    itpp::mat a;
25    itpp::mat v2;
26    double lambda;
27
28public:
29    additive_generator():lambda(0.5) { }
30
31    itpp::mat next();
32
33    //! Load from structure with elements:
34    //!  \code
35    //! { size = 7; // size (rows == cols) of the generated matrix
36    //!   lambda = 0.5; // weight of the added vector
37    //! }
38    //! \endcode
39    //! size is mandatory, lambda optional (with default as shown).
40    void from_setting(const Setting &set);
41};
42
43#endif
Note: See TracBrowser for help on using the browser.