Revision 90, 0.7 kB
(checked in by smidl, 17 years ago)
|
basic userinfo + test
|
-
Property svn:eol-style set to
native
|
Line | |
---|
1 | #include <itpp/itbase.h> |
---|
2 | #include <fstream> |
---|
3 | #include "userinfo.h" |
---|
4 | |
---|
5 | //These lines are needed for use of cout and endl |
---|
6 | using namespace std; |
---|
7 | |
---|
8 | int main() |
---|
9 | { |
---|
10 | uiscalar<double> uisc("Sc"); |
---|
11 | uiscalar<double> uisc2(""); |
---|
12 | uivec uiv("VEc"); |
---|
13 | uivec uiv2("V"); |
---|
14 | uistring uist("Str"); |
---|
15 | uistring uist2("S"); |
---|
16 | uimat uim("Mat"); |
---|
17 | uimat uim2("M"); |
---|
18 | |
---|
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 | |
---|
42 | //Exit program: |
---|
43 | return 0; |
---|
44 | |
---|
45 | } |
---|