~ubuntu-branches/ubuntu/precise/yagiuda/precise

« back to all changes in this revision

Viewing changes to src/nrutil.h

  • Committer: Bazaar Package Importer
  • Author(s): Joop Stakenborg
  • Date: 2005-08-22 20:20:13 UTC
  • Revision ID: james.westby@ubuntu.com-20050822202013-mhhxp4xirdxrdfx1
Tags: upstream-1.19
ImportĀ upstreamĀ versionĀ 1.19

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _NR_UTILS_H_
 
2
#define _NR_UTILS_H_
 
3
/*
 
4
static float sqrarg;
 
5
#define SQR(a) ((sqrarg=(a)) == 0.0 ? 0.0 : sqrarg*sqrarg)
 
6
 
 
7
static double dsqrarg;
 
8
#define DSQR(a) ((dsqrarg=(a)) == 0.0 ? 0.0 : dsqrarg*dsqrarg)
 
9
 
 
10
static double dmaxarg1,dmaxarg2;
 
11
#define DMAX(a,b) (dmaxarg1=(a),dmaxarg2=(b),(dmaxarg1) > (dmaxarg2) ?\
 
12
        (dmaxarg1) : (dmaxarg2))
 
13
 
 
14
static double dminarg1,dminarg2;
 
15
#define DMIN(a,b) (dminarg1=(a),dminarg2=(b),(dminarg1) < (dminarg2) ?\
 
16
        (dminarg1) : (dminarg2))
 
17
 
 
18
static float maxarg1,maxarg2;
 
19
#define FMAX(a,b) (maxarg1=(a),maxarg2=(b),(maxarg1) > (maxarg2) ?\
 
20
        (maxarg1) : (maxarg2))
 
21
 
 
22
static float minarg1,minarg2;
 
23
#define FMIN(a,b) (minarg1=(a),minarg2=(b),(minarg1) < (minarg2) ?\
 
24
        (minarg1) : (minarg2))
 
25
 
 
26
static long lmaxarg1,lmaxarg2;
 
27
#define LMAX(a,b) (lmaxarg1=(a),lmaxarg2=(b),(lmaxarg1) > (lmaxarg2) ?\
 
28
        (lmaxarg1) : (lmaxarg2))
 
29
 
 
30
static long lminarg1,lminarg2;
 
31
#define LMIN(a,b) (lminarg1=(a),lminarg2=(b),(lminarg1) < (lminarg2) ?\
 
32
        (lminarg1) : (lminarg2))
 
33
 
 
34
static int imaxarg1,imaxarg2;
 
35
#define IMAX(a,b) (imaxarg1=(a),imaxarg2=(b),(imaxarg1) > (imaxarg2) ?\
 
36
        (imaxarg1) : (imaxarg2))
 
37
 
 
38
static int iminarg1,iminarg2;
 
39
#define IMIN(a,b) (iminarg1=(a),iminarg2=(b),(iminarg1) < (iminarg2) ?\
 
40
        (iminarg1) : (iminarg2))
 
41
*/
 
42
#define SIGN(a,b) ((b) >= 0.0 ? fabs(a) : -fabs(a))
 
43
 
 
44
#if defined(__STDC__) || defined(ANSI) || defined(NRANSI) /* ANSI */
 
45
 
 
46
void nrerror(char error_text[]);
 
47
float *vector(long nl, long nh);
 
48
int *ivector(long nl, long nh);
 
49
unsigned char *cvector(long nl, long nh);
 
50
unsigned long *lvector(long nl, long nh);
 
51
double *dvector(long nl, long nh);
 
52
float **matrix(long nrl, long nrh, long ncl, long nch);
 
53
double **dmatrix(long nrl, long nrh, long ncl, long nch);
 
54
int **imatrix(long nrl, long nrh, long ncl, long nch);
 
55
float **submatrix(float **a, long oldrl, long oldrh, long oldcl, long oldch,
 
56
        long newrl, long newcl);
 
57
float **convert_matrix(float *a, long nrl, long nrh, long ncl, long nch);
 
58
float ***f3tensor(long nrl, long nrh, long ncl, long nch, long ndl, long ndh);
 
59
void free_vector(float *v, long nl, long nh);
 
60
void free_ivector(int *v, long nl, long nh);
 
61
void free_cvector(unsigned char *v, long nl, long nh);
 
62
void free_lvector(unsigned long *v, long nl, long nh);
 
63
void free_dvector(double *v, long nl, long nh);
 
64
void free_matrix(float **m, long nrl, long nrh, long ncl, long nch);
 
65
void free_dmatrix(double **m, long nrl, long nrh, long ncl, long nch);
 
66
void free_imatrix(int **m, long nrl, long nrh, long ncl, long nch);
 
67
void free_submatrix(float **b, long nrl, long nrh, long ncl, long nch);
 
68
void free_convert_matrix(float **b, long nrl, long nrh, long ncl, long nch);
 
69
void free_f3tensor(float ***t, long nrl, long nrh, long ncl, long nch,
 
70
        long ndl, long ndh);
 
71
 
 
72
#else /* ANSI */
 
73
/* traditional - K&R */
 
74
 
 
75
void nrerror();
 
76
float *vector();
 
77
float **matrix();
 
78
float **submatrix();
 
79
float **convert_matrix();
 
80
float ***f3tensor();
 
81
double *dvector();
 
82
double **dmatrix();
 
83
int *ivector();
 
84
int **imatrix();
 
85
unsigned char *cvector();
 
86
unsigned long *lvector();
 
87
void free_vector();
 
88
void free_dvector();
 
89
void free_ivector();
 
90
void free_cvector();
 
91
void free_lvector();
 
92
void free_matrix();
 
93
void free_submatrix();
 
94
void free_convert_matrix();
 
95
void free_dmatrix();
 
96
void free_imatrix();
 
97
void free_f3tensor();
 
98
 
 
99
#endif /* ANSI */
 
100
 
 
101
#endif /* _NR_UTILS_H_ */