root/library/tests/additive_generator.cpp @ 480

Revision 480, 468 bytes (checked in by vbarta, 15 years ago)

fixed tests for new UI::get & UI::build

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