Revision 90, 0.7 kB
(checked in by smidl, 16 years ago)
|
basic userinfo + test
|
-
Property svn:eol-style set to
native
|
Rev | Line | |
---|
[82] | 1 | #include <itpp/itbase.h> |
---|
[90] | 2 | #include <fstream> |
---|
[82] | 3 | #include "userinfo.h" |
---|
| 4 | |
---|
| 5 | //These lines are needed for use of cout and endl |
---|
[90] | 6 | using namespace std; |
---|
[82] | 7 | |
---|
| 8 | int main() |
---|
| 9 | { |
---|
| 10 | uiscalar<double> uisc("Sc"); |
---|
[90] | 11 | uiscalar<double> uisc2(""); |
---|
[82] | 12 | uivec uiv("VEc"); |
---|
[90] | 13 | uivec uiv2("V"); |
---|
[82] | 14 | uistring uist("Str"); |
---|
[90] | 15 | uistring uist2("S"); |
---|
| 16 | uimat uim("Mat"); |
---|
| 17 | uimat uim2("M"); |
---|
[82] | 18 | |
---|
[90] | 19 | //SET values |
---|
| 20 | |
---|
| 21 | uisc.set_value(0.5); |
---|
| 22 | uiv.set_value(itpp::vec_2(1.3,1.7)); |
---|
| 23 | uist.set_value("Wow this is cool!"); |
---|
| 24 | uim.set_value(itpp::mat_2x2(1.1,1.2,1.3,1.4)); |
---|
| 25 | |
---|
| 26 | ofstream OF; |
---|
| 27 | OF.open("testUI.exb"); |
---|
| 28 | uisc.save(OF); |
---|
| 29 | uiv.save(OF); |
---|
| 30 | uist.save(OF); |
---|
| 31 | uim.save(OF); |
---|
| 32 | OF.close(); |
---|
| 33 | |
---|
| 34 | ifstream IF; |
---|
| 35 | IF.open("testUI.exb"); |
---|
| 36 | uisc2.load(IF); |
---|
| 37 | uiv2.load(IF); |
---|
| 38 | uist2.load(IF); |
---|
| 39 | uim2.load(IF); |
---|
| 40 | IF.close(); |
---|
| 41 | |
---|
[82] | 42 | //Exit program: |
---|
| 43 | return 0; |
---|
| 44 | |
---|
| 45 | } |
---|