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

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

astyle applied all over the library

RevLine 
[717]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 ) {
[1064]8    int sz;
9    UI::get ( sz, set, "size", UI::compulsory );
[717]10
[1064]11    mat a0 = randu ( sz, sz );
12    a = a0 * a0.T();
13    vec v = randu ( sz );
14    v2 = outer_product ( v, v );
[717]15
[1064]16    UI::get ( lambda, set, "lambda", UI::optional );
[717]17}
18
19mat additive_generator::next() {
[1064]20    mat b = a;
21    a = ( 1 - lambda ) * a + lambda * v2;
22    return b;
[717]23}
Note: See TracBrowser for help on using the browser.