Revision 477, 476 bytes
(checked in by mido, 15 years ago)
|
panove, vite, jak jsem peclivej na upravu kodu.. snad se vam bude libit:) konfigurace je v souboru /system/astylerc
|
Rev | Line | |
---|
[467] | 1 | #include "additive_generator.h" |
---|
| 2 | #include "base/user_info.h" |
---|
| 3 | |
---|
| 4 | using namespace itpp; |
---|
| 5 | using bdm::UI; |
---|
| 6 | |
---|
[477] | 7 | void additive_generator::from_setting ( const Setting &set ) { |
---|
| 8 | int sz; |
---|
| 9 | UI::get ( sz, set, "size" ); |
---|
[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 | |
---|
[477] | 16 | if ( set.exists ( "lambda" ) ) { |
---|
| 17 | UI::get ( lambda, set, "lambda" ); |
---|
| 18 | } |
---|
[467] | 19 | } |
---|
| 20 | |
---|
| 21 | mat additive_generator::next() { |
---|
[477] | 22 | mat b = a; |
---|
| 23 | a = ( 1 - lambda ) * a + lambda * v2; |
---|
| 24 | return b; |
---|
[467] | 25 | } |
---|