1 
2 
3 /* @cond INNERDOC */
4 /**
5  * @file
6  * @brief
7  * Sorting functions.
8  */
9 
10 /*
11 
12 Copyright (C) 2008-2019 Michele Martone
13 
14 This file is part of librsb.
15 
16 librsb is free software; you can redistribute it and/or modify it
17 under the terms of the GNU Lesser General Public License as published
18 by the Free Software Foundation; either version 3 of the License, or
19 (at your option) any later version.
20 
21 librsb is distributed in the hope that it will be useful, but WITHOUT
22 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
23 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
24 License for more details.
25 
26 You should have received a copy of the GNU Lesser General Public
27 License along with librsb; see the file COPYING.
28 If not, see <http://www.gnu.org/licenses/>.
29 
30 */
31 /*
32  The code in this file was generated automatically by an M4 script.
33  It is not meant to be used as an API (Application Programming Interface).
34  p.s.: right now, only row major matrix access is considered.
35 
36  */
37 
38 
39 #ifndef RSB_MERGESORT_H_INCLUDED
40 #define RSB_MERGESORT_H_INCLUDED
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif /* __cplusplus */
45 
46 
47 
48 
49 #include "rsb.h"
50 #include "rsb_common.h"
51 #include "rsb_internals.h"
52 
53 
54 
55 rsb_err_t rsb__do_mergesort_CSR(
56 	rsb_coo_idx_t *iarray,
57 	rsb_coo_idx_t *jarray,
58 	void *array,
59 	rsb_nnz_idx_t length,
60 	rsb_coo_idx_t *iresult,
61 	rsb_coo_idx_t *jresult,
62 	void *result,
63 	rsb_type_t type);
64 rsb_err_t rsb__do_mergesort_BCSR(
65 	rsb_coo_idx_t *iarray,
66 	rsb_coo_idx_t *jarray,
67 	void *array,
68 	rsb_nnz_idx_t length,
69 	rsb_coo_idx_t mb,
70 	rsb_coo_idx_t kb,
71 	rsb_coo_idx_t *iresult,
72 	rsb_coo_idx_t *jresult,
73 	void *result,
74 	rsb_type_t type);
75 rsb_err_t rsb__do_mergesort_VBR(
76 	rsb_coo_idx_t *iarray,
77 	rsb_coo_idx_t *jarray,
78 	rsb_coo_idx_t *biarray,
79 	rsb_coo_idx_t *bjarray,
80 	void *array,
81 	rsb_nnz_idx_t length,
82 	rsb_coo_idx_t *iresult,
83 	rsb_coo_idx_t *jresult,
84 	rsb_coo_idx_t *biresult,
85 	rsb_coo_idx_t *bjresult,
86 	void *result,
87 	rsb_type_t type);
88 rsb_err_t rsb_do_mergesort_double_CSR(
89 	rsb_coo_idx_t *restrict iarray,
90 	rsb_coo_idx_t *restrict jarray,
91 	double *array,
92 	rsb_nnz_idx_t length,
93 	rsb_coo_idx_t *restrict iresult,
94 	rsb_coo_idx_t *restrict jresult,
95 	double *restrict result)
96 ;
97 
98 void rsb_do_merge_double_CSR(
99 		const rsb_coo_idx_t* restrict ileft, const rsb_coo_idx_t* restrict iright,  rsb_coo_idx_t*restrict iresult,
100 		const rsb_coo_idx_t* restrict jleft, const rsb_coo_idx_t* restrict jright,  rsb_coo_idx_t*restrict jresult,
101 		const double* left, const double* restrict right,  double* restrict result,
102 		rsb_nnz_idx_t left_length,
103 		rsb_nnz_idx_t right_length )
104 
105 ;
106 rsb_err_t rsb_do_mergesort_float_CSR(
107 	rsb_coo_idx_t *restrict iarray,
108 	rsb_coo_idx_t *restrict jarray,
109 	float *array,
110 	rsb_nnz_idx_t length,
111 	rsb_coo_idx_t *restrict iresult,
112 	rsb_coo_idx_t *restrict jresult,
113 	float *restrict result)
114 ;
115 
116 void rsb_do_merge_float_CSR(
117 		const rsb_coo_idx_t* restrict ileft, const rsb_coo_idx_t* restrict iright,  rsb_coo_idx_t*restrict iresult,
118 		const rsb_coo_idx_t* restrict jleft, const rsb_coo_idx_t* restrict jright,  rsb_coo_idx_t*restrict jresult,
119 		const float* left, const float* restrict right,  float* restrict result,
120 		rsb_nnz_idx_t left_length,
121 		rsb_nnz_idx_t right_length )
122 
123 ;
124 rsb_err_t rsb_do_mergesort_float_complex_CSR(
125 	rsb_coo_idx_t *restrict iarray,
126 	rsb_coo_idx_t *restrict jarray,
127 	float complex *array,
128 	rsb_nnz_idx_t length,
129 	rsb_coo_idx_t *restrict iresult,
130 	rsb_coo_idx_t *restrict jresult,
131 	float complex *restrict result)
132 ;
133 
134 void rsb_do_merge_float_complex_CSR(
135 		const rsb_coo_idx_t* restrict ileft, const rsb_coo_idx_t* restrict iright,  rsb_coo_idx_t*restrict iresult,
136 		const rsb_coo_idx_t* restrict jleft, const rsb_coo_idx_t* restrict jright,  rsb_coo_idx_t*restrict jresult,
137 		const float complex* left, const float complex* restrict right,  float complex* restrict result,
138 		rsb_nnz_idx_t left_length,
139 		rsb_nnz_idx_t right_length )
140 
141 ;
142 rsb_err_t rsb_do_mergesort_double_complex_CSR(
143 	rsb_coo_idx_t *restrict iarray,
144 	rsb_coo_idx_t *restrict jarray,
145 	double complex *array,
146 	rsb_nnz_idx_t length,
147 	rsb_coo_idx_t *restrict iresult,
148 	rsb_coo_idx_t *restrict jresult,
149 	double complex *restrict result)
150 ;
151 
152 void rsb_do_merge_double_complex_CSR(
153 		const rsb_coo_idx_t* restrict ileft, const rsb_coo_idx_t* restrict iright,  rsb_coo_idx_t*restrict iresult,
154 		const rsb_coo_idx_t* restrict jleft, const rsb_coo_idx_t* restrict jright,  rsb_coo_idx_t*restrict jresult,
155 		const double complex* left, const double complex* restrict right,  double complex* restrict result,
156 		rsb_nnz_idx_t left_length,
157 		rsb_nnz_idx_t right_length )
158 
159 ;
160 rsb_err_t rsb_do_mergesort_double_BCSR(
161 	rsb_coo_idx_t *restrict iarray,
162 	rsb_coo_idx_t *restrict jarray,
163 	rsb_coo_idx_t mb, rsb_coo_idx_t kb,
164 	double *array,
165 	rsb_nnz_idx_t length,
166 	rsb_coo_idx_t *restrict iresult,
167 	rsb_coo_idx_t *restrict jresult,
168 	double *restrict result)
169 ;
170 
171 void rsb_do_merge_double_BCSR(
172 		const rsb_coo_idx_t* restrict ileft, const rsb_coo_idx_t* restrict iright,  rsb_coo_idx_t*restrict iresult,
173 		const rsb_coo_idx_t* restrict jleft, const rsb_coo_idx_t* restrict jright,  rsb_coo_idx_t*restrict jresult,
174 const rsb_coo_idx_t mb, const rsb_coo_idx_t kb,		const double* left, const double* restrict right,  double* restrict result,
175 		rsb_nnz_idx_t left_length,
176 		rsb_nnz_idx_t right_length )
177 
178 ;
179 rsb_err_t rsb_do_mergesort_float_BCSR(
180 	rsb_coo_idx_t *restrict iarray,
181 	rsb_coo_idx_t *restrict jarray,
182 	rsb_coo_idx_t mb, rsb_coo_idx_t kb,
183 	float *array,
184 	rsb_nnz_idx_t length,
185 	rsb_coo_idx_t *restrict iresult,
186 	rsb_coo_idx_t *restrict jresult,
187 	float *restrict result)
188 ;
189 
190 void rsb_do_merge_float_BCSR(
191 		const rsb_coo_idx_t* restrict ileft, const rsb_coo_idx_t* restrict iright,  rsb_coo_idx_t*restrict iresult,
192 		const rsb_coo_idx_t* restrict jleft, const rsb_coo_idx_t* restrict jright,  rsb_coo_idx_t*restrict jresult,
193 const rsb_coo_idx_t mb, const rsb_coo_idx_t kb,		const float* left, const float* restrict right,  float* restrict result,
194 		rsb_nnz_idx_t left_length,
195 		rsb_nnz_idx_t right_length )
196 
197 ;
198 rsb_err_t rsb_do_mergesort_float_complex_BCSR(
199 	rsb_coo_idx_t *restrict iarray,
200 	rsb_coo_idx_t *restrict jarray,
201 	rsb_coo_idx_t mb, rsb_coo_idx_t kb,
202 	float complex *array,
203 	rsb_nnz_idx_t length,
204 	rsb_coo_idx_t *restrict iresult,
205 	rsb_coo_idx_t *restrict jresult,
206 	float complex *restrict result)
207 ;
208 
209 void rsb_do_merge_float_complex_BCSR(
210 		const rsb_coo_idx_t* restrict ileft, const rsb_coo_idx_t* restrict iright,  rsb_coo_idx_t*restrict iresult,
211 		const rsb_coo_idx_t* restrict jleft, const rsb_coo_idx_t* restrict jright,  rsb_coo_idx_t*restrict jresult,
212 const rsb_coo_idx_t mb, const rsb_coo_idx_t kb,		const float complex* left, const float complex* restrict right,  float complex* restrict result,
213 		rsb_nnz_idx_t left_length,
214 		rsb_nnz_idx_t right_length )
215 
216 ;
217 rsb_err_t rsb_do_mergesort_double_complex_BCSR(
218 	rsb_coo_idx_t *restrict iarray,
219 	rsb_coo_idx_t *restrict jarray,
220 	rsb_coo_idx_t mb, rsb_coo_idx_t kb,
221 	double complex *array,
222 	rsb_nnz_idx_t length,
223 	rsb_coo_idx_t *restrict iresult,
224 	rsb_coo_idx_t *restrict jresult,
225 	double complex *restrict result)
226 ;
227 
228 void rsb_do_merge_double_complex_BCSR(
229 		const rsb_coo_idx_t* restrict ileft, const rsb_coo_idx_t* restrict iright,  rsb_coo_idx_t*restrict iresult,
230 		const rsb_coo_idx_t* restrict jleft, const rsb_coo_idx_t* restrict jright,  rsb_coo_idx_t*restrict jresult,
231 const rsb_coo_idx_t mb, const rsb_coo_idx_t kb,		const double complex* left, const double complex* restrict right,  double complex* restrict result,
232 		rsb_nnz_idx_t left_length,
233 		rsb_nnz_idx_t right_length )
234 
235 ;
236 rsb_err_t rsb_do_mergesort_double_VBR(
237 	rsb_coo_idx_t *restrict iarray,
238 	rsb_coo_idx_t *restrict jarray,
239 	rsb_coo_idx_t *restrict biarray,
240 	rsb_coo_idx_t *restrict bjarray,
241 	double *array,
242 	rsb_nnz_idx_t length,
243 	rsb_coo_idx_t *restrict iresult,
244 	rsb_coo_idx_t *restrict jresult,
245 	rsb_coo_idx_t *restrict biresult,
246 	rsb_coo_idx_t *restrict bjresult,
247 	double *restrict result)
248 ;
249 
250 void rsb_do_merge_double_VBR(
251 		const rsb_coo_idx_t* restrict ileft, const rsb_coo_idx_t* restrict iright,  rsb_coo_idx_t*restrict iresult,
252 		const rsb_coo_idx_t* restrict jleft, const rsb_coo_idx_t* restrict jright,  rsb_coo_idx_t*restrict jresult,
253 const rsb_coo_idx_t * restrict bileft, const rsb_coo_idx_t * restrict biright, rsb_coo_idx_t * restrict biresult,const rsb_coo_idx_t * restrict bjleft, const rsb_coo_idx_t * restrict bjright, rsb_coo_idx_t * restrict bjresult,		const double* left, const double* restrict right,  double* restrict result,
254 		rsb_nnz_idx_t left_length,
255 		rsb_nnz_idx_t right_length )
256 
257 ;
258 rsb_err_t rsb_do_mergesort_float_VBR(
259 	rsb_coo_idx_t *restrict iarray,
260 	rsb_coo_idx_t *restrict jarray,
261 	rsb_coo_idx_t *restrict biarray,
262 	rsb_coo_idx_t *restrict bjarray,
263 	float *array,
264 	rsb_nnz_idx_t length,
265 	rsb_coo_idx_t *restrict iresult,
266 	rsb_coo_idx_t *restrict jresult,
267 	rsb_coo_idx_t *restrict biresult,
268 	rsb_coo_idx_t *restrict bjresult,
269 	float *restrict result)
270 ;
271 
272 void rsb_do_merge_float_VBR(
273 		const rsb_coo_idx_t* restrict ileft, const rsb_coo_idx_t* restrict iright,  rsb_coo_idx_t*restrict iresult,
274 		const rsb_coo_idx_t* restrict jleft, const rsb_coo_idx_t* restrict jright,  rsb_coo_idx_t*restrict jresult,
275 const rsb_coo_idx_t * restrict bileft, const rsb_coo_idx_t * restrict biright, rsb_coo_idx_t * restrict biresult,const rsb_coo_idx_t * restrict bjleft, const rsb_coo_idx_t * restrict bjright, rsb_coo_idx_t * restrict bjresult,		const float* left, const float* restrict right,  float* restrict result,
276 		rsb_nnz_idx_t left_length,
277 		rsb_nnz_idx_t right_length )
278 
279 ;
280 rsb_err_t rsb_do_mergesort_float_complex_VBR(
281 	rsb_coo_idx_t *restrict iarray,
282 	rsb_coo_idx_t *restrict jarray,
283 	rsb_coo_idx_t *restrict biarray,
284 	rsb_coo_idx_t *restrict bjarray,
285 	float complex *array,
286 	rsb_nnz_idx_t length,
287 	rsb_coo_idx_t *restrict iresult,
288 	rsb_coo_idx_t *restrict jresult,
289 	rsb_coo_idx_t *restrict biresult,
290 	rsb_coo_idx_t *restrict bjresult,
291 	float complex *restrict result)
292 ;
293 
294 void rsb_do_merge_float_complex_VBR(
295 		const rsb_coo_idx_t* restrict ileft, const rsb_coo_idx_t* restrict iright,  rsb_coo_idx_t*restrict iresult,
296 		const rsb_coo_idx_t* restrict jleft, const rsb_coo_idx_t* restrict jright,  rsb_coo_idx_t*restrict jresult,
297 const rsb_coo_idx_t * restrict bileft, const rsb_coo_idx_t * restrict biright, rsb_coo_idx_t * restrict biresult,const rsb_coo_idx_t * restrict bjleft, const rsb_coo_idx_t * restrict bjright, rsb_coo_idx_t * restrict bjresult,		const float complex* left, const float complex* restrict right,  float complex* restrict result,
298 		rsb_nnz_idx_t left_length,
299 		rsb_nnz_idx_t right_length )
300 
301 ;
302 rsb_err_t rsb_do_mergesort_double_complex_VBR(
303 	rsb_coo_idx_t *restrict iarray,
304 	rsb_coo_idx_t *restrict jarray,
305 	rsb_coo_idx_t *restrict biarray,
306 	rsb_coo_idx_t *restrict bjarray,
307 	double complex *array,
308 	rsb_nnz_idx_t length,
309 	rsb_coo_idx_t *restrict iresult,
310 	rsb_coo_idx_t *restrict jresult,
311 	rsb_coo_idx_t *restrict biresult,
312 	rsb_coo_idx_t *restrict bjresult,
313 	double complex *restrict result)
314 ;
315 
316 void rsb_do_merge_double_complex_VBR(
317 		const rsb_coo_idx_t* restrict ileft, const rsb_coo_idx_t* restrict iright,  rsb_coo_idx_t*restrict iresult,
318 		const rsb_coo_idx_t* restrict jleft, const rsb_coo_idx_t* restrict jright,  rsb_coo_idx_t*restrict jresult,
319 const rsb_coo_idx_t * restrict bileft, const rsb_coo_idx_t * restrict biright, rsb_coo_idx_t * restrict biresult,const rsb_coo_idx_t * restrict bjleft, const rsb_coo_idx_t * restrict bjright, rsb_coo_idx_t * restrict bjresult,		const double complex* left, const double complex* restrict right,  double complex* restrict result,
320 		rsb_nnz_idx_t left_length,
321 		rsb_nnz_idx_t right_length )
322 
323 ;
324 #ifdef __cplusplus
325 }
326 #endif  /* __cplusplus */
327 
328 #endif /* RSB_MERGESORT_H_INCLUDED */
329 
330 /* @endcond */
331