ARTS
2.2.66
Main Page
Namespaces
Namespace List
Namespace Members
All
Variables
Classes
Class List
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
~
Variables
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
Enumerations
Enumerator
a
b
d
e
f
l
n
p
s
t
u
Related Functions
a
c
i
m
n
o
p
s
t
v
x
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Variables
a
b
c
d
e
f
g
h
j
k
l
n
o
p
r
s
t
v
w
Typedefs
a
c
d
e
f
g
h
i
j
k
l
m
n
p
r
s
u
v
z
Enumerations
Enumerator
a
e
f
g
i
l
m
n
p
q
s
u
v
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
test_binaryio.cc
Go to the documentation of this file.
1
/* Copyright (C) 2003-2012 Oliver Lemke <olemke@core-dump.info>
2
3
This program is free software; you can redistribute it and/or
4
modify it under the terms of the GNU General Public License as
5
published by the Free Software Foundation; either version 2 of the
6
License, or (at your option) any later version.
7
8
This program is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
GNU General Public License for more details.
12
13
You should have received a copy of the GNU General Public License
14
along with this program; if not, write to the Free Software
15
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
16
USA. */
17
18
#include <cstdlib>
19
#include <iostream>
20
21
#include "
arts.h
"
22
#include "
matpackIV.h
"
23
#include "
xml_io.h
"
24
25
int
26
main
(
int
/* argc */
,
char
*
/* argv */
[])
27
{
28
// Create binary file
29
Tensor4
v (4,4,4,4);
30
31
for
(
Index
i = 0; i < 4; i++)
32
for
(
Index
j = 0; j < 4; j++)
33
for
(
Index
k = 0; k < 4; k++)
34
for
(
Index
l = 0; l < 4; l++)
35
v(i, j, k, l) = double (i*4*4*4+j*4*4+k*4+l);
36
37
xml_write_to_file
(
"outfile.xml"
, v,
FILE_TYPE_BINARY
, 0,
Verbosity
());
38
39
// Read binary file
40
Tensor4
w
;
41
42
xml_read_from_file
(
"outfile.xml"
,
w
,
Verbosity
());
43
44
cout <<
w
<< endl;
45
46
return
(EXIT_SUCCESS);
47
}
48
FILE_TYPE_BINARY
@ FILE_TYPE_BINARY
Definition:
xml_io.h:41
Tensor4
The Tensor4 class.
Definition:
matpackIV.h:383
matpackIV.h
w
cmplx FADDEEVA() w(cmplx z, double relerr)
Definition:
Faddeeva.cc:679
xml_read_from_file
void xml_read_from_file(const String &filename, T &type, const Verbosity &verbosity)
Reads data from XML file.
Definition:
xml_io.cc:831
main
int main(int, char *[])
Definition:
test_binaryio.cc:26
Verbosity
Definition:
messages.h:50
xml_write_to_file
void xml_write_to_file(const String &filename, const T &type, const FileType ftype, const Index no_clobber, const Verbosity &verbosity)
Write data to XML file.
Definition:
xml_io.cc:982
Index
INDEX Index
The type to use for all integer numbers and indices.
Definition:
matpack.h:35
arts.h
The global header file for ARTS.
xml_io.h
This file contains basic functions to handle XML data files.
src
test_binaryio.cc
Generated on Thu Oct 8 2020 12:59:31 for ARTS by
1.8.20