Debian Codegraph @

external/gsl/gsl_matrix__oper_source.c

raw symbols SCIP
1 /* matrix/oper_source.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 int
21 FUNCTIONcxx . . $ `./templates_on.h:233:9`!(gsl_matrix, add) (TYPEcxx . . $ `./templates_on.h:234:9`!(gsl_matrix) * a, const TYPEcxx . . $ `./templates_on.h:234:9`!(gsl_matrix) * b)
22 {
23 const size_t M = a->size1cxx . . $ $anonymous_type_26050fbfd6fba589_0#size1.;
24 const size_t N = a->size2cxx . . $ $anonymous_type_26050fbfd6fba589_0#size2.;
25
26 if (b->size1cxx . . $ $anonymous_type_26050fbfd6fba589_0#size1. != M || b->size2cxx . . $ $anonymous_type_26050fbfd6fba589_0#size2. != N)
27 {
28 GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("matrices must have same dimensions", GSL_EBADLEN);
29 }
30 else
31 {
32 const size_t tda_a = a->tdacxx . . $ $anonymous_type_26050fbfd6fba589_0#tda.;
33 const size_t tda_b = b->tdacxx . . $ $anonymous_type_26050fbfd6fba589_0#tda.;
34
35 size_t i, j;
36
37 for (i = 0; i < M; i++)
38 {
39 for (j = 0; j < N; j++)
40 {
41 a->datacxx . . $ $anonymous_type_26050fbfd6fba589_0#data.[i * tda_a + j] += b->datacxx . . $ $anonymous_type_26050fbfd6fba589_0#data.[i * tda_b + j];
42 }
43 }
44
45 return GSL_SUCCESScxx . . $ GSL_SUCCESS.;
46 }
47 }
48
49 int
50 FUNCTIONcxx . . $ `./templates_on.h:233:9`!(gsl_matrix, sub) (TYPEcxx . . $ `./templates_on.h:234:9`!(gsl_matrix) * a, const TYPEcxx . . $ `./templates_on.h:234:9`!(gsl_matrix) * b)
51 {
52 const size_t M = a->size1cxx . . $ $anonymous_type_26050fbfd6fba589_0#size1.;
53 const size_t N = a->size2cxx . . $ $anonymous_type_26050fbfd6fba589_0#size2.;
54
55 if (b->size1cxx . . $ $anonymous_type_26050fbfd6fba589_0#size1. != M || b->size2cxx . . $ $anonymous_type_26050fbfd6fba589_0#size2. != N)
56 {
57 GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("matrices must have same dimensions", GSL_EBADLEN);
58 }
59 else
60 {
61 const size_t tda_a = a->tdacxx . . $ $anonymous_type_26050fbfd6fba589_0#tda.;
62 const size_t tda_b = b->tdacxx . . $ $anonymous_type_26050fbfd6fba589_0#tda.;
63
64 size_t i, j;
65
66 for (i = 0; i < M; i++)
67 {
68 for (j = 0; j < N; j++)
69 {
70 a->datacxx . . $ $anonymous_type_26050fbfd6fba589_0#data.[i * tda_a + j] -= b->datacxx . . $ $anonymous_type_26050fbfd6fba589_0#data.[i * tda_b + j];
71 }
72 }
73
74 return GSL_SUCCESScxx . . $ GSL_SUCCESS.;
75 }
76 }
77
78 int
79 FUNCTIONcxx . . $ `./templates_on.h:233:9`!(gsl_matrix, mul_elements) (TYPEcxx . . $ `./templates_on.h:234:9`!(gsl_matrix) * a, const TYPEcxx . . $ `./templates_on.h:234:9`!(gsl_matrix) * b)
80 {
81 const size_t M = a->size1cxx . . $ $anonymous_type_26050fbfd6fba589_0#size1.;
82 const size_t N = a->size2cxx . . $ $anonymous_type_26050fbfd6fba589_0#size2.;
83
84 if (b->size1cxx . . $ $anonymous_type_26050fbfd6fba589_0#size1. != M || b->size2cxx . . $ $anonymous_type_26050fbfd6fba589_0#size2. != N)
85 {
86 GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("matrices must have same dimensions", GSL_EBADLEN);
87 }
88 else
89 {
90 const size_t tda_a = a->tdacxx . . $ $anonymous_type_26050fbfd6fba589_0#tda.;
91 const size_t tda_b = b->tdacxx . . $ $anonymous_type_26050fbfd6fba589_0#tda.;
92
93 size_t i, j;
94
95 for (i = 0; i < M; i++)
96 {
97 for (j = 0; j < N; j++)
98 {
99 a->datacxx . . $ $anonymous_type_26050fbfd6fba589_0#data.[i * tda_a + j] *= b->datacxx . . $ $anonymous_type_26050fbfd6fba589_0#data.[i * tda_b + j];
100 }
101 }
102
103 return GSL_SUCCESScxx . . $ GSL_SUCCESS.;
104 }
105 }
106
107 int
108 FUNCTIONcxx . . $ `./templates_on.h:233:9`!(gsl_matrix, div_elements) (TYPEcxx . . $ `./templates_on.h:234:9`!(gsl_matrix) * a, const TYPEcxx . . $ `./templates_on.h:234:9`!(gsl_matrix) * b)
109 {
110 const size_t M = a->size1cxx . . $ $anonymous_type_26050fbfd6fba589_0#size1.;
111 const size_t N = a->size2cxx . . $ $anonymous_type_26050fbfd6fba589_0#size2.;
112
113 if (b->size1cxx . . $ $anonymous_type_26050fbfd6fba589_0#size1. != M || b->size2cxx . . $ $anonymous_type_26050fbfd6fba589_0#size2. != N)
114 {
115 GSL_ERRORcxx . . $ `external/gsl/gsl_errno.h:104:9`! ("matrices must have same dimensions", GSL_EBADLEN);
116 }
117 else
118 {
119 const size_t tda_a = a->tdacxx . . $ $anonymous_type_26050fbfd6fba589_0#tda.;
120 const size_t tda_b = b->tdacxx . . $ $anonymous_type_26050fbfd6fba589_0#tda.;
121
122 size_t i, j;
123
124 for (i = 0; i < M; i++)
125 {
126 for (j = 0; j < N; j++)
127 {
128 a->datacxx . . $ $anonymous_type_26050fbfd6fba589_0#data.[i * tda_a + j] /= b->datacxx . . $ $anonymous_type_26050fbfd6fba589_0#data.[i * tda_b + j];
129 }
130 }
131
132 return GSL_SUCCESScxx . . $ GSL_SUCCESS.;
133 }
134 }
135
136 int
137 FUNCTIONcxx . . $ `./templates_on.h:233:9`!(gsl_matrix, scale) (TYPEcxx . . $ `./templates_on.h:234:9`!(gsl_matrix) * a, const double x)
138 {
139 const size_t M = a->size1cxx . . $ $anonymous_type_26050fbfd6fba589_0#size1.;
140 const size_t N = a->size2cxx . . $ $anonymous_type_26050fbfd6fba589_0#size2.;
141 const size_t tda = a->tdacxx . . $ $anonymous_type_26050fbfd6fba589_0#tda.;
142
143 size_t i, j;
144
145 for (i = 0; i < M; i++)
146 {
147 for (j = 0; j < N; j++)
148 {
149 a->datacxx . . $ $anonymous_type_26050fbfd6fba589_0#data.[i * tda + j] *= x;
150 }
151 }
152
153 return GSL_SUCCESScxx . . $ GSL_SUCCESS.;
154 }
155
156 int
157 FUNCTIONcxx . . $ `./templates_on.h:233:9`!(gsl_matrix, add_constant) (TYPEcxx . . $ `./templates_on.h:234:9`!(gsl_matrix) * a, const double x)
158 {
159 const size_t M = a->size1cxx . . $ $anonymous_type_26050fbfd6fba589_0#size1.;
160 const size_t N = a->size2cxx . . $ $anonymous_type_26050fbfd6fba589_0#size2.;
161 const size_t tda = a->tdacxx . . $ $anonymous_type_26050fbfd6fba589_0#tda.;
162
163 size_t i, j;
164
165 for (i = 0; i < M; i++)
166 {
167 for (j = 0; j < N; j++)
168 {
169 a->datacxx . . $ $anonymous_type_26050fbfd6fba589_0#data.[i * tda + j] += x;
170 }
171 }
172
173 return GSL_SUCCESScxx . . $ GSL_SUCCESS.;
174 }
175
176
177 int
178 FUNCTIONcxx . . $ `./templates_on.h:233:9`!(gsl_matrix, add_diagonal) (TYPEcxx . . $ `./templates_on.h:234:9`!(gsl_matrix) * a, const double x)
179 {
180 const size_t M = a->size1cxx . . $ $anonymous_type_26050fbfd6fba589_0#size1.;
181 const size_t N = a->size2cxx . . $ $anonymous_type_26050fbfd6fba589_0#size2.;
182 const size_t tda = a->tdacxx . . $ $anonymous_type_26050fbfd6fba589_0#tda.;
183 const size_t loop_lim = ( M < N ? M : N );
184 size_t i;
185 for (i = 0; i < loop_lim; i++)
186 {
187 a->datacxx . . $ $anonymous_type_26050fbfd6fba589_0#data.[i * tda + i] += x;
188 }
189
190 return GSL_SUCCESScxx . . $ GSL_SUCCESS.;
191 }