Debian Codegraph @

external/gsl/gsl_histogram__file2d.c

raw symbols SCIP
1 /* histogram/file2d.c
2 *
3 * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 Brian Gough
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or (at
8 * your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20 #include "gsl__config.h"cxx . . $ `<file>/external/gsl/gsl__config.h`/
21 #include <stdio.h>
22 #include "gsl_errno.h"cxx . . $ `<file>/external/gsl/gsl_errno.h`/
23 #include "gsl_block.h"cxx . . $ `<file>/external/gsl/gsl_block.h`/
24 #include "gsl_histogram2d.h"cxx . . $ `<file>/external/gsl/gsl_histogram2d.h`/
25
26 int
27 gsl_histogram2d_freadcxx . . $ gsl_histogram2d_fread(2eb1d5cbf62dedd5). (FILEcxx . . $ FILE# * stream, gsl_histogram2dcxx . . $ gsl_histogram2d# * h)
28 {
29 int status = gsl_block_raw_freadcxx . . $ gsl_block_raw_fread(3ebb93b8a1b35676). (stream, h->xrangecxx . . $ $anonymous_type_2826d176da817e9d_0#xrange., h->nxcxx . . $ $anonymous_type_2826d176da817e9d_0#nx. + 1, 1);
30
31 if (status)
32 return status;
33
34 status = gsl_block_raw_freadcxx . . $ gsl_block_raw_fread(3ebb93b8a1b35676). (stream, h->yrangecxx . . $ $anonymous_type_2826d176da817e9d_0#yrange., h->nycxx . . $ $anonymous_type_2826d176da817e9d_0#ny. + 1, 1);
35
36 if (status)
37 return status;
38
39 status = gsl_block_raw_freadcxx . . $ gsl_block_raw_fread(3ebb93b8a1b35676). (stream, h->bincxx . . $ $anonymous_type_2826d176da817e9d_0#bin., h->nxcxx . . $ $anonymous_type_2826d176da817e9d_0#nx. * h->nycxx . . $ $anonymous_type_2826d176da817e9d_0#ny., 1);
40
41 return status;
42 }
43
44 int
45 gsl_histogram2d_fwritecxx . . $ gsl_histogram2d_fwrite(2bea6940d00a9d4b). (FILEcxx . . $ FILE# * stream, const gsl_histogram2dcxx . . $ gsl_histogram2d# * h)
46 {
47 int status = gsl_block_raw_fwritecxx . . $ gsl_block_raw_fwrite(15b6124729fbb84f). (stream, h->xrangecxx . . $ $anonymous_type_2826d176da817e9d_0#xrange., h->nxcxx . . $ $anonymous_type_2826d176da817e9d_0#nx. + 1, 1);
48
49 if (status)
50 return status;
51
52 status = gsl_block_raw_fwritecxx . . $ gsl_block_raw_fwrite(15b6124729fbb84f). (stream, h->yrangecxx . . $ $anonymous_type_2826d176da817e9d_0#yrange., h->nycxx . . $ $anonymous_type_2826d176da817e9d_0#ny. + 1, 1);
53
54 if (status)
55 return status;
56
57 status = gsl_block_raw_fwritecxx . . $ gsl_block_raw_fwrite(15b6124729fbb84f). (stream, h->bincxx . . $ $anonymous_type_2826d176da817e9d_0#bin., h->nxcxx . . $ $anonymous_type_2826d176da817e9d_0#nx. * h->nycxx . . $ $anonymous_type_2826d176da817e9d_0#ny., 1);
58 return status;
59 }
60
61 int
62 gsl_histogram2d_fprintfcxx . . $ gsl_histogram2d_fprintf(f0b74cda44e475e3). (FILEcxx . . $ FILE# * stream, const gsl_histogram2dcxx . . $ gsl_histogram2d# * h,
63 const char *range_format, const char *bin_format)
64 {
65 size_t i, j;
66 const size_t nx = h->nxcxx . . $ $anonymous_type_2826d176da817e9d_0#nx.;
67 const size_t ny = h->nycxx . . $ $anonymous_type_2826d176da817e9d_0#ny.;
68 int status;
69
70 for (i = 0; i < nx; i++)
71 {
72 for (j = 0; j < ny; j++)
73 {
74 status = fprintfcxx . . $ fprintf(bc216f8e5b1ebeac). (stream, range_format, h->xrangecxx . . $ $anonymous_type_2826d176da817e9d_0#xrange.[i]);
75
76 if (status < 0)
77 {
78 GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("fprintf failed", GSL_EFAILED);
79 }
80
81 status = putccxx . . $ putc(b1cd03d6c470d1bd). (' ', stream);
82
83 if (status == EOFcxx . . $ `<external>/232824719582829767/stdio.h:105:9`!)
84 {
85 GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("putc failed", GSL_EFAILED);
86 }
87
88 status = fprintfcxx . . $ fprintf(bc216f8e5b1ebeac). (stream, range_format, h->xrangecxx . . $ $anonymous_type_2826d176da817e9d_0#xrange.[i + 1]);
89
90 if (status < 0)
91 {
92 GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("fprintf failed", GSL_EFAILED);
93 }
94
95 status = putccxx . . $ putc(b1cd03d6c470d1bd). (' ', stream);
96
97 if (status == EOFcxx . . $ `<external>/232824719582829767/stdio.h:105:9`!)
98 {
99 GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("putc failed", GSL_EFAILED);
100 }
101
102 status = fprintfcxx . . $ fprintf(bc216f8e5b1ebeac). (stream, range_format, h->yrangecxx . . $ $anonymous_type_2826d176da817e9d_0#yrange.[j]);
103
104 if (status < 0)
105 {
106 GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("fprintf failed", GSL_EFAILED);
107 }
108
109 status = putccxx . . $ putc(b1cd03d6c470d1bd). (' ', stream);
110
111 if (status == EOFcxx . . $ `<external>/232824719582829767/stdio.h:105:9`!)
112 {
113 GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("putc failed", GSL_EFAILED);
114 }
115
116 status = fprintfcxx . . $ fprintf(bc216f8e5b1ebeac). (stream, range_format, h->yrangecxx . . $ $anonymous_type_2826d176da817e9d_0#yrange.[j + 1]);
117
118 if (status < 0)
119 {
120 GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("fprintf failed", GSL_EFAILED);
121 }
122
123 status = putccxx . . $ putc(b1cd03d6c470d1bd). (' ', stream);
124
125 if (status == EOFcxx . . $ `<external>/232824719582829767/stdio.h:105:9`!)
126 {
127 GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("putc failed", GSL_EFAILED);
128 }
129
130 status = fprintfcxx . . $ fprintf(bc216f8e5b1ebeac). (stream, bin_format, h->bincxx . . $ $anonymous_type_2826d176da817e9d_0#bin.[i * ny + j]);
131
132 if (status < 0)
133 {
134 GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("fprintf failed", GSL_EFAILED);
135 }
136
137 status = putccxx . . $ putc(b1cd03d6c470d1bd). ('\n', stream);
138
139 if (status == EOFcxx . . $ `<external>/232824719582829767/stdio.h:105:9`!)
140 {
141 GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("putc failed", GSL_EFAILED);
142 }
143 }
144 status = putccxx . . $ putc(b1cd03d6c470d1bd). ('\n', stream);
145
146 if (status == EOFcxx . . $ `<external>/232824719582829767/stdio.h:105:9`!)
147 {
148 GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("putc failed", GSL_EFAILED);
149 }
150 }
151
152 return GSL_SUCCESScxx . . $ GSL_SUCCESS.;
153 }
154
155 int
156 gsl_histogram2d_fscanfcxx . . $ gsl_histogram2d_fscanf(2eb1d5cbf62dedd5). (FILEcxx . . $ FILE# * stream, gsl_histogram2dcxx . . $ gsl_histogram2d# * h)
157 {
158 size_t i, j;
159 const size_t nx = h->nxcxx . . $ $anonymous_type_2826d176da817e9d_0#nx.;
160 const size_t ny = h->nycxx . . $ $anonymous_type_2826d176da817e9d_0#ny.;
161 double xupper, yupper;
162
163 for (i = 0; i < nx; i++)
164 {
165 for (j = 0; j < ny; j++)
166 {
167 int status = fscanfcxx . . $ fscanf(bc216f8e5b1ebeac). (stream,
168 "%lg %lg %lg %lg %lg",
169 h->xrangecxx . . $ $anonymous_type_2826d176da817e9d_0#xrange. + i, &xupper,
170 h->yrangecxx . . $ $anonymous_type_2826d176da817e9d_0#yrange. + j, &yupper,
171 h->bincxx . . $ $anonymous_type_2826d176da817e9d_0#bin. + i * ny + j);
172
173 if (status != 5)
174 {
175 GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("fscanf failed", GSL_EFAILED);
176 }
177 }
178 h->yrangecxx . . $ $anonymous_type_2826d176da817e9d_0#yrange.[ny] = yupper;
179 }
180
181 h->xrangecxx . . $ $anonymous_type_2826d176da817e9d_0#xrange.[nx] = xupper;
182
183 return GSL_SUCCESScxx . . $ GSL_SUCCESS.;
184 }