00001 /* Copyright (C) 2003-2008 Oliver Lemke <olemke@core-dump.info> 00002 00003 This program is free software; you can redistribute it and/or 00004 modify it under the terms of the GNU General Public License as 00005 published by the Free Software Foundation; either version 2 of the 00006 License, or (at your option) any later version. 00007 00008 This program is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 GNU General Public License for more details. 00012 00013 You should have received a copy of the GNU General Public License 00014 along with this program; if not, write to the Free Software 00015 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00016 USA. */ 00017 00018 #include <cstdlib> 00019 #include <iostream> 00020 00021 #include "arts.h" 00022 #include "matpackIV.h" 00023 #include "xml_io.h" 00024 00025 int 00026 main (int /* argc */, char * /* argv */ []) 00027 { 00028 // Create binary file 00029 Tensor4 v (4,4,4,4); 00030 00031 for (Index i = 0; i < 4; i++) 00032 for (Index j = 0; j < 4; j++) 00033 for (Index k = 0; k < 4; k++) 00034 for (Index l = 0; l < 4; l++) 00035 v(i, j, k, l) = double (i*4*4*4+j*4*4+k*4+l); 00036 00037 xml_write_to_file ("outfile.xml", v, FILE_TYPE_BINARY); 00038 00039 // Read binary file 00040 Tensor4 w; 00041 00042 xml_read_from_file ("outfile.xml", w); 00043 00044 cout << w << endl; 00045 00046 return (EXIT_SUCCESS); 00047 } 00048