Garfield++ 5.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
nrutil.c
Go to the documentation of this file.
1#include <stddef.h>
2#include <stdio.h>
3#include <stdlib.h>
4
5#include "NR.h"
6
7#define NR_END 1
8#define FREE_ARG char *
9
10#ifdef __cplusplus
11namespace neBEM {
12#endif
13
14void nrerror(const char error_text[])
15/* Numerical Recipes standard error handler */
16{
17 fprintf(stderr, " run_time error......\n");
18 fprintf(stderr, "%s\n", error_text);
19 fprintf(stderr, ".....now exiting to system.....\n");
20 exit(1);
21}
22
23float *fvector(long nl, long nh)
24/* allocate a float vector with subscript range v[nl...nh] */
25{
26 float *v;
27
28 v = (float *)malloc((size_t)((nh - nl + 1 + NR_END) * sizeof(float)));
29 if (!v) nrerror("allocation failure in vector()");
30 return v - nl + NR_END;
31}
32
33int *ivector(long nl, long nh)
34/* allocate a int vector with subscript range v[nl...nh] */
35{
36 int *v;
37
38 v = (int *)malloc((size_t)((nh - nl + 1 + NR_END) * sizeof(int)));
39 if (!v) nrerror("allocation failure in ivector()");
40 return v - nl + NR_END;
41}
42
43unsigned char *cvector(long nl, long nh)
44/* allocate an unsigned char vector with subscript range v[nl...nh] */
45{
46 unsigned char *v;
47
48 v = (unsigned char *)malloc(
49 (size_t)((nh - nl + 1 + NR_END) * sizeof(unsigned char)));
50 if (!v) nrerror("allocation failure in cvector()");
51 return v - nl + NR_END;
52}
53
54unsigned long *lvector(long nl, long nh)
55/* allocate an unsigned long vector with subscript range v[nl...nh] */
56{
57 unsigned long *v;
58
59 v = (unsigned long *)malloc((size_t)((nh - nl + 1 + NR_END) * sizeof(long)));
60 if (!v) nrerror("allocation failure in lvector()");
61 return v - nl + NR_END;
62}
63
64double *dvector(long nl, long nh)
65/* allocate a double vector with subscript range v[nl...nh] */
66{
67 double *v;
68
69 v = (double *)malloc((size_t)((nh - nl + 1 + NR_END) * sizeof(double)));
70 if (!v) nrerror("allocation failure in dvector()");
71 return v - nl + NR_END;
72}
73
74float **fmatrix(long nrl, long nrh, long ncl, long nch)
75/*allocate a float matrix with subscript range m[nrl...nrh][ncl...nch] */
76{
77 long i, nrow = nrh - nrl + 1, ncol = nch - ncl + 1;
78 float **m;
79
80 /* allocate pointers to rows */
81 m = (float **)malloc((size_t)((nrow + NR_END) * sizeof(float *)));
82 if (!m) nrerror("allocation failure 1 in matrix()");
83 m += NR_END;
84 m -= nrl;
85
86 /* allocate rows and set pointers to them */
87 m[nrl] = (float *)malloc((size_t)((nrow * ncol + NR_END) * sizeof(float)));
88 if (!m[nrl]) nrerror("allocation failure 2 in matrix()");
89 m[nrl] += NR_END;
90 m[nrl] -= ncl;
91
92 for (i = nrl + 1; i <= nrh; i++) m[i] = m[i - 1] + ncol;
93
94 /* return pointer to array of pointer to rows */
95 return m;
96}
97
98double **dmatrix(long nrl, long nrh, long ncl, long nch)
99/* allocate a double with subscript range m[nrl..nrh][ncl..nch] */
100{
101 long i, nrow = nrh - nrl + 1, ncol = nch - ncl + 1;
102 double **m;
103
104 /* allocate pointer to row */
105 m = (double **)malloc((size_t)((nrow + NR_END) * sizeof(double *)));
106 if (!m) nrerror("allocation faliore 1 in matrix()");
107 m += NR_END;
108 m -= nrl;
109
110 /* allocate row and set pointer to them */
111 m[nrl] = (double *)malloc((size_t)((nrow * ncol + NR_END) * sizeof(double)));
112 if (!m[nrl]) nrerror("allocation faliore 2 in matrix()");
113 m[nrl] += NR_END;
114 m[nrl] -= ncl;
115
116 for (i = nrl + 1; i <= nrh; i++) m[i] = m[i - 1] + ncol;
117
118 /* return pointer to array of pointer to rows */
119 return m;
120}
121
122int **imatrix(long nrl, long nrh, long ncl, long nch)
123/* allocate an int with subscript range m[nrl..nrh][ncl..nch] */
124{
125 long i, nrow = nrh - nrl + 1, ncol = nch - ncl + 1;
126 int **m;
127
128 /* allocate pointer to row */
129 m = (int **)malloc((size_t)((nrow + NR_END) * sizeof(int *)));
130 if (!m) nrerror("allocation faliore 1 in matrix()");
131 m += NR_END;
132 m -= nrl;
133
134 /* allocate row and set pointer to them */
135 m[nrl] = (int *)malloc((size_t)((nrow * ncol + NR_END) * sizeof(int)));
136 if (!m[nrl]) nrerror("allocation falior 2 in matrix()");
137 m[nrl] += NR_END;
138 m[nrl] -= ncl;
139
140 for (i = nrl + 1; i <= nrh; i++) m[i] = m[i - 1] + ncol;
141
142 /* return pointer to array of pointer to rows */
143 return m;
144}
145
146float **submatrix(float **a, long oldrl, long oldrh, long oldcl, long /*oldch*/,
147 long newrl, long newcl)
148/* point a submatrix [newrl...][newcl...] to a [oldrl...][oldcl...] */
149{
150 long i, j, nrow = oldrh - oldrl + 1, ncol = oldcl - newcl;
151 float **m;
152
153 /* allocate array of pointers to rows */
154 m = (float **)malloc((size_t)((nrow + NR_END) * sizeof(float *)));
155 if (!m) nrerror(" allocation failure in submatrix()");
156 m += NR_END;
157 m -= newrl;
158
159 /*set pointers to rows */
160 for (i = oldrl, j = newrl; i <= oldrh; i++, j++) m[j] = a[i] + ncol;
161
162 /* return pointer to array of pointers to rows */
163 return m;
164}
165
166float **convert_matrix(float *a, long nrl, long nrh, long ncl, long nch)
167/* allocate a float matrix m[nrl..nrh][ncl..nch] that points to the matrix
168 declared in the standard C manner as a[nrow][ncol], where nrh-nrl+1 and
169 ncol=nch-ncl+1. the routine should be called with the address &a[0][0]
170 as the first argument. */
171{
172 long i, j, nrow = nrh - nrl + 1, ncol = nch - ncl + 1;
173 float **m;
174
175 /* allocate pointers to rows */
176 m = (float **)malloc((size_t)((nrow + NR_END) * sizeof(float *)));
177 if (!m) nrerror(" allocation failure in convert_matrix()");
178 m += NR_END;
179 m -= nrl;
180
181 /*set pointers to rows */
182 m[nrl] = a - ncl;
183 for (i = 1, j = nrl + 1; i < nrow; i++, j++) m[j] = m[j - 1] + ncol;
184 /* return pointer to array of pointers to rows */
185 return m;
186}
187
188float ***f3tensor(long nrl, long nrh, long ncl, long nch, long ndl, long ndh)
189/* allocate a float 3tensor with range t[nrl..nrh][ncl..nch][mdl..ndh] */
190{
191 long i, j, nrow = nrh - nrl + 1, ncol = nch - ncl + 1, ndep = ndh - ndl + 1;
192 float ***t;
193
194 /* allocate pointers to pointers to rows */
195 t = (float ***)malloc((size_t)((nrow + NR_END) * sizeof(float **)));
196 if (!t) nrerror("allocation failure 1 in f3tensor()");
197 t += NR_END;
198 t -= nrl;
199
200 /* allocate pointers to rows and set pointers to them */
201 t[nrl] = (float **)malloc((size_t)((nrow * ncol + NR_END) * sizeof(float *)));
202 if (!t[nrl]) nrerror("allocation failure 2 in f3tensor()");
203 t[nrl] += NR_END;
204 t[nrl] -= ncl;
205
206 /* allocate rows and set pointers to them */
207 t[nrl][ncl] =
208 (float *)malloc((size_t)((nrow * ncol * ndep + NR_END) * sizeof(float)));
209 if (!t[nrl][ncl]) nrerror("allocation failure 3 in f3tensor()");
210 t[nrl][ncl] += NR_END;
211 t[nrl][ncl] -= ndl;
212
213 for (j = ncl + 1; j <= nch; j++) t[nrl][j] = t[nrl][j - 1] + ndep;
214 for (i = nrl + 1; i <= nrh; i++) {
215 t[i] = t[i - 1] + ncol;
216 t[i][ncl] = t[i - 1][ncl] + ncol * ndep;
217 for (j = ncl + 1; j <= nch; j++) t[i][j] = t[i][j - 1] + ndep;
218 }
219 /* return pointer to array of pointers to rows */
220 return t;
221}
222
223double ***d3tensor(long nrl, long nrh, long ncl, long nch, long ndl, long ndh)
224
225/* allocate a double 3tensor with range t[nrl..nrh][ncl..nch][mdl..ndh] */
226{
227 long i, j, nrow = nrh - nrl + 1, ncol = nch - ncl + 1, ndep = ndh - ndl + 1;
228 double ***t;
229
230 /* allocate pointers to pointers to rows */
231 t = (double ***)malloc((size_t)((nrow + NR_END) * sizeof(double **)));
232 if (!t) nrerror("allocation failure 1 in d3tensor()");
233 t += NR_END;
234 t -= nrl;
235
236 /* allocate pointers to rows and set pointers to them */
237 t[nrl] =
238 (double **)malloc((size_t)((nrow * ncol + NR_END) * sizeof(double *)));
239 if (!t[nrl]) nrerror("allocation failure 2 in d3tensor()");
240 t[nrl] += NR_END;
241 t[nrl] -= ncl;
242
243 /* allocate rows and set pointers to them */
244 t[nrl][ncl] = (double *)malloc(
245 (size_t)((nrow * ncol * ndep + NR_END) * sizeof(double)));
246 if (!t[nrl][ncl]) nrerror("allocation failure 3 in d3tensor()");
247 t[nrl][ncl] += NR_END;
248 t[nrl][ncl] -= ndl;
249
250 for (j = ncl + 1; j <= nch; j++) t[nrl][j] = t[nrl][j - 1] + ndep;
251 for (i = nrl + 1; i <= nrh; i++) {
252 t[i] = t[i - 1] + ncol;
253 t[i][ncl] = t[i - 1][ncl] + ncol * ndep;
254 for (j = ncl + 1; j <= nch; j++) t[i][j] = t[i][j - 1] + ndep;
255 }
256 /* return pointer to array of pointers to rows */
257 return t;
258}
259
260// from f4tensor.txt
261double ****d4tensor(long nrl, long nrh, long ncl, long nch, long ndl, long ndh,
262 long nwl, long nwh)
263// allocate a double 4tensor with range
264// t[nrl..nrh][ncl..nch][ndl..ndh][nwl..nwh]
265{
266 long i, j, k, nrow = nrh - nrl + 1, ncol = nch - ncl + 1,
267 ndep = ndh - ndl + 1, nwid = nwh - nwl + 1;
268 double ****t;
269
270 // allocate pointers to pointers to pointers to rows
271 t = (double ****)malloc((size_t)((nrow + NR_END) * sizeof(double ***)));
272 if (!t) nrerror("allocation failure 1 in d4tensor()");
273 t += NR_END;
274 t -= nrl;
275
276 // allocate pointers to pointers to rows and set pointers to them
277 t[nrl] =
278 (double ***)malloc((size_t)((nrow * ncol + NR_END) * sizeof(double **)));
279 if (!t[nrl]) nrerror("allocation failure 2 in d4tensor()");
280 t[nrl] += NR_END;
281 t[nrl] -= ncl;
282
283 // allocate pointers to rows and set pointers to them
284 t[nrl][ncl] = (double **)malloc(
285 (size_t)((nrow * ncol * ndep + NR_END) * sizeof(double *)));
286 if (!t[nrl][ncl]) nrerror("allocation failure 3 in d4tensor()");
287 t[nrl][ncl] += NR_END;
288 t[nrl][ncl] -= ndl;
289
290 // allocate rows and set pointers to them
291 t[nrl][ncl][ndl] = (double *)malloc(
292 (size_t)((nrow * ncol * ndep * nwid + NR_END) * sizeof(double)));
293 if (!t[nrl][ncl][ndl]) nrerror("allocation failure 4 in d4tensor()");
294 t[nrl][ncl][ndl] += NR_END;
295 t[nrl][ncl][ndl] -= nwl;
296
297 for (i = nrl; i <= nrh; i++) {
298 if (i > nrl) {
299 t[i] = t[i - 1] + ncol;
300 t[i][ncl] = t[i - 1][ncl] + ncol * ndep;
301 t[i][ncl][ndl] = t[i - 1][ncl][ndl] + ncol * ndep * nwid;
302 }
303 for (j = ncl; j <= nch; j++) {
304 if (j > ncl) {
305 t[i][j] = t[i][j - 1] + ndep;
306 t[i][j][ndl] = t[i][j - 1][ndl] + ndep * nwid;
307 }
308
309 for (k = ndl; k <= ndh; k++) {
310 if (k > ndl) t[i][j][k] = t[i][j][k - 1] + nwid;
311 }
312 }
313 }
314
315 // return pointer to pointer to array of pointers to rows
316 return t;
317}
318
319/* from f4tensor2.c - inability to start from non-zero index
320double ****d4tensor(int nrl, int nrh, int ncl, int nch, int ndl, int ndh, int
321nsl, int nsh)
322// for example: d4tensor(0,NX-1,0,NY-1,0,NZ-1,0,NS)
323// allocate a double 3tensor with range t[nrl..nrh][ncl..nch][ndl..ndh]
324{
325 int i,j,k,nrow=nrh-nrl+1,ncol=nch-ncl+1,ndep=ndh-ndl+1,nsext=nsh-nsl+1;
326 double ****tt;
327
328 // allocate pointers to pointers to rows
329 tt=(double ****) malloc((size_t)((nrow)*sizeof(double***)));
330 if (!tt) nrerror("allocation failure 1 in d4tensor()");
331 tt -= nrl;
332
333 // allocate pointers to rows and set pointers to them
334 tt[nrl]=(double ***) malloc((size_t)((nrow*ncol)*sizeof(double**)));
335 if (!tt[nrl]) nrerror("allocation failure 2 in d4tensor()");
336 tt[nrl] -= ncl;
337
338 // allocate rows and set pointers to them
339 tt[nrl][ncl]=(double **)
340malloc((size_t)((nrow*ncol*ndep)*sizeof(double*))); if (!tt[nrl][ncl])
341nrerror("allocation failure 3 in d4tensor()"); tt[nrl][ncl] -= ndl;
342
343 // allocate rows and set pointers to them
344 tt[nrl][ncl][ndl]=(double *)
345malloc((size_t)((nrow*ncol*ndep*nsext)*sizeof(double))); if (!tt[nrl][ncl][ndl])
346nrerror("allocation failure 4 in d4tensor()"); tt[nrl][ncl][ndl] -= nsl;
347
348
349 for(i=nrl+1;i<=nrh;i++) tt[i]=tt[i-1]+ncol;
350 //////////////////////////////////////////////////////////////
351 for(j=ncl+1;j<=nch;j++) tt[nrl][j]=tt[nrl][j-1]+ndep;
352 for(i=nrl+1;i<=nrh;i++)
353 {
354 tt[i][ncl]=tt[i-1][ncl]+ncol*ndep;
355 for(j=ncl+1;j<=nch;j++)
356 tt[i][j]=tt[i][j-1]+ndep;
357 }
358 ////////////////////////////////////////////////////////////////
359 for(k=ndl+1;k<=ndh;k++) tt[nrl][ncl][k]=tt[nrl][ncl][k-1]+nsext; //
360(0;0;0~ndh).
361
362 for(i=nrl+1;i<=nrh;i++) // (1~nrh;0;0~ndh).
363 {
364 tt[i][ncl][ndl]=tt[i-1][ncl][ndl]+ncol*ndep*nsext;
365 for(k=ndl+1;k<=ndh;k++)
366 tt[i][ncl][k]=tt[i][ncl][k-1]+nsext;
367 }
368 for(j=ncl+1;j<=nch;j++) // (0;1~nch;0~ndh).
369 {
370 tt[nrl][j][ndl]=tt[nrl][j-1][ndl]+ndep*nsext;
371 for(k=ndl+1;k<=ndh;k++)
372 tt[nrl][j][k]=tt[nrl][j][k-1]+nsext;
373 }
374
375 for(i=nrl+1;i<=nrh;i++) //
376(1~nrh;1~nch;0~ndh).
377 {
378 tt[i][ncl][ndl]=tt[i-1][ncl][ndl]+ncol*ndep*nsext;
379 for(j=ncl+1;j<=nch;j++)
380 {
381 tt[i][j][ndl]=tt[i][j-1][ndl]+ndep*nsext;
382 for(k=ndl+1;k<=ndh;k++)
383 tt[i][j][k]=tt[i][j][k-1]+nsext;
384 }
385 }
386 // return pointer to array of pointers to rows
387 return tt;
388}
389
390
391// original version
392double ****d4tensor(long nrl, long nrh, long ncl, long nch, long ndl, long
393ndh,long nd4l,long nd4h)
394
395// allocate a double d4tensor with range
396t[nrl..nrh][ncl..nch][ndl..ndh][nd4l..nd4h]
397{
398 long i, j, k, nrow=nrh-nrl+1, ncol=nch-ncl+1,
399ndep=ndh-ndl+1,nd4th=nd4h-nd4l+1; double ****t;
400
401 // allocate pointers to pointers to pointers to rows
402 t=(double ****) malloc((size_t)((nrow+NR_END)*sizeof(double***)));
403 if(!t) nrerror("allocation failure 1 in d4tensor()");
404 t += NR_END;
405 t -= nrl;
406
407 // allocate pointers to pointers to rows and set pointers to them
408 t[nrl]=(double ***) malloc((size_t)((nrow*ncol+NR_END)*sizeof(double**)));
409 if(!t[nrl]) nrerror("allocation failure 2 in d4tensor()");
410 t[nrl] += NR_END;
411 t[nrl] -= ncl;
412
413 // allocate pointers to rows and set pointers to them
414 t[nrl][ncl]=(double **)
415malloc((size_t)((nrow*ncol*ndep+NR_END)*sizeof(double*))); if(!t[nrl][ncl])
416nrerror("allocation failure 3 in d4tensor()"); t[nrl][ncl] += NR_END;
417 t[nrl][ncl] -= ndl;
418
419 // allocate rows and set pointers to them
420 t[nrl][ncl][ndl]=(double *)
421malloc((size_t)((nrow*ncol*ndep*nd4th+NR_END)*sizeof(double)));
422 if(!t[nrl][ncl][ndl]) nrerror("allocation failure 4 in d4tensor()");
423 t[nrl][ncl][ndl] += NR_END;
424 t[nrl][ncl][ndl] -= nd4l;
425
426 for(k=ndl+1; k<=ndh; k++) t[nrl][ncl][k]=t[nrl][ncl][k-1]+nd4th;
427 for(j=ncl+1; j<=nch; j++)
428 {
429 t[nrl][j]=t[nrl][j-1]+ndep;
430 t[nrl][j][ndl]=t[nrl][j-1][ndl]+ndep*nd4th;
431 for(k=ndl+1; k<=ndh; k++)t[nrl][j][k]=t[nrl][j][k-1]+nd4th;
432 }
433 for(i=nrl+1; i<=nrh; i++)
434 {
435 t[i]=t[i-1]+ncol;
436 t[i][ncl]=t[i-1][ncl]+ncol*ndep;
437 for(j=ncl+1; j<=nch; j++)
438 {
439 t[i][j]=t[i][j-1]+ndep;
440 t[i][j][ndl]=t[i][j-1][ndl]+ndep*nd4th;
441 for(k=ndl+1; k<=ndh; k++)t[i][j][k]=t[i][j][k-1]+nd4th;
442 }
443
444 }
445 // return pointer to array of pointers to rows
446 return t;
447}
448*/
449
450/* free a float vector allocated with vector() */
451void free_fvector(float *v, long nl, long /*nh*/) {
452 free((FREE_ARG)(v + nl - NR_END));
453}
454
455/* free an int vector allocated with vector() */
456void free_ivector(int *v, long nl, long /*nh*/) {
457 free((FREE_ARG)(v + nl - NR_END));
458}
459
460/* free an unsigned char vector allocated with vector() */
461void free_cvector(unsigned char *v, long nl, long /*nh*/) {
462 free((FREE_ARG)(v + nl - NR_END));
463}
464
465/* free an unsigned long vector allocated with vector() */
466void free_lvector(unsigned long *v, long nl, long /*nh*/) {
467 free((FREE_ARG)(v + nl - NR_END));
468}
469
470/* free a double vector allocated with vector() */
471void free_dvector(double *v, long nl, long /*nh*/) {
472 free((FREE_ARG)(v + nl - NR_END));
473}
474
475/* free a float matrix allocated by matrix() */
476void free_fmatrix(float **m, long nrl, long /*nrh*/, long ncl, long /*nch*/) {
477 free((FREE_ARG)(m[nrl] + ncl - NR_END));
478 free((FREE_ARG)(m + nrl - NR_END));
479}
480
481/* free a double matrix allocated by dmatrix() */
482void free_dmatrix(double **m, long nrl, long /*nrh*/, long ncl, long /*nch*/) {
483 free((FREE_ARG)(m[nrl] + ncl - NR_END));
484 free((FREE_ARG)(m + nrl - NR_END));
485}
486
487/* free an int matrix allocated by imatrix() */
488void free_imatrix(int **m, long nrl, long /*nrh*/, long ncl, long /*nch*/) {
489 free((FREE_ARG)(m[nrl] + ncl - NR_END));
490 free((FREE_ARG)(m + nrl - NR_END));
491}
492
493/* free a submatrix allocated by submatrix() */
494void free_submatrix(float **b, long nrl, long /*nrh*/, long /*ncl*/,
495 long /*nch*/) {
496 free((FREE_ARG)(b + nrl - NR_END));
497}
498
499/* free a matrix allocated by convert_matrix() */
500void free_convert_matrix(float **b, long nrl, long /*nrh*/, long /*ncl*/,
501 long /*nch*/) {
502 free((FREE_ARG)(b + nrl - NR_END));
503}
504
505/* free a f3tensor allocated by f3tensor() */
506void free_f3tensor(float ***t, long nrl, long /*nrh*/, long ncl, long /*nch*/,
507 long ndl, long /*ndh*/) {
508 free((FREE_ARG)(t[nrl][ncl] + ndl - NR_END));
509 free((FREE_ARG)(t[nrl] + ncl - NR_END));
510 free((FREE_ARG)(t + nrl - NR_END));
511}
512
513/* free a d3tensor allocated by d3tensor() */
514void free_d3tensor(double ***t, long nrl, long /*nrh*/, long ncl, long /*nch*/,
515 long ndl, long /*ndh*/) {
516 free((FREE_ARG)(t[nrl][ncl] + ndl - NR_END));
517 free((FREE_ARG)(t[nrl] + ncl - NR_END));
518 free((FREE_ARG)(t + nrl - NR_END));
519}
520
521// from f4tensor.txt
522/* free a double d4tensor allocated by d4tensor() */
523void free_d4tensor(double ****t, long nrl, long /*nrh*/, long ncl, long /*nch*/,
524 long ndl, long /*ndh*/, long nwl, long /*nwh*/) {
525 free((FREE_ARG)(t[nrl][ncl][ndl] + nwl - NR_END));
526 free((FREE_ARG)(t[nrl][ncl] + ndl - NR_END));
527 free((FREE_ARG)(t[nrl] + ncl - NR_END));
528 free((FREE_ARG)(t + nrl - NR_END));
529}
530
531/* from f4tensor2.c - inability to start from non-zero index
532void free_d4tensor(double ****tt, int nrl, int nrh, int ncl, int nch,
533 int ndl, int ndh, int nsl, int nsh)
534// free a double d4tensor allocated by d4tensor()
535{
536 free((FREE_ARG) (tt[nrl][ncl][ndl]+nsl));
537 free((FREE_ARG) (tt[nrl][ncl]+ndl));
538 free((FREE_ARG) (tt[nrl]+ncl));
539 free((FREE_ARG) (tt+nrl));
540}
541
542// original version
543void free_d4tensor(double ****t,long nrl, long nrh, long ncl, long nch,
544 long ndl, long ndh, long nd4l, long nd4h)
545// free a d4tensor allocated by d4tensor()
546{
547 free((FREE_ARG) (t[nrl][ncl][ndl]+nd4l-NR_END));
548 free((FREE_ARG) (t[nrl][ncl]+ndl-NR_END));
549 free((FREE_ARG) (t[nrl]+ncl-NR_END));
550 free((FREE_ARG) (t+nrl-NR_END));
551}
552*/
553
554#ifdef __cplusplus
555} // namespace
556#endif
NRGLOBAL void nrerror()
unsigned long * lvector(long nl, long nh)
Definition nrutil.c:54
unsigned char * cvector(long nl, long nh)
Definition nrutil.c:43
void free_fmatrix(float **m, long nrl, long, long ncl, long)
Definition nrutil.c:476
float ** convert_matrix(float *a, long nrl, long nrh, long ncl, long nch)
Definition nrutil.c:166
float ** fmatrix(long nrl, long nrh, long ncl, long nch)
Definition nrutil.c:74
void free_dmatrix(double **m, long nrl, long, long ncl, long)
Definition nrutil.c:482
float * fvector(long nl, long nh)
Definition nrutil.c:23
void free_dvector(double *v, long nl, long)
Definition nrutil.c:471
void free_convert_matrix(float **b, long nrl, long, long, long)
Definition nrutil.c:500
#define NR_END
Definition nrutil.c:7
void free_f3tensor(float ***t, long nrl, long, long ncl, long, long ndl, long)
Definition nrutil.c:506
double *** d3tensor(long nrl, long nrh, long ncl, long nch, long ndl, long ndh)
Definition nrutil.c:223
double **** d4tensor(long nrl, long nrh, long ncl, long nch, long ndl, long ndh, long nwl, long nwh)
Definition nrutil.c:261
float *** f3tensor(long nrl, long nrh, long ncl, long nch, long ndl, long ndh)
Definition nrutil.c:188
void free_d4tensor(double ****t, long nrl, long, long ncl, long, long ndl, long, long nwl, long)
Definition nrutil.c:523
void free_submatrix(float **b, long nrl, long, long, long)
Definition nrutil.c:494
int * ivector(long nl, long nh)
Definition nrutil.c:33
void free_lvector(unsigned long *v, long nl, long)
Definition nrutil.c:466
double ** dmatrix(long nrl, long nrh, long ncl, long nch)
Definition nrutil.c:98
int ** imatrix(long nrl, long nrh, long ncl, long nch)
Definition nrutil.c:122
void free_ivector(int *v, long nl, long)
Definition nrutil.c:456
double * dvector(long nl, long nh)
Definition nrutil.c:64
#define FREE_ARG
Definition nrutil.c:8
void free_cvector(unsigned char *v, long nl, long)
Definition nrutil.c:461
void free_d3tensor(double ***t, long nrl, long, long ncl, long, long ndl, long)
Definition nrutil.c:514
void free_imatrix(int **m, long nrl, long, long ncl, long)
Definition nrutil.c:488
void free_fvector(float *v, long nl, long)
Definition nrutil.c:451
float ** submatrix(float **a, long oldrl, long oldrh, long oldcl, long, long newrl, long newcl)
Definition nrutil.c:146