Debian Codegraph @

external/gsl/gsl_wavelet__wavelet.c

raw symbols SCIP
1 /* wavelet/wavelet.c
2 *
3 * Copyright (C) 2004 Ivo Alxneit
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 <stdlib.h>
22 #include "gsl_errno.h"cxx . . $ `<file>/external/gsl/gsl_errno.h`/
23 #include "gsl_wavelet.h"cxx . . $ `<file>/external/gsl/gsl_wavelet.h`/
24
25 gsl_waveletcxx . . $ gsl_wavelet# *
26 gsl_wavelet_alloccxx . . $ gsl_wavelet_alloc(20ba55f50ac5508). (const gsl_wavelet_typecxx . . $ gsl_wavelet_type# * T, size_t k)
27 {
28 int status;
29
30 gsl_waveletcxx . . $ gsl_wavelet# *w = (gsl_waveletcxx . . $ gsl_wavelet# *) malloccxx . . $ malloc(bfcfa4d6b7f7ef64). (sizeof (gsl_waveletcxx . . $ gsl_wavelet#));
31
32 if (w == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
33 {
34 GSL_ERROR_VALcxx . . $ `external/gsl/gsl_errno.h:112:9`! ("failed to allocate space for wavelet struct",
35 GSL_ENOMEM, 0);
36 };
37
38 w->typecxx . . $ $anonymous_type_c4b29aef47631e1e_2#type. = T;
39
40 status = (T->initcxx . . $ $anonymous_type_c4b29aef47631e1e_1#init.) (&(w->h1cxx . . $ $anonymous_type_c4b29aef47631e1e_2#h1.), &(w->g1cxx . . $ $anonymous_type_c4b29aef47631e1e_2#g1.), &(w->h2cxx . . $ $anonymous_type_c4b29aef47631e1e_2#h2.), &(w->g2cxx . . $ $anonymous_type_c4b29aef47631e1e_2#g2.),
41 &(w->nccxx . . $ $anonymous_type_c4b29aef47631e1e_2#nc.), &(w->offsetcxx . . $ $anonymous_type_c4b29aef47631e1e_2#offset.), k);
42
43 if (status)
44 {
45 freecxx . . $ free(5d22bdacc48458e8). (w);
46 GSL_ERROR_VALcxx . . $ `external/gsl/gsl_errno.h:112:9`! ("invalid wavelet member", GSL_EINVAL, 0);
47 }
48
49 return w;
50 }
51
52 void
53 gsl_wavelet_freecxx . . $ gsl_wavelet_free(2185c71616765c4b). (gsl_waveletcxx . . $ gsl_wavelet# * w)
54 {
55 freecxx . . $ free(5d22bdacc48458e8). (w);
56 }
57
58 const char *
59 gsl_wavelet_namecxx . . $ gsl_wavelet_name(317a1e217434b320). (const gsl_waveletcxx . . $ gsl_wavelet# * w)
60 {
61 return w->typecxx . . $ $anonymous_type_c4b29aef47631e1e_2#type.->namecxx . . $ $anonymous_type_c4b29aef47631e1e_1#name.;
62 }
63
64
65 /* Let's not export this for now (BJG) */
66 #if 0
67 void
68 gsl_wavelet_print (const gsl_wavelet * w)
69 {
70 size_t n = w->nc;
71 size_t i;
72
73 printf ("Wavelet type: %s\n", w->type->name);
74
75 printf
76 (" h1(%d):%12.8f g1(%d):%12.8f h2(%d):%12.8f g2(%d):%12.8f\n",
77 0, w->h1[0], 0, w->g1[0], 0, w->h2[0], 0, w->g2[0]);
78
79 for (i = 1; i < (n < 10 ? n : 10); i++)
80 {
81 printf
82 (" h1(%d):%12.8f g1(%d):%12.8f h2(%d):%12.8f g2(%d):%12.8f\n",
83 i, w->h1[i], i, w->g1[i], i, w->h2[i], i, w->g2[i]);
84 }
85
86 for (; i < n; i++)
87 {
88 printf
89 ("h1(%d):%12.8f g1(%d):%12.8f h2(%d):%12.8f g2(%d):%12.8f\n",
90 i, w->h1[i], i, w->g1[i], i, w->h2[i], i, w->g2[i]);
91 }
92 }
93 #endif
94
95 gsl_wavelet_workspacecxx . . $ gsl_wavelet_workspace# *
96 gsl_wavelet_workspace_alloccxx . . $ gsl_wavelet_workspace_alloc(894d7497e1e50e32). (size_t n)
97 {
98 gsl_wavelet_workspacecxx . . $ gsl_wavelet_workspace# *work;
99
100 if (n == 0)
101 {
102 GSL_ERROR_VALcxx . . $ `external/gsl/gsl_errno.h:112:9`! ("length n must be positive integer", GSL_EDOM, 0);
103 }
104
105 work = (gsl_wavelet_workspacecxx . . $ gsl_wavelet_workspace# *) malloccxx . . $ malloc(bfcfa4d6b7f7ef64). (sizeof (gsl_wavelet_workspacecxx . . $ gsl_wavelet_workspace#));
106
107 if (work == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
108 {
109 GSL_ERROR_VALcxx . . $ `external/gsl/gsl_errno.h:112:9`! ("failed to allocate struct", GSL_ENOMEM, 0);
110 }
111
112 work->ncxx . . $ $anonymous_type_c4b29aef47631e1e_3#n. = n;
113 work->scratchcxx . . $ $anonymous_type_c4b29aef47631e1e_3#scratch. = (double *) malloccxx . . $ malloc(bfcfa4d6b7f7ef64). (n * sizeof (double));
114
115 if (work->scratchcxx . . $ $anonymous_type_c4b29aef47631e1e_3#scratch. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
116 {
117 /* error in constructor, prevent memory leak */
118 freecxx . . $ free(5d22bdacc48458e8). (work);
119 GSL_ERROR_VALcxx . . $ `external/gsl/gsl_errno.h:112:9`! ("failed to allocate scratch space", GSL_ENOMEM, 0);
120 }
121
122 return work;
123 }
124
125 void
126 gsl_wavelet_workspace_freecxx . . $ gsl_wavelet_workspace_free(90fbf72aa763e764). (gsl_wavelet_workspacecxx . . $ gsl_wavelet_workspace# * work)
127 {
128 /* release scratch space */
129 freecxx . . $ free(5d22bdacc48458e8). (work->scratchcxx . . $ $anonymous_type_c4b29aef47631e1e_3#scratch.);
130 work->scratchcxx . . $ $anonymous_type_c4b29aef47631e1e_3#scratch. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
131 freecxx . . $ free(5d22bdacc48458e8). (work);
132 }