- Timestamp:
- 04/30/08 15:14:32 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
tests/testUI.cpp
r82 r90 1 1 #include <itpp/itbase.h> 2 #include <fstream> 2 3 #include "userinfo.h" 3 4 4 5 //These lines are needed for use of cout and endl 5 using std::cout; 6 using std::endl; 6 using namespace std; 7 7 8 8 int main() 9 9 { 10 10 uiscalar<double> uisc("Sc"); 11 uiscalar<double> uisc2(""); 11 12 uivec uiv("VEc"); 13 uivec uiv2("V"); 12 14 uistring uist("Str"); 13 uicompound uic(2); 15 uistring uist2("S"); 16 uimat uim("Mat"); 17 uimat uim2("M"); 14 18 15 cout << uisc <<endl; 16 cout << uiv <<endl; 17 cout << uist <<endl; 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 19 42 //Exit program: 20 getchar();21 43 return 0; 22 44