~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Tina5/tina-libs/tina/sys/sys_MemDef.h

Version: ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /**********
  2  * 
  3  * Copyright (c) 2003, Division of Imaging Science and Biomedical Engineering,
  4  * University of Manchester, UK.  All rights reserved.
  5  * 
  6  * Redistribution and use in source and binary forms, with or without modification, 
  7  * are permitted provided that the following conditions are met:
  8  * 
  9  *   . Redistributions of source code must retain the above copyright notice, 
 10  *     this list of conditions and the following disclaimer.
 11  *    
 12  *   . Redistributions in binary form must reproduce the above copyright notice,
 13  *     this list of conditions and the following disclaimer in the documentation 
 14  *     and/or other materials provided with the distribution.
 15  * 
 16  *   . Neither the name of the University of Manchester nor the names of its
 17  *     contributors may be used to endorse or promote products derived from this 
 18  *     software without specific prior written permission.
 19  * 
 20  * 
 21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
 22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
 23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
 24  * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
 25  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
 26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
 27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
 29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
 30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
 31  * POSSIBILITY OF SUCH DAMAGE.
 32  *
 33  **********
 34  * 
 35  * Program :    TINA
 36  * File    :  $Source: /home/tina/cvs/tina-libs/tina/sys/sys_MemDef.h,v $
 37  * Date    :  $Date: 2005/01/23 19:10:21 $
 38  * Version :  $Revision: 1.4 $
 39  * CVS Id  :  $Id: sys_MemDef.h,v 1.4 2005/01/23 19:10:21 paul Exp $
 40  *
 41  * Notes :
 42  *
 43  *********
 44 */
 45 #ifndef TINA_SYS_MEM_DEF_HDR
 46 #define TINA_SYS_MEM_DEF_HDR
 47 
 48 #include <tina/sys/sys_GenDef.h>
 49 #include <tina/sys/sysMem_dynamic_n_ts.h>
 50 
 51 /** Convenience form of ralloc **/
 52 #define talloc(type) \
 53     ((type *) ralloc(sizeof(type)))
 54 
 55 #define ts_ralloc(_ts_type) (_ts_type *) ts_ralloc_fn(sizeof(_ts_type), _ts_type ## _id)
 56 #define ts_nralloc(_n, _ts_type) (_ts_type *) ts_nralloc_fn(_n, sizeof(_ts_type), _ts_type ## _id)
 57 
 58 /** Dynamic Vector allocation macros **/
 59 #define ts_narray_alloc(_m1, _n1, _m2, _n2, _ts_type) \
 60         (_ts_type **) ts_narray_alloc_fn(_m1, _n1, _m2, _n2, \
 61                                          sizeof (_ts_type), _ts_type ## _id)
 62 
 63 #define ts_nlower_alloc(_n1, _n2, _ts_type) \
 64         (_ts_type **) ts_nlower_alloc_fn(_n1, _n2, sizeof (_ts_type), _ts_type ## _id)
 65 
 66 #define ts_nupper_alloc(_n1, _n2, _ts_type) \
 67         (_ts_type **) ts_nupper_alloc_fn(_n1, _n2, sizeof (_ts_type), _ts_type ## _id)
 68 
 69 /* ts_nvector_alloc: displaced vector of Ts: v[i]: n1 <= i < n2.
 70    If bounds ok then cast (an offset block of memory
 71    allocated with ntsralloc (which tags each element), else return NULL
 72    (cast appropriately) */
 73 #define ts_nvector_alloc(_n1, _n2, _ts_type) \
 74                 (((_n1) < (_n2))? \
 75                  (ts_nralloc((_n2) - (_n1), _ts_type) - (_n1)): \
 76                  (_ts_type *) NULL)
 77 
 78 /* ZERO IN PLACE MACROS */
 79 #define ts_nvector_zero_inplace(_v, _n1, _n2, _ts_type) \
 80         { \
 81           int _i; \
 82           nvector_zero_inplace((char*) _v, _n1, _n2, sizeof(_ts_type)); \
 83           for(_i = (_n1); _i < (_n2) ; _i++) \
 84             ((_ts_type *) (_v))[_i].ts_id = _ts_type ## _id; \
 85         }
 86 
 87 #define ts_narray_zero_inplace(_a, _m1, _n1, _m2, _n2, _ts_type) \
 88         { \
 89           int _j; \
 90           for(_j = (_m1); _j < (_m2) ; _j++) \
 91              ts_nvector_zero_inplace((((_ts_type **)_a)[_j]), _n1, _n2, _ts_type);\
 92         }
 93 
 94 #define ts_nlower_zero_inplace(_a, _n1, _n2, _ts_type) \
 95         if(_a) \
 96         { \
 97           int _j; \
 98           for (_j = (_n1); _j < (_n2); ++_j) \
 99                  ts_nvector_zero_inplace(_a[_j], _n1, _j + 1, _ts_type); \
100         }
101 
102 #define ts_nupper_zero_inplace(_a, _n1, _n2, _ts_type) \
103         if(_a) \
104         { \
105           int _j; \
106           for (_j = (_n1); _j < (_n2); ++_j) \
107                 ts_nvector_zero_inplace(_a[_j], _j, _n2, _ts_type); \
108         }
109 
110 
111 #define tvector_alloc(n1, n2, _type) \
112     ((_type *) nvector_alloc(n1, n2, sizeof(_type)))
113 #define pvector_alloc(n1, n2) \
114     ((void **) nvector_alloc(n1, n2, sizeof(void *)))
115 #define cvector_alloc(n1, n2) \
116     ((char *) nvector_alloc(n1, n2, sizeof(char)))
117 #define svector_alloc(n1, n2) \
118     ((short *) nvector_alloc(n1, n2, sizeof(short)))
119 #define ivector_alloc(n1, n2) \
120     ((int *) nvector_alloc(n1, n2, sizeof(int)))
121 #define fvector_alloc(n1, n2) \
122     ((float *) nvector_alloc(n1, n2, sizeof(float)))
123 #define dvector_alloc(n1, n2) \
124     ((double *) nvector_alloc(n1, n2, sizeof(double)))
125 /*
126 #define zvector_alloc(_n1, _n2) ts_nvector_alloc(_n1, _n2, Complex)
127 */
128 #define zvector_alloc(_n1, _n2) \
129     ((Complex *) ts_nvector_alloc_fn(_n1, _n2, sizeof(Complex), Complex_id ))
130 
131 #define tvector_copy(v, n1, n2, _type) \
132     ((_type *) nvector_copy((void *) v, n1, n2, sizeof(_type)))
133 #define pvector_copy(v, n1, n2) \
134     ((void **) nvector_copy(v, n1, n2, sizeof(void *)))
135 #define cvector_copy(v, n1, n2) \
136     ((char *) nvector_copy(v, n1, n2, sizeof(char)))
137 #define svector_copy(v, n1, n2) \
138     ((short *) nvector_copy(v, n1, n2, sizeof(short)))
139 #define ivector_copy(v, n1, n2) \
140     ((int *) nvector_copy(v, n1, n2, sizeof(int)))
141 #define fvector_copy(v, n1, n2) \
142     ((float *) nvector_copy(v, n1, n2, sizeof(float)))
143 #define dvector_copy(v, n1, n2) \
144     ((double *) nvector_copy(v, n1, n2, sizeof(double)))
145 #define zvector_copy(v, n1, n2) \
146     ((Complex *) nvector_copy(v, n1, n2, sizeof(Complex)))
147 
148 #define tvector_copy_inplace(w, v, n1, n2, _type) \
149     (nvector_copy_inplace((void *) w, (void *) v, n1, n2, sizeof(_type)))
150 #define pvector_copy_inplace(w, v, n1, n2) \
151     (nvector_copy_inplace(w, v, n1, n2, sizeof(void *)))
152 #define cvector_copy_inplace(w, v, n1, n2) \
153     (nvector_copy_inplace(w, v, n1, n2, sizeof(char)))
154 #define svector_copy_inplace(w, v, n1, n2) \
155     (nvector_copy_inplace(w, v, n1, n2, sizeof(short)))
156 #define ivector_copy_inplace(w, v, n1, n2) \
157     (nvector_copy_inplace(w, v, n1, n2, sizeof(int)))
158 #define fvector_copy_inplace(w, v, n1, n2) \
159     (nvector_copy_inplace(w, v, n1, n2, sizeof(float)))
160 #define dvector_copy_inplace(w, v, n1, n2) \
161     (nvector_copy_inplace(w, v, n1, n2, sizeof(double)))
162 #define zvector_copy_inplace(w, v, n1, n2) \
163     (nvector_copy_inplace(w, v, n1, n2, sizeof(Complex)))
164 
165 #define tvector_zero_inplace(v, n1, n2, _type) \
166     (nvector_zero_inplace((void *) v, n1, n2, sizeof(_type)))
167 #define pvector_zero_inplace(v, n1, n2) \
168     (nvector_zero_inplace(v, n1, n2, sizeof(void *)))
169 #define cvector_zero_inplace(v, n1, n2) \
170     (nvector_zero_inplace(v, n1, n2, sizeof(char)))
171 #define svector_zero_inplace(v, n1, n2) \
172     (nvector_zero_inplace(v, n1, n2, sizeof(short)))
173 #define ivector_zero_inplace(v, n1, n2) \
174     (nvector_zero_inplace(v, n1, n2, sizeof(int)))
175 #define fvector_zero_inplace(v, n1, n2) \
176     (nvector_zero_inplace(v, n1, n2, sizeof(float)))
177 #define dvector_zero_inplace(v, n1, n2) \
178     (nvector_zero_inplace(v, n1, n2, sizeof(double)))
179 #define zvector_zero_inplace(v, n1, n2) \
180     (ts_nvector_zero_inplace(v, n1, n2, Complex))
181 
182 /* define the free functions while attempting to
183    protect against future re-frees NAT 1999 */
184 #define tvector_free(v, n1, _type) \
185     (nvector_free((void *) v, n1, sizeof(_type)), v = NULL)
186 #define pvector_free(v, n1) \
187     (nvector_free(v, n1, sizeof(void *)), v = NULL)
188 #define cvector_free(v, n1) \
189     (nvector_free(v, n1, sizeof(char)), v = NULL)
190 #define svector_free(v, n1) \
191     (nvector_free(v, n1, sizeof(short)), v = NULL)
192 #define ivector_free(v, n1) \
193     (nvector_free(v, n1, sizeof(int)), v = NULL)
194 #define fvector_free(v, n1) \
195     (nvector_free(v, n1, sizeof(float)), v = NULL)
196 #define dvector_free(v, n1) \
197     (nvector_free(v, n1, sizeof(double)), v = NULL)
198 #define zvector_free(v, n1) \
199     (nvector_free(v, n1, sizeof(Complex)), v = NULL)
200 
201 /**
202 dynamic array allocation macros
203 **/
204 
205 #define tarray_alloc(m1, n1, m2, n2, _type) \
206     ((_type **) narray_alloc(m1, n1, m2, n2, sizeof(_type)))
207 #define parray_alloc(m1, n1, m2, n2) \
208     ((void ***) narray_alloc(m1, n1, m2, n2, sizeof(void *)))
209 #define carray_alloc(m1, n1, m2, n2) \
210     ((char **) narray_alloc(m1, n1, m2, n2, sizeof(char)))
211 #define sarray_alloc(m1, n1, m2, n2) \
212     ((short **) narray_alloc(m1, n1, m2, n2, sizeof(short)))
213 #define iarray_alloc(m1, n1, m2, n2) \
214     ((int **) narray_alloc(m1, n1, m2, n2, sizeof(int)))
215 #define farray_alloc(m1, n1, m2, n2) \
216     ((float **) narray_alloc(m1, n1, m2, n2, sizeof(float)))
217 #define darray_alloc(m1, n1, m2, n2) \
218     ((double **) narray_alloc(m1, n1, m2, n2, sizeof(double)))
219 #define zarray_alloc(_m1, _n1, _m2, _n2) \
220     ts_narray_alloc((_m1), (_n1), (_m2), (_n2), Complex)
221 
222 #define tarray_copy(a, m1, n1, m2, n2, _type) \
223     ((_type **) narray_copy((void *) a, m1, n1, m2, n2, sizeof(_type)))
224 #define parray_copy(a, m1, n1, m2, n2) \
225     ((void ***) narray_copy(a, m1, n1, m2, n2, sizeof(void *)))
226 #define carray_copy(a, m1, n1, m2, n2) \
227     ((char **) narray_copy(a, m1, n1, m2, n2, sizeof(char)))
228 #define sarray_copy(a, m1, n1, m2, n2) \
229     ((short **) narray_copy(a, m1, n1, m2, n2, sizeof(short)))
230 #define iarray_copy(a, m1, n1, m2, n2) \
231     ((int **) narray_copy(a, m1, n1, m2, n2, sizeof(int)))
232 #define farray_copy(a, m1, n1, m2, n2) \
233     ((float **) narray_copy(a, m1, n1, m2, n2, sizeof(float)))
234 #define darray_copy(a, m1, n1, m2, n2) \
235     ((double **) narray_copy(a, m1, n1, m2, n2, sizeof(double)))
236 #define zarray_copy(a, m1, n1, m2, n2) \
237     ((Complex **) narray_copy(a, m1, n1, m2, n2, sizeof(Complex)))
238 
239 #define tarray_copy_inplace(a, b, m1, n1, m2, n2, _type) \
240     narray_copy_inplace((void *) a, (void *) b, m1, n1, m2, n2, sizeof(_type))
241 #define parray_copy_inplace(b, a, m1, n1, m2, n2) \
242     narray_copy_inplace(b, a, m1, n1, m2, n2, sizeof(void *))
243 #define carray_copy_inplace(b, a, m1, n1, m2, n2) \
244     narray_copy_inplace(b, a, m1, n1, m2, n2, sizeof(char))
245 #define sarray_copy_inplace(b, a, m1, n1, m2, n2) \
246     narray_copy_inplace(b, a, m1, n1, m2, n2, sizeof(short))
247 #define iarray_copy_inplace(b, a, m1, n1, m2, n2) \
248     narray_copy_inplace(b, a, m1, n1, m2, n2, sizeof(int))
249 #define farray_copy_inplace(b, a, m1, n1, m2, n2) \
250     narray_copy_inplace(b, a, m1, n1, m2, n2, sizeof(float))
251 #define darray_copy_inplace(b, a, m1, n1, m2, n2) \
252     narray_copy_inplace(b, a, m1, n1, m2, n2, sizeof(double))
253 #define zarray_copy_inplace(b, a, m1, n1, m2, n2) \
254     narray_copy_inplace(b, a, m1, n1, m2, n2, sizeof(Complex))
255 
256 #define tarray_zero_inplace(a, m1, n1, m2, n2, _type) \
257     (narray_zero_inplace((void *) a, m1, n1, m2, n2, sizeof(_type)))
258 #define parray_zero_inplace(a, m1, n1, m2, n2) \
259     (narray_zero_inplace(a, m1, n1, m2, n2, sizeof(void *)))
260 #define carray_zero_inplace(a, m1, n1, m2, n2) \
261     (narray_zero_inplace(a, m1, n1, m2, n2, sizeof(char)))
262 #define sarray_zero_inplace(a, m1, n1, m2, n2) \
263     (narray_zero_inplace(a, m1, n1, m2, n2, sizeof(short)))
264 #define iarray_zero_inplace(a, m1, n1, m2, n2) \
265     (narray_zero_inplace(a, m1, n1, m2, n2, sizeof(int)))
266 #define farray_zero_inplace(a, m1, n1, m2, n2) \
267     (narray_zero_inplace(a, m1, n1, m2, n2, sizeof(float)))
268 #define darray_zero_inplace(a, m1, n1, m2, n2) \
269     (narray_zero_inplace(a, m1, n1, m2, n2, sizeof(double)))
270 #define zarray_zero_inplace(a, m1, n1, m2, n2) \
271     (ts_narray_zero_inplace(a, m1, n1, m2, n2, Complex))
272 
273 /* define the free functions while attempting to
274    protect against future re-frees NAT 1999 */
275 #define tarray_free(a, m1, n1, m2, n2, _type) \
276     (narray_free((void *) a, m1, n1, m2, n2, sizeof(_type)), a = NULL)
277 #define parray_free(a, m1, n1, m2, n2) \
278     (narray_free((char **)a, m1, n1, m2, n2, sizeof(void *)), a = NULL)
279 #define carray_free(a, m1, n1, m2, n2) \
280     (narray_free((char **)a, m1, n1, m2, n2, sizeof(char)), a = NULL)
281 #define sarray_free(a, m1, n1, m2, n2) \
282     (narray_free((char **)a, m1, n1, m2, n2, sizeof(short)), a = NULL)
283 #define iarray_free(a, m1, n1, m2, n2) \
284     (narray_free((char **)a, m1, n1, m2, n2, sizeof(int)), a = NULL)
285 #define farray_free(a, m1, n1, m2, n2) \
286     (narray_free((char **)a, m1, n1, m2, n2, sizeof(float)), a = NULL)
287 #define darray_free(a, m1, n1, m2, n2) \
288     (narray_free((char **)a, m1, n1, m2, n2, sizeof(double)), a = NULL)
289 #define zarray_free(a, m1, n1, m2, n2) \
290     (narray_free((char **)a, m1, n1, m2, n2, sizeof(Complex)), a = NULL)
291 
292 /**
293 dynamic lower triangle allocation macros
294 **/
295 
296 #define plower_alloc(n1, n2) \
297     ((void ***) nlower_alloc(n1, n2, sizeof(void *)))
298 #define clower_alloc(n1, n2) \
299     ((char **) nlower_alloc(n1, n2, sizeof(char)))
300 #define slower_alloc(n1, n2) \
301     ((short **) nlower_alloc(n1, n2, sizeof(short)))
302 #define ilower_alloc(n1, n2) \
303     ((int **) nlower_alloc(n1, n2, sizeof(int)))
304 #define flower_alloc(n1, n2) \
305     ((float **) nlower_alloc(n1, n2, sizeof(float)))
306 #define dlower_alloc(n1, n2) \
307     ((double **) nlower_alloc(n1, n2, sizeof(double)))
308 #define zlower_alloc(n1, n2) ts_nlower_alloc(n1, n2, Complex)
309 
310 #define plower_copy(a, n1, n2) \
311     ((void ***) nlower_copy(a, n1, n2, sizeof(void *)))
312 #define clower_copy(a, n1, n2) \
313     ((char **) nlower_copy(a, n1, n2, sizeof(char)))
314 #define slower_copy(a, n1, n2) \
315     ((short **) nlower_copy(a, n1, n2, sizeof(short)))
316 #define ilower_copy(a, n1, n2) \
317     ((int **) nlower_copy(a, n1, n2, sizeof(int)))
318 #define flower_copy(a, n1, n2) \
319     ((float **) nlower_copy(a, n1, n2, sizeof(float)))
320 #define dlower_copy(a, n1, n2) \
321     ((double **) nlower_copy(a, n1, n2, sizeof(double)))
322 #define zlower_copy(a, n1, n2) \
323     ((Complex **) nlower_copy(a, n1, n2, sizeof(Complex)))
324 
325 #define plower_copy_inplace(b, a, n1, n2) \
326     nlower_copy_inplace(b, a, n1, n2, sizeof(void *))
327 #define clower_copy_inplace(b, a, n1, n2) \
328     nlower_copy_inplace(b, a, n1, n2, sizeof(char))
329 #define slower_copy_inplace(b, a, n1, n2) \
330     nlower_copy_inplace(b, a, n1, n2, sizeof(short))
331 #define ilower_copy_inplace(b, a, n1, n2) \
332     nlower_copy_inplace(b, a, n1, n2, sizeof(int))
333 #define flower_copy_inplace(b, a, n1, n2) \
334     nlower_copy_inplace(b, a, n1, n2, sizeof(float))
335 #define dlower_copy_inplace(b, a, n1, n2) \
336     nlower_copy_inplace(b, a, n1, n2, sizeof(double))
337 #define zlower_copy_inplace(b, a, n1, n2) \
338     nlower_copy_inplace(b, a, n1, n2, sizeof(Complex))
339 
340 #define plower_zero_inplace(a, n1, n2) \
341     ((void ***) nlower_zero_inplace(a, n1, n2, sizeof(void *)))
342 #define clower_zero_inplace(a, n1, n2) \
343     ((char **) nlower_zero_inplace(a, n1, n2, sizeof(char)))
344 #define slower_zero_inplace(a, n1, n2) \
345     ((short **) nlower_zero_inplace(a, n1, n2, sizeof(short)))
346 #define ilower_zero_inplace(a, n1, n2) \
347     ((int **) nlower_zero_inplace(a, n1, n2, sizeof(int)))
348 #define flower_zero_inplace(a, n1, n2) \
349     ((float **) nlower_zero_inplace(a, n1, n2, sizeof(float)))
350 #define dlower_zero_inplace(a, n1, n2) \
351     ((double **) nlower_zero_inplace(a, n1, n2, sizeof(double)))
352 #define zlower_zero_inplace(a, n1, n2) \
353     ((Complex **) nlower_zero_inplace(a, n1, n2, sizeof(Complex)))
354 
355 /* define the free functions while attempting to
356    protect against future re-frees NAT 1999 */
357 #define plower_free(a, n1, n2) \
358     (nlower_free((char **)a, n1, n2, sizeof(void *)) , a = NULL)
359 #define clower_free(a, n1, n2) \
360     (nlower_free((char **)a, n1, n2, sizeof(char)) , a = NULL)
361 #define slower_free(a, n1, n2) \
362     (nlower_free((char **)a, n1, n2, sizeof(short)) , a = NULL)
363 #define ilower_free(a, n1, n2) \
364     (nlower_free((char **)a, n1, n2, sizeof(int)) , a = NULL)
365 #define flower_free(a, n1, n2) \
366     (nlower_free((char **)a, n1, n2, sizeof(float)) , a = NULL)
367 #define dlower_free(a, n1, n2) \
368     (nlower_free((char **)a, n1, n2, sizeof(double)) , a = NULL)
369 #define zlower_free(a, n1, n2) \
370     (nlower_free((char **)a, n1, n2, sizeof(Complex)) , a = NULL)
371 
372 /**
373 dynamic upper triangle allocation macros
374 **/
375 
376 #define pupper_alloc(n1, n2) \
377     ((void ***) nupper_alloc(n1, n2, sizeof(void *)))
378 #define cupper_alloc(n1, n2) \
379     ((char **) nupper_alloc(n1, n2, sizeof(char)))
380 #define supper_alloc(n1, n2) \
381     ((short **) nupper_alloc(n1, n2, sizeof(short)))
382 #define iupper_alloc(n1, n2) \
383     ((int **) nupper_alloc(n1, n2, sizeof(int)))
384 #define fupper_alloc(n1, n2) \
385     ((float **) nupper_alloc(n1, n2, sizeof(float)))
386 #define dupper_alloc(n1, n2) \
387     ((double **) nupper_alloc(n1, n2, sizeof(double)))
388 #define zupper_alloc(n1, n2) ts_nupper_alloc(n1, n2, Complex)
389 
390 #define pupper_copy(a, n1, n2) \
391     ((void ***) nupper_copy(a, n1, n2, sizeof(void *)))
392 #define cupper_copy(a, n1, n2) \
393     ((char **) nupper_copy(a, n1, n2, sizeof(char)))
394 #define supper_copy(a, n1, n2) \
395     ((short **) nupper_copy(a, n1, n2, sizeof(short)))
396 #define iupper_copy(a, n1, n2) \
397     ((int **) nupper_copy(a, n1, n2, sizeof(int)))
398 #define fupper_copy(a, n1, n2) \
399     ((float **) nupper_copy(a, n1, n2, sizeof(float)))
400 #define dupper_copy(a, n1, n2) \
401     ((double **) nupper_copy(a, n1, n2, sizeof(double)))
402 #define zupper_copy(a, n1, n2) \
403     ((Complex **) nupper_copy(a, n1, n2, sizeof(Complex)))
404 
405 #define pupper_copy_inplace(b, a, n1, n2) \
406     nupper_copy_inplace(b, a, n1, n2, sizeof(void *))
407 #define cupper_copy_inplace(b, a, n1, n2) \
408     nupper_copy_inplace(b, a, n1, n2, sizeof(char))
409 #define supper_copy_inplace(b, a, n1, n2) \
410     nupper_copy_inplace(b, a, n1, n2, sizeof(short))
411 #define iupper_copy_inplace(b, a, n1, n2) \
412     nupper_copy_inplace(b, a, n1, n2, sizeof(int))
413 #define fupper_copy_inplace(b, a, n1, n2) \
414     nupper_copy_inplace(b, a, n1, n2, sizeof(float))
415 #define dupper_copy_inplace(b, a, n1, n2) \
416     nupper_copy_inplace(b, a, n1, n2, sizeof(double))
417 #define zupper_copy_inplace(b, a, n1, n2) \
418     nupper_copy_inplace(b, a, n1, n2, sizeof(Complex))
419 
420 #define pupper_zero_inplace(a, n1, n2) \
421     ((void ***) nupper_zero_inplace(a, n1, n2, sizeof(void *)))
422 #define cupper_zero_inplace(a, n1, n2) \
423     ((char **) nupper_zero_inplace(a, n1, n2, sizeof(char)))
424 #define supper_zero_inplace(a, n1, n2) \
425     ((short **) nupper_zero_inplace(a, n1, n2, sizeof(short)))
426 #define iupper_zero_inplace(a, n1, n2) \
427     ((int **) nupper_zero_inplace(a, n1, n2, sizeof(int)))
428 #define fupper_zero_inplace(a, n1, n2) \
429     ((float **) nupper_zero_inplace(a, n1, n2, sizeof(float)))
430 #define dupper_zero_inplace(a, n1, n2) \
431     ((double **) nupper_zero_inplace(a, n1, n2, sizeof(double)))
432 #define zupper_zero_inplace(a, n1, n2) ts_nupper_zero_inplace(a, n1, n2, Complex)
433 
434 /* define the free functions while attempting to
435    protect against future re-frees NAT 1999 */
436 #define pupper_free(a, n1, n2) \
437     (nupper_free((char **)a, n1, n2, sizeof(void *)), a = NULL)
438 #define cupper_free(a, n1, n2) \
439     (nupper_free((char **)a, n1, n2, sizeof(char)), a = NULL)
440 #define supper_free(a, n1, n2) \
441     (nupper_free((char **)a, n1, n2, sizeof(short)), a = NULL)
442 #define iupper_free(a, n1, n2) \
443     (nupper_free((char **)a, n1, n2, sizeof(int)), a = NULL)
444 #define fupper_free(a, n1, n2) \
445     (nupper_free((char **)a, n1, n2, sizeof(float)), a = NULL)
446 #define dupper_free(a, n1, n2) \
447     (nupper_free((char **)a, n1, n2, sizeof(double)), a = NULL)
448 #define zupper_free(a, n1, n2) \
449     (nupper_free((char **)a, n1, n2, sizeof(Complex)), a = NULL)
450 
451 #endif /* TINA_SYS_MEM_DEF_HDR */
452 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.