00001 #include <iostream>
00002 #include "CollapseModel.h"
00003 #include "UniformRNG.h"
00004 #include <boost/numeric/ublas/io.hpp>
00005
00006 using namespace std;
00007 int main()
00008 {
00009 const unsigned int size = 4;
00010 const unsigned int tests = 10;
00011
00012 UniformRNG Random;
00013 cout << "One identical layer";
00014 for (int t = 0; t < tests; ++t)
00015 {
00016 ttranscribed thick(size), value(size);
00017
00018 for (int i = 0; i < size; ++i)
00019 {
00020 thick(i) = Random.GetNumber();
00021 value(i) = Random.GetNumber();
00022 }
00023 value(1) = value(2);
00024 cout << "Before: " << endl;
00025 cout << " Thick: " << thick << endl;
00026 cout << " Value: " << value << endl;
00027 CollapseModel(thick,value);
00028 cout << "After: " << endl;
00029 cout << " Thick: " << thick << endl;
00030 cout << " Value: " << value << endl << endl;
00031 }
00032 cout << "One nearly identical layer";
00033 double eps = 1e-10;
00034
00035
00036
00037 for (int t = 0; t < tests; ++t)
00038 {
00039 ttranscribed thick(size), value(size);
00040 for (int i = 0; i < size; ++i)
00041 {
00042 thick(i) = Random.GetNumber();
00043 value(i) = Random.GetNumber();
00044 }
00045
00046
00047 value(1) = value(2)+eps*t;
00048 cout << "Eps: " << eps*t << endl;
00049 cout << "Before: " << endl;
00050 cout << " Thick: " << thick << endl;
00051 cout << " Value: " << value << endl;
00052 CollapseModel(thick,value);
00053 cout << "After: " << endl;
00054 cout << " Thick: " << thick << endl;
00055 cout << " Value: " << value << endl << endl;
00056 }
00057 }