Revision 477, 0.7 kB
(checked in by mido, 15 years ago)
|
panove, vite, jak jsem peclivej na upravu kodu.. snad se vam bude libit:) konfigurace je v souboru /system/astylerc
|
-
Property svn:eol-style set to
native
|
Rev | Line | |
---|
[261] | 1 | #include <itpp/itcomm.h> |
---|
| 2 | |
---|
| 3 | using namespace itpp; |
---|
| 4 | |
---|
[477] | 5 | int main() { |
---|
| 6 | // Declare the it_file class |
---|
| 7 | it_file ff; |
---|
[261] | 8 | |
---|
[477] | 9 | // Open a file with the name "it_file_test.it" |
---|
| 10 | ff.open ( "it_file_test.it" ); |
---|
[261] | 11 | |
---|
[477] | 12 | // Create some data to put into the file |
---|
| 13 | vec a = linspace ( 1, 20, 20 ); |
---|
[261] | 14 | |
---|
[477] | 15 | // Put the variable a into the file. The Name("a") tells the file class |
---|
| 16 | // that the next variable shall be named "a". |
---|
| 17 | ff << Name ( "a" ) << a; |
---|
[261] | 18 | |
---|
[477] | 19 | // Force the file to be written to disc. This is useful when performing |
---|
| 20 | // iterations and ensures that the information is not stored in any cache |
---|
| 21 | // memory. In this simple example it is not necessary to flush the file. |
---|
| 22 | ff.flush(); |
---|
[261] | 23 | |
---|
[477] | 24 | // Close the file |
---|
| 25 | ff.close(); |
---|
[261] | 26 | |
---|
[477] | 27 | // Exit program |
---|
| 28 | return 0; |
---|
[261] | 29 | } |
---|