#include "additive_generator.h" #include "base/user_info.h" using namespace itpp; using bdm::UI; void additive_generator::from_setting ( const Setting &set ) { int sz; UI::get ( sz, set, "size" ); mat a0 = randu ( sz, sz ); a = a0 * a0.T(); vec v = randu ( sz ); v2 = outer_product ( v, v ); if ( set.exists ( "lambda" ) ) { UI::get ( lambda, set, "lambda" ); } } mat additive_generator::next() { mat b = a; a = ( 1 - lambda ) * a + lambda * v2; return b; }