Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://www.mrao.cam.ac.uk/~bn204/devman/dust/nrutil_8h-source.html
Дата изменения: Fri Jul 11 10:32:07 2008 Дата индексирования: Tue Oct 2 11:46:48 2012 Кодировка: Поисковые слова: sirds |
00001 00002 00003 #ifndef _NR_UTILS_H_ 00004 #define _NR_UTILS_H_ 00005 00006 static float sqrarg; 00007 #define SQR(a) ((sqrarg=(a)) == 0.0 ? 0.0 : sqrarg*sqrarg) 00008 00009 static double dsqrarg; 00010 #define DSQR(a) ((dsqrarg=(a)) == 0.0 ? 0.0 : dsqrarg*dsqrarg) 00011 00012 static double dmaxarg1,dmaxarg2; 00013 #define DMAX(a,b) (dmaxarg1=(a),dmaxarg2=(b),(dmaxarg1) > (dmaxarg2) ?\ 00014 (dmaxarg1) : (dmaxarg2)) 00015 00016 static double dminarg1,dminarg2; 00017 #define DMIN(a,b) (dminarg1=(a),dminarg2=(b),(dminarg1) < (dminarg2) ?\ 00018 (dminarg1) : (dminarg2)) 00019 00020 static float maxarg1,maxarg2; 00021 #define FMAX(a,b) (maxarg1=(a),maxarg2=(b),(maxarg1) > (maxarg2) ?\ 00022 (maxarg1) : (maxarg2)) 00023 00024 static float minarg1,minarg2; 00025 #define FMIN(a,b) (minarg1=(a),minarg2=(b),(minarg1) < (minarg2) ?\ 00026 (minarg1) : (minarg2)) 00027 00028 static long lmaxarg1,lmaxarg2; 00029 #define LMAX(a,b) (lmaxarg1=(a),lmaxarg2=(b),(lmaxarg1) > (lmaxarg2) ?\ 00030 (lmaxarg1) : (lmaxarg2)) 00031 00032 static long lminarg1,lminarg2; 00033 #define LMIN(a,b) (lminarg1=(a),lminarg2=(b),(lminarg1) < (lminarg2) ?\ 00034 (lminarg1) : (lminarg2)) 00035 00036 static int imaxarg1,imaxarg2; 00037 #define IMAX(a,b) (imaxarg1=(a),imaxarg2=(b),(imaxarg1) > (imaxarg2) ?\ 00038 (imaxarg1) : (imaxarg2)) 00039 00040 static int iminarg1,iminarg2; 00041 #define IMIN(a,b) (iminarg1=(a),iminarg2=(b),(iminarg1) < (iminarg2) ?\ 00042 (iminarg1) : (iminarg2)) 00043 00044 #define SIGN(a,b) ((b) >= 0.0 ? fabs(a) : -fabs(a)) 00045 00046 #if defined(__STDC__) || defined(ANSI) || defined(NRANSI) /* ANSI */ 00047 00048 void nrerror(char error_text[]); 00049 float *vector(long nl, long nh); 00050 int *ivector(long nl, long nh); 00051 unsigned char *cvector(long nl, long nh); 00052 unsigned long *lvector(long nl, long nh); 00053 double *dvector(long nl, long nh); 00054 float **matrix(long nrl, long nrh, long ncl, long nch); 00055 double **dmatrix(long nrl, long nrh, long ncl, long nch); 00056 int **imatrix(long nrl, long nrh, long ncl, long nch); 00057 float **submatrix(float **a, long oldrl, long oldrh, long oldcl, long oldch, 00058 long newrl, long newcl); 00059 float **convert_matrix(float *a, long nrl, long nrh, long ncl, long nch); 00060 float ***f3tensor(long nrl, long nrh, long ncl, long nch, long ndl, long ndh); 00061 void free_vector(float *v, long nl, long nh); 00062 void free_ivector(int *v, long nl, long nh); 00063 void free_cvector(unsigned char *v, long nl, long nh); 00064 void free_lvector(unsigned long *v, long nl, long nh); 00065 void free_dvector(double *v, long nl, long nh); 00066 void free_matrix(float **m, long nrl, long nrh, long ncl, long nch); 00067 void free_dmatrix(double **m, long nrl, long nrh, long ncl, long nch); 00068 void free_imatrix(int **m, long nrl, long nrh, long ncl, long nch); 00069 void free_submatrix(float **b, long nrl, long nrh, long ncl, long nch); 00070 void free_convert_matrix(float **b, long nrl, long nrh, long ncl, long nch); 00071 void free_f3tensor(float ***t, long nrl, long nrh, long ncl, long nch, 00072 long ndl, long ndh); 00073 00074 #else /* ANSI */ 00075 /* traditional - K&R */ 00076 00077 void nrerror(); 00078 float *vector(); 00079 float **matrix(); 00080 float **submatrix(); 00081 float **convert_matrix(); 00082 float ***f3tensor(); 00083 double *dvector(); 00084 double **dmatrix(); 00085 int *ivector(); 00086 int **imatrix(); 00087 unsigned char *cvector(); 00088 unsigned long *lvector(); 00089 void free_vector(); 00090 void free_dvector(); 00091 void free_ivector(); 00092 void free_cvector(); 00093 void free_lvector(); 00094 void free_matrix(); 00095 void free_submatrix(); 00096 void free_convert_matrix(); 00097 void free_dmatrix(); 00098 void free_imatrix(); 00099 void free_f3tensor(); 00100 00101 #endif /* ANSI */ 00102 00103 #endif /* _NR_UTILS_H_ */