[3] | 1 | /* NRLIN.H - include file */ |
---|
| 2 | |
---|
| 3 | #ifndef _NRLIN_H_ |
---|
| 4 | #define _NRLIN_H_ |
---|
| 5 | |
---|
| 6 | #define I_ARG_T int |
---|
| 7 | |
---|
| 8 | void choldc(float **a, int n, float p[]); |
---|
| 9 | void cholsl(float **a, int n, float p[], float b[], float x[]); |
---|
| 10 | void lubksb(float **a, int n, int *indx, float b[]); |
---|
| 11 | void ludcmp(float **a, int n, int *indx, float *d); |
---|
| 12 | |
---|
| 13 | void dcholdc(double **a, int n, double p[]); |
---|
| 14 | void dcholsl(double **a, int n, double p[], double b[], double x[]); |
---|
| 15 | void dlubksb(double **a, int n, int *indx, double b[]); |
---|
| 16 | void dludcmp(double **a, int n, int *indx, double *d); |
---|
| 17 | |
---|
| 18 | |
---|
| 19 | #define validate_dvector(a,b,c) a[(b)-1]=-322.0;a[(c)+1]=-722.0 |
---|
| 20 | #define validate_vector(a,b,c) a[(b)-1]=-322.0;a[(c)+1]=-722.0 |
---|
| 21 | #define valid_dvector(v,nl,nh) ((v!=(double *)NULL) && \ |
---|
| 22 | ((v[(nl)-1]==-322.0)&&(v[(nh)+1]==-722.0))) |
---|
| 23 | #define valid_vector(v,nl,nh) ((v!=(float *)NULL) && \ |
---|
| 24 | ((v[(nl)-1]==-322.0)&&(v[(nh)+1]==-722.0))) |
---|
| 25 | #define valid_dvector_b(v) ( (v!=(double *)NULL) && (*(v)==-322.0) ) |
---|
| 26 | #define valid_vector_b(v) ( (v!=(float *)NULL) && (*(v)==-322.0) ) |
---|
| 27 | #define valid_matrix(m,nrl,nrh,ncl,nch) ((m!=(float **)NULL) && \ |
---|
| 28 | ((m[(nrl)-2]==(float*)0x555) \ |
---|
| 29 | &&(m[(nrl)][(ncl)-1]==-422.00)&&(m[nrh][nch+1]==-822.0))) |
---|
| 30 | #define valid_dmatrix(m,nrl,nrh,ncl,nch) ((m!=(double **)NULL) && \ |
---|
| 31 | ((m[(nrl)-2]==(double*)0x555) \ |
---|
| 32 | &&(m[(nrl)][(ncl)-1]==-422.00)&&(m[nrh][nch+1]==-822.0))) |
---|
| 33 | #define valid_matrix_b(m) ( (m != (float **)NULL ) && ((*(m-1)==(float*)0x555)&&(*m[1]==-422.00))) |
---|
| 34 | #define valid_dmatrix_b(m) ((m != (double **)NULL ) && ((*(m-1)==(double*)0x555)&&(*m[1]==-422.00))) |
---|
| 35 | |
---|
| 36 | |
---|
| 37 | static float sqrarg; |
---|
| 38 | #define SQR(a) ((sqrarg=(a)) == 0.0 ? 0.0 : (sqrarg)*(sqrarg)) |
---|
| 39 | |
---|
| 40 | static double dsqrarg; |
---|
| 41 | #define DSQR(a) ((dsqrarg=(a)) == 0.0 ? 0.0 : (dsqrarg)*(dsqrarg)) |
---|
| 42 | |
---|
| 43 | static double dmaxarg1,dmaxarg2; |
---|
| 44 | #define DMAX(a,b) (dmaxarg1=(a),dmaxarg2=(b),(dmaxarg1) > (dmaxarg2) ?\ |
---|
| 45 | (dmaxarg1) : (dmaxarg2)) |
---|
| 46 | |
---|
| 47 | static double dminarg1,dminarg2; |
---|
| 48 | #define DMIN(a,b) (dminarg1=(a),dminarg2=(b),(dminarg1) < (dminarg2) ?\ |
---|
| 49 | (dminarg1) : (dminarg2)) |
---|
| 50 | |
---|
| 51 | static float maxarg1,maxarg2; |
---|
| 52 | #define FMAX(a,b) (maxarg1=(a),maxarg2=(b),(maxarg1) > (maxarg2) ?\ |
---|
| 53 | (maxarg1) : (maxarg2)) |
---|
| 54 | |
---|
| 55 | static float minarg1,minarg2; |
---|
| 56 | #define FMIN(a,b) (minarg1=(a),minarg2=(b),(minarg1) < (minarg2) ?\ |
---|
| 57 | (minarg1) : (minarg2)) |
---|
| 58 | |
---|
| 59 | static long lmaxarg1,lmaxarg2; |
---|
| 60 | #define LMAX(a,b) (lmaxarg1=(a),lmaxarg2=(b),(lmaxarg1) > (lmaxarg2) ?\ |
---|
| 61 | (lmaxarg1) : (lmaxarg2)) |
---|
| 62 | |
---|
| 63 | static long lminarg1,lminarg2; |
---|
| 64 | #define LMIN(a,b) (lminarg1=(a),lminarg2=(b),(lminarg1) < (lminarg2) ?\ |
---|
| 65 | (lminarg1) : (lminarg2)) |
---|
| 66 | |
---|
| 67 | static int imaxarg1,imaxarg2; |
---|
| 68 | #define IMAX(a,b) (imaxarg1=(a),imaxarg2=(b),(imaxarg1) > (imaxarg2) ?\ |
---|
| 69 | (imaxarg1) : (imaxarg2)) |
---|
| 70 | |
---|
| 71 | static int iminarg1,iminarg2; |
---|
| 72 | #define IMIN(a,b) (iminarg1=(a),iminarg2=(b),(iminarg1) < (iminarg2) ?\ |
---|
| 73 | (iminarg1) : (iminarg2)) |
---|
| 74 | |
---|
| 75 | #define SIGN(a,b) ((b) >= 0.0 ? fabs(a) : -fabs(a)) |
---|
| 76 | |
---|
| 77 | long mem_used(void); |
---|
| 78 | void reportmemory( FILE *outfile ); |
---|
| 79 | void using_mem( long space ); |
---|
| 80 | void nrerror(char error_text[]); |
---|
| 81 | float *vector(I_ARG_T nl, I_ARG_T nh); |
---|
| 82 | int *ivector(I_ARG_T nl, I_ARG_T nh); |
---|
| 83 | unsigned char *cvector(I_ARG_T nl, I_ARG_T nh); |
---|
| 84 | long *lvector(I_ARG_T nl, I_ARG_T nh); |
---|
| 85 | double *dvector(I_ARG_T nl, I_ARG_T nh); |
---|
| 86 | void flag_dvector( double *v, I_ARG_T nh); |
---|
| 87 | float **matrix(I_ARG_T nrl, I_ARG_T nrh, I_ARG_T ncl, I_ARG_T nch); |
---|
| 88 | double **dmatrix(I_ARG_T nrl, I_ARG_T nrh, I_ARG_T ncl, I_ARG_T nch); |
---|
| 89 | int **imatrix(I_ARG_T nrl, I_ARG_T nrh, I_ARG_T ncl, I_ARG_T nch); |
---|
| 90 | float **submatrix(float **a, I_ARG_T oldrl, I_ARG_T oldrh, I_ARG_T oldcl, I_ARG_T oldch, |
---|
| 91 | I_ARG_T newrl, I_ARG_T newcl); |
---|
| 92 | float **convert_matrix(float *a, I_ARG_T nrl, I_ARG_T nrh, I_ARG_T ncl, I_ARG_T nch); |
---|
| 93 | float ***f3tensor(I_ARG_T nrl, I_ARG_T nrh, I_ARG_T ncl, I_ARG_T nch, I_ARG_T ndl, I_ARG_T ndh); |
---|
| 94 | void free_vector(float *v, I_ARG_T nl, I_ARG_T nh); |
---|
| 95 | void free_ivector(int *v, I_ARG_T nl, I_ARG_T nh); |
---|
| 96 | void free_cvector(unsigned char *v, I_ARG_T nl, I_ARG_T nh); |
---|
| 97 | void free_lvector(long *v, I_ARG_T nl, I_ARG_T nh); |
---|
| 98 | void free_dvector(double *v, I_ARG_T nl, I_ARG_T nh); |
---|
| 99 | void free_matrix(float **m, I_ARG_T nrl, I_ARG_T nrh, I_ARG_T ncl, I_ARG_T nch); |
---|
| 100 | void free_dmatrix(double **m, I_ARG_T nrl, I_ARG_T nrh, I_ARG_T ncl, I_ARG_T nch); |
---|
| 101 | void free_imatrix(int **m, I_ARG_T nrl, I_ARG_T nrh, I_ARG_T ncl, I_ARG_T nch); |
---|
| 102 | void free_submatrix(float **b, I_ARG_T nrl, I_ARG_T nrh, I_ARG_T ncl, I_ARG_T nch); |
---|
| 103 | void free_convert_matrix(float **b, I_ARG_T nrl, I_ARG_T nrh, I_ARG_T ncl, I_ARG_T nch); |
---|
| 104 | void free_f3tensor(float ***t, I_ARG_T nrl, I_ARG_T nrh, I_ARG_T ncl, I_ARG_T nch, |
---|
| 105 | I_ARG_T ndl, I_ARG_T ndh); |
---|
| 106 | |
---|
| 107 | void dinverse( double **a, int n, double **y ); |
---|
| 108 | void dinverse_mult( double **a, int a_rows, double **b, int b_cols, double **y ); |
---|
| 109 | void dPDSinverse( double **a, int n, double **y ); |
---|
| 110 | void dPDS_L_inverse( double **a, int n, double **y ); |
---|
| 111 | |
---|
| 112 | |
---|
| 113 | /* sources in UTIL.C */ |
---|
| 114 | |
---|
| 115 | void dmmult( double **a, int a_rows, int a_cols, |
---|
| 116 | double **b, int b_rows, int b_cols, double **y); |
---|
| 117 | void dmvmult( double **a, int a_rows, int a_cols, double *b, int b_els, double *y); |
---|
| 118 | void dmadd( double **a, int a_rows, int a_cols, double **b, double **y); |
---|
| 119 | void dmsub( double **a, int a_rows, int a_cols, double **b, double **y); |
---|
| 120 | void dmsmy( double **a, int a_rows, int a_cols, double r, double **y); |
---|
| 121 | void dmtranspose( double **a, int a_rows, int a_cols, double **y); |
---|
| 122 | void dmfillUT( double **a, int a_rows, int a_cols); |
---|
| 123 | |
---|
| 124 | void dmdump( FILE *outf, char *text, double **a, int a_rows, int a_cols, char *format); |
---|
| 125 | void dvdump( FILE *outf, char *text, double *a, int a_els, char *format); |
---|
| 126 | void dvadd( double *a, int a_els, double *b, double *y); |
---|
| 127 | void dvsub( double *a, int a_els, double *b, double *y); |
---|
| 128 | double dvdot( double *a, int a_els, double *b); |
---|
| 129 | double dvmag( double *a, int a_els); |
---|
| 130 | double dvmnorm( double *a, int a_els); |
---|
| 131 | void dvsmy( double *a, int a_els, double r, double *y); |
---|
| 132 | void dvpiv( double *a, int a_els, double r, double *b, double *y); |
---|
| 133 | void dReadMatrix(FILE *datafile, double **y, int *rows, int *cols, int *error); |
---|
| 134 | void dReadVector(FILE *datafile, double *y, int *els, int *error); |
---|
| 135 | double dReadScalar(FILE *datafile, int *error); |
---|
| 136 | void dWriteMatrix( FILE *outf, char *text, double **a, int a_rows, int a_cols, char *format); |
---|
| 137 | void dWriteVector( FILE *outf, char *text, double *a, int a_els, char *format); |
---|
| 138 | void dWriteScalar( FILE *outf, char *text, double a, char *format); |
---|
| 139 | |
---|
| 140 | void dmcopy( double **a, int a_rows, int a_cols, double **b); /* copy a matrix */ |
---|
| 141 | void dvcopy( double *a, int a_els, double *b); /* copy a vector */ |
---|
| 142 | double dvcomp( double *a, int a_els, double *b); /* compare two vectors */ |
---|
| 143 | void dgetcolumn(double **G, int col, double *v, int nels); /* get a column from a matrix */ |
---|
| 144 | void dputcolumn(double *v, int nels, double **G, int col); /* put a column into a matrix */ |
---|
| 145 | |
---|
| 146 | /* frame operations - FRAME.C */ |
---|
| 147 | double **dframe( void ); |
---|
| 148 | double *d4vector( void ); |
---|
| 149 | #define free_d4vector( y ) free_dvector( y, 1, 4 ) |
---|
| 150 | #define free_dframe( y ) free_dmatrix( y, 1, 4, 1, 4 ) |
---|
| 151 | #define valid_d4vector( y ) valid_dvector( y, 1, 4 ) |
---|
| 152 | #define valid_d4vector_b( y ) valid_dvector_b( y ) |
---|
| 153 | #define valid_dframe( y ) valid_dmatrix( y, 1, 4, 1, 4 ) |
---|
| 154 | |
---|
| 155 | void chainmult( double **a, double **b ); |
---|
| 156 | void rotframe( double **a, int axis, double theta); /* make a rotation transform */ |
---|
| 157 | void transframe( double **a, double dx, double dy, double dz); |
---|
| 158 | void orthog( double **a ); /* orthogonalize a frame */ |
---|
| 159 | void orthogKI( double **a ); /* orthogonalize a frame */ |
---|
| 160 | void dframeinverse( double **E, double **Ein ); /* form inverse frame */ |
---|
| 161 | void dcross4 ( double *a, double *b, double *c ); /* cross two vectors */ |
---|
| 162 | double column_dot( double **G1, int col1, double **G2, int col2 ); |
---|
| 163 | void make_d_omega( double **G1, double **G2, double *w); |
---|
| 164 | void compare_link_frames( double **G1, double **G2, double *wp, double *wr, double *ww ); |
---|
| 165 | void compare_frames( double **G1, double **G2, double *wp, double *wr, double *ww ); |
---|
| 166 | void FindAxis(double **T1, double **T2, double *axis, |
---|
| 167 | double *sphi, double *cphi,int *twitching); |
---|
| 168 | void RotateVector(double *v, double *axis, double sphi, double cphi, double *y); |
---|
| 169 | void RotateFrame(double **T1, double *axis, double sphi, double cphi, double **T2); |
---|
| 170 | |
---|
| 171 | #ifdef NR_CHECK |
---|
| 172 | /* include definitions for wrapper functions which check parameters |
---|
| 173 | and locate error calls */ |
---|
| 174 | #define free_dmatrix(a,b,c,d,e) \ |
---|
| 175 | free_dmatrix_DNR(__LINE__,__FILE__,a,b,c,d,e) |
---|
| 176 | #define free_dvector(a,b,c) \ |
---|
| 177 | free_dvector_DNR(__LINE__,__FILE__,a,b,c) |
---|
| 178 | |
---|
| 179 | #define dmatrix(a,b,c,d) \ |
---|
| 180 | dmatrix_DNR(__LINE__,__FILE__,a,b,c,d) |
---|
| 181 | #define dvector(a,b) \ |
---|
| 182 | dvector_DNR(__LINE__,__FILE__,a,b) |
---|
| 183 | |
---|
| 184 | #define dmdump(a,b,c,d,e,f) \ |
---|
| 185 | dmdump_DNR(__LINE__, __FILE__,a,b,c,d,e,f) |
---|
| 186 | #define dvdump(a,b,c,d,e) \ |
---|
| 187 | dvdump_DNR(__LINE__, __FILE__,a,b,c,d,e) |
---|
| 188 | #define dWriteMatrix(a,b,c,d,e,f) \ |
---|
| 189 | dWriteMatrix_DNR(__LINE__, __FILE__,a,b,c,d,e,f) |
---|
| 190 | #define dWriteVector(a,b,c,d,e) \ |
---|
| 191 | dWriteVector_DNR(__LINE__, __FILE__,a,b,c,d,e) |
---|
| 192 | #define dWriteScalar(a,b,c,d) \ |
---|
| 193 | dWriteScalar_DNR(__LINE__, __FILE__,a,b,c,d) |
---|
| 194 | #define dReadMatrix(a,b,c,d,e) \ |
---|
| 195 | dReadMatrix_DNR(__LINE__, __FILE__,a,b,c,d,e) |
---|
| 196 | #define dReadVector(a,b,c,d) \ |
---|
| 197 | dReadVector_DNR(__LINE__, __FILE__,a,b,c,d) |
---|
| 198 | #define dReadScalar(a,b) \ |
---|
| 199 | dReadScalar_DNR(__LINE__, __FILE__,a,b) |
---|
| 200 | |
---|
| 201 | #define dmmult(a,b,c,d,e,f,g)\ |
---|
| 202 | dmmult_DNR(__LINE__,__FILE__,a,b,c,d,e,f,g) |
---|
| 203 | #define dmvmult(a,b,c,d,e,f) \ |
---|
| 204 | dmvmult_DNR(__LINE__,__FILE__,a,b,c,d,e,f) |
---|
| 205 | #define dmadd(a,b,c,d,e) \ |
---|
| 206 | dmadd_DNR(__LINE__,__FILE__,a,b,c,d,e) |
---|
| 207 | #define dmsub(a,b,c,d,e) \ |
---|
| 208 | dmsub_DNR(__LINE__,__FILE__,a,b,c,d,e) |
---|
| 209 | #define dmsmy(a,b,c,d,e) \ |
---|
| 210 | dmsmy_DNR(__LINE__,__FILE__,a,b,c,d,e) |
---|
| 211 | #define dmtranspose(a,b,c,d) \ |
---|
| 212 | dmtranspose_DNR(__LINE__,__FILE__,a,b,c,d) |
---|
| 213 | #define dmfullUT(a,b,c) \ |
---|
| 214 | dmfillUT_DNR(__LINE__,__FILE__,a,b,c) |
---|
| 215 | |
---|
| 216 | #define dvadd(a,b,c,d) \ |
---|
| 217 | dvadd_DNR(__LINE__,__FILE__,a,b,c,d) |
---|
| 218 | #define dvsub(a,b,c,d) \ |
---|
| 219 | dvsub_DNR(__LINE__,__FILE__,a,b,c,d) |
---|
| 220 | #define dvsmy(a,b,c,d) \ |
---|
| 221 | dvsmy_DNR(__LINE__,__FILE__,a,b,c,d) |
---|
| 222 | #define dvpiv(a,b,c,d,e) \ |
---|
| 223 | dvpiv_DNR(__LINE__,__FILE__,a,b,c,d,e) |
---|
| 224 | #define dvdot(a,b,c) \ |
---|
| 225 | dvdot_DNR(__LINE__,__FILE__,a,b,c) |
---|
| 226 | #define dvmag(a,b) \ |
---|
| 227 | dvmag_DNR(__LINE__,__FILE__,a,b) |
---|
| 228 | #define dvmnorm(a,b) \ |
---|
| 229 | dvmnorm_DNR(__LINE__,__FILE__,a,b) |
---|
| 230 | |
---|
| 231 | #define dmcopy(a,b,c,d) \ |
---|
| 232 | dmcopy_DNR(__LINE__,__FILE__,a,b,c,d) |
---|
| 233 | #define dvcopy(a,b,c) \ |
---|
| 234 | dvcopy_DNR(__LINE__,__FILE__,a,b,c) |
---|
| 235 | #define dvcomp(a,b,c) \ |
---|
| 236 | dvcomp_DNR(__LINE__,__FILE__,a,b,c) |
---|
| 237 | #define dgetcolumn(a,b,c,d) \ |
---|
| 238 | dgetcolumn_DNR(__LINE__,__FILE__,a,b,c,d) |
---|
| 239 | #define dputcolumn(a,b,c,d) \ |
---|
| 240 | dputcolumn_DNR(__LINE__,__FILE__,a,b,c,d) |
---|
| 241 | |
---|
| 242 | void free_dmatrix_DNR( int linref, char *fileref, |
---|
| 243 | double **a, int nrl, int nrh, int ncl, int nch); |
---|
| 244 | void free_dvector_DNR( int linref, char *fileref, |
---|
| 245 | double *a, int nvl, int nvh); |
---|
| 246 | |
---|
| 247 | double **dmatrix_DNR( int linref, char *fileref, |
---|
| 248 | int nrl, int nrh, int ncl, int nch ); |
---|
| 249 | double *dvector_DNR( int linref, char *fileref, |
---|
| 250 | int ncl, int nch ); |
---|
| 251 | |
---|
| 252 | void dmdump_DNR( int linref, char *fileref, |
---|
| 253 | FILE *outf, char *text, double **a, int a_rows, int a_cols, char *format); |
---|
| 254 | void dvdump_DNR( int linref, char *fileref, |
---|
| 255 | FILE *outf, char *text, double *a, int a_els, char *format); |
---|
| 256 | void dWriteMatrix_DNR( int linref, char *fileref, |
---|
| 257 | FILE *outf, char *text, double **a, int a_rows, int a_cols, char *format); |
---|
| 258 | void dWriteVector_DNR( int linref, char *fileref, |
---|
| 259 | FILE *outf, char *text, double *a, int a_els, char *format); |
---|
| 260 | void dWriteScalar_DNR( int linref, char *fileref, |
---|
| 261 | FILE *outf, char *text, double a, char *format); |
---|
| 262 | void dReadMatrix_DNR( int linref, char *fileref, |
---|
| 263 | FILE *datafile, double **y, int *rows, int *cols, int *error); |
---|
| 264 | void dReadVector_DNR( int linref, char *fileref, |
---|
| 265 | FILE *datafile, double *y, int *els, int *error); |
---|
| 266 | double dReadScalar_DNR( int linref, char *fileref, |
---|
| 267 | FILE *datafile, int *error); |
---|
| 268 | |
---|
| 269 | void dmmult_DNR( int linref, char *fileref, |
---|
| 270 | double **a, int a_rows, int a_cols, |
---|
| 271 | double **b, int b_rows, int b_cols, double **y); |
---|
| 272 | void dmvmult_DNR( int linref, char *fileref, |
---|
| 273 | double **a, int a_rows, int a_cols, double *b, int b_els, double *y); |
---|
| 274 | void dmadd_DNR( int linref, char *fileref, |
---|
| 275 | double **a, int a_rows, int a_cols, double **b, double **y); |
---|
| 276 | void dmsub_DNR( int linref, char *fileref, |
---|
| 277 | double **a, int a_rows, int a_cols, double **b, double **y); |
---|
| 278 | void dmsmy_DNR( int linref, char *fileref, |
---|
| 279 | double **a, int a_rows, int a_cols, double r, double **y); |
---|
| 280 | void dmtranspose_DNR( int linref, char *fileref, |
---|
| 281 | double **a, int a_rows, int a_cols, double **y); |
---|
| 282 | void dmfillUT_DNR( int linref, char *fileref, |
---|
| 283 | double **a, int a_rows, int a_cols); |
---|
| 284 | |
---|
| 285 | void dvadd_DNR( int linref, char *fileref, |
---|
| 286 | double *a, int a_els, double *b, double *y); |
---|
| 287 | void dvsub_DNR( int linref, char *fileref, |
---|
| 288 | double *a, int a_els, double *b, double *y); |
---|
| 289 | double dvdot_DNR( int linref, char *fileref, |
---|
| 290 | double *a, int a_els, double *b); |
---|
| 291 | double dvmag_DNR( int linref, char *fileref, |
---|
| 292 | double *a, int a_els); |
---|
| 293 | double dvmnorm_DNR( int linref, char *fileref, |
---|
| 294 | double *a, int a_els); |
---|
| 295 | void dvsmy_DNR( int linref, char *fileref, |
---|
| 296 | double *a, int a_els, double r, double *y); |
---|
| 297 | void dvpiv_DNR( int linref, char *fileref, |
---|
| 298 | double *a, int a_els, double r, double *b, double *y); |
---|
| 299 | |
---|
| 300 | void dmcopy_DNR( int linref, char *fileref, |
---|
| 301 | double **a, int a_rows, int a_cols, double **b); /* copy a matrix */ |
---|
| 302 | void dvcopy_DNR( int linref, char *fileref, |
---|
| 303 | double *a, int a_els, double *b); /* copy a vector */ |
---|
| 304 | double dvcomp_DNR( int linref, char *fileref, |
---|
| 305 | double *a, int a_els, double *b); /* compare two vectors */ |
---|
| 306 | void dgetcolumn_DNR( int linref, char *fileref, |
---|
| 307 | double **G, int col, double *v, int nels); /* get a column from a matrix */ |
---|
| 308 | void dputcolumn_DNR( int linref, char *fileref, |
---|
| 309 | double *v, int nels, double **G, int col); /* put a column into a matrix */ |
---|
| 310 | |
---|
| 311 | void dinverse_DNR( int lineref, char *fileref, |
---|
| 312 | double **a, int n, double **y ); |
---|
| 313 | void dinverse_mult_DNR( int lineref, char *fileref, |
---|
| 314 | double **a, int a_rows, double **b, int b_cols, double **y ); |
---|
| 315 | void dPDSinverse_DNR( int lineref, char *fileref, |
---|
| 316 | double **a, int n, double **y ); |
---|
| 317 | void dPDS_L_inverse_DNR( int lineref, char *fileref, |
---|
| 318 | double **a, int n, double **y ); |
---|
| 319 | void choldc_DNR( int lineref, char *fileref, |
---|
| 320 | float **a, int n, float p[]); |
---|
| 321 | void cholsl_DNR( int lineref, char *fileref, |
---|
| 322 | float **a, int n, float p[], float b[], float x[]); |
---|
| 323 | void lubksb_DNR( int lineref, char *fileref, |
---|
| 324 | float **a, int n, int *indx, float b[]); |
---|
| 325 | void ludcmp_DNR( int lineref, char *fileref, |
---|
| 326 | float **a, int n, int *indx, float *d); |
---|
| 327 | |
---|
| 328 | void dcholdc_DNR( int lineref, char *fileref, |
---|
| 329 | double **a, int n, double p[]); |
---|
| 330 | void dcholsl_DNR( int lineref, char *fileref, |
---|
| 331 | double **a, int n, double p[], double b[], double x[]); |
---|
| 332 | void dlubksb_DNR( int lineref, char *fileref, |
---|
| 333 | double **a, int n, int *indx, double b[]); |
---|
| 334 | void dludcmp_DNR( int lineref, char *fileref, |
---|
| 335 | double **a, int n, int *indx, double *d); |
---|
| 336 | #define dinverse(a,b,c) \ |
---|
| 337 | dinverse_DNR(__LINE__,__FILE__,a,b,c) |
---|
| 338 | #define dinverse_mult(a,b,c,d,e) \ |
---|
| 339 | dinverse_mult_DNR(__LINE__,__FILE__,a,b,c,d,e) |
---|
| 340 | #define dPDSinverse(a,b,c) \ |
---|
| 341 | dPDSinverse_DNR(__LINE__,__FILE__,a,b,c) |
---|
| 342 | #define dPDS_L_inverse(a,b,c) \ |
---|
| 343 | dPDS_L_inverse_DNR(__LINE__,__FILE__,a,b,c) |
---|
| 344 | #define choldc(a,b,c) \ |
---|
| 345 | choldc_DNR(__LINE__,__FILE__,a,b,c) |
---|
| 346 | #define cholsl(a,b,c,d,e) \ |
---|
| 347 | cholsl_DNR(__LINE__,__FILE__,a,b,c,d,e) |
---|
| 348 | #define lubksb(a,b,c,d) \ |
---|
| 349 | lubksb_DNR(__LINE__,__FILE__,a,b,c,d) |
---|
| 350 | #define ludcmp(a,b,c,d) \ |
---|
| 351 | ludcmp_DNR(__LINE__,__FILE__,a,b,c,d) |
---|
| 352 | #define dcholdc(a,b,c) \ |
---|
| 353 | dcholdc_DNR(__LINE__,__FILE__,a,b,c) |
---|
| 354 | #define dcholsl(a,b,c,d,e) \ |
---|
| 355 | dcholsl_DNR(__LINE__,__FILE__,a,b,c,d,e) |
---|
| 356 | #define dlubksb(a,b,c,d) \ |
---|
| 357 | dlubksb_DNR(__LINE__,__FILE__,a,b,c,d) |
---|
| 358 | #define dludcmp(a,b,c,d) \ |
---|
| 359 | dludcmp_DNR(__LINE__,__FILE__,a,b,c,d) |
---|
| 360 | |
---|
| 361 | double **dframe_DNR( int lineref, char *fileref ); |
---|
| 362 | double *d4vector_DNR( int lineref, char *fileref ); |
---|
| 363 | |
---|
| 364 | #define free_d4vector( y ) free_dvector( y, 1, 4 ) |
---|
| 365 | #define free_dframe( y ) free_dmatrix( y, 1, 4, 1, 4 ) |
---|
| 366 | #define valid_d4vector( y ) valid_dvector( y, 1, 4 ) |
---|
| 367 | #define valid_d4vector_b( y ) valid_dvector_b( y ) |
---|
| 368 | #define valid_dframe( y ) valid_dmatrix( y, 1, 4, 1, 4 ) |
---|
| 369 | |
---|
| 370 | void chainmult_DNR( int lineref, char *fileref, |
---|
| 371 | double **a, double **b ); |
---|
| 372 | void rotframe_DNR( int lineref, char *fileref, |
---|
| 373 | double **a, int axis, double theta); /* make a rotation transform */ |
---|
| 374 | void transframe_DNR( int lineref, char *fileref, |
---|
| 375 | double **a, double dx, double dy, double dz); |
---|
| 376 | void orthog_DNR( int lineref, char *fileref, |
---|
| 377 | double **a ); /* orthogonalize a frame */ |
---|
| 378 | void orthogKI_DNR( int lineref, char *fileref, |
---|
| 379 | double **a ); /* orthogonalize a frame */ |
---|
| 380 | void dframeinverse_DNR( int lineref, char *fileref, |
---|
| 381 | double **E, double **Ein ); /* form inverse frame */ |
---|
| 382 | void dcross4_DNR( int lineref, char *fileref, |
---|
| 383 | double *a, double *b, double *c ); /* cross two vectors */ |
---|
| 384 | #define dframe() \ |
---|
| 385 | dframe_DNR(__LINE__,__FILE__) |
---|
| 386 | #define d4vector() \ |
---|
| 387 | d4vector_DNR(__LINE__,__FILE__) |
---|
| 388 | #define chainmult(a,b) \ |
---|
| 389 | chainmult_DNR(__LINE__,__FILE__,a,b) |
---|
| 390 | #define rotframe(a,b,c) \ |
---|
| 391 | rotframe_DNR(__LINE__,__FILE__,a,b,c) |
---|
| 392 | #define transframe(a,b,c,d) \ |
---|
| 393 | transframe_DNR(__LINE__,__FILE__,a,b,c,d) |
---|
| 394 | #define othog(a) \ |
---|
| 395 | orthog_DNR(__LINE__,__FILE__,a) |
---|
| 396 | #define orthogKI(a) \ |
---|
| 397 | orthogKI_DNR(__LINE__,__FILE__,a) |
---|
| 398 | #define dframeinverse(a,b) \ |
---|
| 399 | dframeinverse_DNR(__LINE__,__FILE__,a,b) |
---|
| 400 | #define dcross4(a,b,c) \ |
---|
| 401 | dcross4_DNR(__LINE__,__FILE__,a,b,c) |
---|
| 402 | double column_dot_DNR( int lineref, char *fileref, |
---|
| 403 | double **G1, int col1, double **G2, int col2 ); |
---|
| 404 | void make_d_omega_DNR( int lineref, char *fileref, |
---|
| 405 | double **G1, double **G2, double *w); |
---|
| 406 | void compare_link_frames_DNR( int lineref, char *fileref, |
---|
| 407 | double **G1, double **G2, double *wp, double *wr, double *ww ); |
---|
| 408 | void compare_frames_DNR( int lineref, char *fileref, |
---|
| 409 | double **G1, double **G2, double *wp, double *wr, double *ww ); |
---|
| 410 | void FindAxis_DNR( int lineref, char *fileref, |
---|
| 411 | double **T1, double **T2, double *axis, |
---|
| 412 | double *sphi, double *cphi,int *twitching); |
---|
| 413 | void RotateVector_DNR( int lineref, char *fileref, |
---|
| 414 | double *v, double *axis, double sphi, double cphi, double *y); |
---|
| 415 | void RotateFrame_DNR( int lineref, char *fileref, |
---|
| 416 | double **T1, double *axis, double sphi, double cphi, double **T2); |
---|
| 417 | |
---|
| 418 | #define dcolumn_dot(a,b,c,d) \ |
---|
| 419 | dcolumn_dot_DNR(__LINE__,__FILE__,a,b,c,d) |
---|
| 420 | #define make_d_omega(a,b,c) \ |
---|
| 421 | make_d_omega_DNR(__LINE__,__FILE__,a,b,c) |
---|
| 422 | #define compare_link_frames(a,b,c,d,e) \ |
---|
| 423 | compare_link_frames_DNR(__LINE__,__FILE__,a,b,c,d,e) |
---|
| 424 | #define compare_frames(a,b,c,d,e) \ |
---|
| 425 | compare_frames_DNR(__LINE__,__FILE__,a,b,c,d,e) |
---|
| 426 | #define FindAxis(a,b,c,d,e,f) \ |
---|
| 427 | FindAxis_DNR(__LINE__,__FILE__,a,b,c,d,e,f) |
---|
| 428 | #define RotateVector(a,b,c,d,e) \ |
---|
| 429 | RotateVector_DNR(__LINE__,__FILE__,a,b,c,d,e) |
---|
| 430 | #define RotateFrame(a,b,c,d,e) \ |
---|
| 431 | RotateFrame_DNR(__LINE__,__FILE__,a,b,c,d,e) |
---|
| 432 | #endif /* NR_CHECK */ |
---|
| 433 | #endif /* _NR_H_ */ |
---|
| 434 | |
---|