- Timestamp:
- Apr 21, 2008, 2:19:26 PM (17 years ago)
- Children:
- 4bbde5
- Parents:
- 05fec0
- git-author:
- Frederik Heber <heber@…> (04/21/08 11:09:16)
- git-committer:
- Frederik Heber <heber@…> (04/21/08 14:19:26)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pcp/src/mymath.c
r05fec0 r08a794b 49 49 * \return \f$x^n\f$ 50 50 */ 51 #ifdef HAVE_INLINE 51 52 inline double tpow(double x, int n) 53 #else 54 double tpow(double x, int n) 55 #endif 52 56 { 53 57 double y = 1; … … 71 75 * \return modulo >=0 72 76 */ 77 #ifdef HAVE_INLINE 73 78 inline int Rest(int n, int m) /* normale modulo-Funktion, Ausgabe>=0 */ 79 #else 80 int Rest(int n, int m) /* normale modulo-Funktion, Ausgabe>=0 */ 81 #endif 74 82 { 75 83 int q = n%m; … … 87 95 * \return 0 - error: det A == 0, 1 - success 88 96 */ 97 #ifdef HAVE_INLINE 89 98 inline int RMatReci3(double B[NDIM_NDIM], const double A[NDIM_NDIM]) 99 #else 100 int RMatReci3(double B[NDIM_NDIM], const double A[NDIM_NDIM]) 101 #endif 90 102 { 91 103 double detA = RDET3(A); … … 111 123 * \param B matrix2 array 112 124 */ 125 #ifdef HAVE_INLINE 113 126 inline void RMatMat33(double C[NDIM*NDIM], const double A[NDIM*NDIM], const double B[NDIM*NDIM]) 127 #else 128 void RMatMat33(double C[NDIM*NDIM], const double A[NDIM*NDIM], const double B[NDIM*NDIM]) 129 #endif 114 130 { 115 131 C[0] = A[0]*B[0]+A[3]*B[1]+A[6]*B[2]; … … 130 146 * \param V vector array 131 147 */ 148 #ifdef HAVE_INLINE 132 149 inline void RMat33Vec3(double C[NDIM], const double M[NDIM*NDIM], const double V[NDIM]) 150 #else 151 void RMat33Vec3(double C[NDIM], const double M[NDIM*NDIM], const double V[NDIM]) 152 #endif 133 153 { 134 154 C[0] = M[0]*V[0]+M[3]*V[1]+M[6]*V[2]; … … 143 163 * \param M matrix array 144 164 */ 165 #ifdef HAVE_INLINE 145 166 inline void RVec3Mat33(double C[NDIM], const double V[NDIM], const double M[NDIM*NDIM]) 167 #else 168 void RVec3Mat33(double C[NDIM], const double V[NDIM], const double M[NDIM*NDIM]) 169 #endif 146 170 { 147 171 C[0] = V[0]*M[0]+V[1]*M[1]+V[2]*M[2]; … … 156 180 * \param B vector2 array 157 181 */ 182 #ifdef HAVE_INLINE 158 183 inline void VP3(double V[NDIM], double A[NDIM], double B[NDIM]) 184 #else 185 void VP3(double V[NDIM], double A[NDIM], double B[NDIM]) 186 #endif 159 187 { 160 188 V[0] = A[1]*B[2]-A[2]*B[1]; … … 167 195 */ 168 196 #ifdef HAVE_INLINE 169 inline void RTranspose3(double *A) { 170 #else 171 void RTranspose3(double *A) { 172 #endif 197 inline void RTranspose3(double *A) 198 #else 199 void RTranspose3(double *A) 200 #endif 201 { 173 202 double dummy = A[1]; 174 203 A[1] = A[3]; … … 189 218 */ 190 219 #ifdef HAVE_INLINE 191 inline double SP(const double *a, const double *b, const int n) { 192 #else 193 double SP(const double *a, const double *b, const int n) { 194 #endif 220 inline double SP(const double *a, const double *b, const int n) 221 #else 222 double SP(const double *a, const double *b, const int n) 223 #endif 224 { 195 225 int i; 196 226 double dummySP; … … 208 238 * \return sqrt(a-b) 209 239 */ 210 inline double Dist(const double *a, const double *b, const int n){ 240 #ifdef HAVE_INLINE 241 inline double Dist(const double *a, const double *b, const int n) 242 #else 243 double Dist(const double *a, const double *b, const int n) 244 #endif 245 { 211 246 int i; 212 247 double dummyDist = 0; … … 223 258 * \param n dimension 224 259 */ 260 #ifdef HAVE_INLINE 225 261 inline void SM(double *a, const double c, const int n) 262 #else 263 void SM(double *a, const double c, const int n) 264 #endif 226 265 { 227 266 int i; … … 235 274 */ 236 275 #ifdef HAVE_INLINE 237 inline void NV(double *a, const int n) { 238 #else 239 void NV(double *a, const int n) { 240 #endif 276 inline void NV(double *a, const int n) 277 #else 278 void NV(double *a, const int n) 279 #endif 280 { 241 281 int i; 242 282 for (i = 0; i < n; i++) a[i] = 0; … … 252 292 */ 253 293 #ifdef HAVE_INLINE 254 inline double dSum(int n, double *dx, int incx) { 255 #else 256 double dSum(int n, double *dx, int incx) { 257 #endif 294 inline double dSum(int n, double *dx, int incx) 295 #else 296 double dSum(int n, double *dx, int incx) 297 #endif 298 { 258 299 int i; 259 300 double res; … … 275 316 */ 276 317 #ifdef HAVE_INLINE 277 inline double Simps(int n, double *f, double h) { 278 #else 279 double Simps(int n, double *f, double h) { 280 #endif 318 inline double Simps(int n, double *f, double h) 319 #else 320 double Simps(int n, double *f, double h) 321 #endif 322 { 281 323 double res; 282 324 int nm12=(n-1)/2; … … 409 451 */ 410 452 #ifdef HAVE_INLINE 411 inline double derf(double x) { 412 #else 413 double derf(double x) { 414 #endif 453 inline double derf(double x) 454 #else 455 double derf(double x) 456 #endif 457 { 415 458 double res; 416 459 #ifdef HAVE_GSL_GSL_SF_ERF_H … … 431 474 * \param n number of array elements 432 475 */ 476 #ifdef HAVE_INLINE 433 477 inline void SetArrayToDouble0(double *a, int n) 478 #else 479 void SetArrayToDouble0(double *a, int n) 480 #endif 434 481 { 435 482 int i;
Note:
See TracChangeset
for help on using the changeset viewer.