|
Revision 467, 411 bytes
(checked in by vbarta, 16 years ago)
|
|
added a program (square_mat_prep) to generate configurably random matrices, changed square_mat_stress to use the generated agenda
|
| Line | |
|---|
| 1 | #include "size_generator.h" |
|---|
| 2 | #include "base/user_info.h" |
|---|
| 3 | |
|---|
| 4 | using namespace itpp; |
|---|
| 5 | using bdm::UI; |
|---|
| 6 | |
|---|
| 7 | void size_generator::from_setting(const Setting &set) { |
|---|
| 8 | if (set.exists("size")) { |
|---|
| 9 | UI::get(sz, set, "size"); |
|---|
| 10 | } |
|---|
| 11 | |
|---|
| 12 | if (set.exists("step")) { |
|---|
| 13 | UI::get(step, set, "step"); |
|---|
| 14 | } |
|---|
| 15 | } |
|---|
| 16 | |
|---|
| 17 | mat size_generator::next() { |
|---|
| 18 | mat A0 = randu(sz, sz); |
|---|
| 19 | mat A = A0 * A0.T(); |
|---|
| 20 | sz *= step; |
|---|
| 21 | return A; |
|---|
| 22 | } |
|---|