root/library/tests/stresssuite/additive_generator.cpp @ 813

Revision 717, 491 bytes (checked in by mido, 15 years ago)

clean up of the whole tests directory has just started

Line 
1#include "additive_generator.h"
2#include "base/user_info.h"
3
4using namespace itpp;
5using bdm::UI;
6
7void additive_generator::from_setting ( const Setting &set ) {
8        int sz;
9        UI::get ( sz, set, "size", UI::compulsory );
10
11        mat a0 = randu ( sz, sz );
12        a = a0 * a0.T();
13        vec v = randu ( sz );
14        v2 = outer_product ( v, v );
15
16        UI::get ( lambda, set, "lambda", UI::optional );
17}
18
19mat additive_generator::next() {
20        mat b = a;
21        a = ( 1 - lambda ) * a + lambda * v2;
22        return b;
23}
Note: See TracBrowser for help on using the browser.