MsmMacros.h

Go to the documentation of this file.
00001 #ifndef MSM_MACROS_H
00002 #define MSM_MACROS_H
00003 
00004 #define ROUNDUP_QUOTIENT(n, k)  (((n)/(k)) + (((n)%(k)) != 0))
00005 
00006 enum {
00007   PERIODIC_NONE = 0,
00008   PERIODIC_VEC1 = 0x01,
00009   PERIODIC_VEC2 = 0x02,
00010   PERIODIC_VEC3 = 0x04,
00011   PERIODIC_ALL = PERIODIC_VEC1 | PERIODIC_VEC2 | PERIODIC_VEC2
00012 };
00013 
00014 enum {
00015   APPROX_CUBIC = 0, 
00016   APPROX_QUINTIC,   
00017   APPROX_QUINTIC2,  
00018   APPROX_SEPTIC,    
00019   APPROX_SEPTIC3,   
00020   APPROX_NONIC,     
00021   APPROX_NONIC4,    
00022   APPROX_BSPLINE,   
00023   APPROX_END        
00024 };
00025 
00026 enum {
00027   SPLIT_TAYLOR2 = 0,  
00028   SPLIT_TAYLOR3,      
00029   SPLIT_TAYLOR4,      
00030   SPLIT_TAYLOR5,      
00031   SPLIT_TAYLOR6,      
00032   SPLIT_TAYLOR7,      
00033   SPLIT_TAYLOR8,      
00034   SPLIT_TAYLOR1,      
00036   SPLIT_SIGMA2_3,     
00037   SPLIT_SIGMA3_5,     
00038   SPLIT_SIGMA4_6,     
00039   SPLIT_SIGMA4_7,     
00040   SPLIT_SIGMA5_8,     
00041   SPLIT_SIGMA5_9,     
00042   SPLIT_SIGMA6_9,     
00043   SPLIT_SIGMA6_10,    
00044   SPLIT_SIGMA6_11,    
00045   SPLIT_SIGMA7_11,    
00046   SPLIT_SIGMA7_12,    
00047   SPLIT_SIGMA7_13,    
00048   SPLIT_SIGMA8_12,    
00049   SPLIT_SIGMA8_13,    
00050   SPLIT_SIGMA8_14,    
00051   SPLIT_SIGMA8_15,    
00053   SPLIT_SIGMA2_6,     
00056   SPLIT_SWITCH1_2,    
00057   SPLIT_SWITCH3_4,    
00058   SPLIT_SWITCH7_8,    
00060   SPLIT_END           
00061 };
00062 
00073 #undef  SPOLY
00074 #define SPOLY(pg, pdg, ra, split) \
00075   do { \
00076     double _r = ra;  /* _r=(r/a) */ \
00077     double _s = _r*_r;  /* _s=(r/a)^2 */ \
00078     double _g = 0, _dg = 0; \
00079     /* ASSERT(0 <= _s && _s <= 1); */ \
00080     switch (split) { \
00081       /* from section 5.1 of thesis */ \
00082       case SPLIT_TAYLOR2: \
00083         _g = 1 + (_s-1)*(-1./2 + (_s-1)*(3./8));                               \
00084         _dg = (2*_r)*(-1./2 + (_s-1)*(3./4)); \
00085         break;                                                                 \
00086       case SPLIT_TAYLOR3: \
00087         _g = 1 + (_s-1)*(-1./2 + (_s-1)*(3./8 + (_s-1)*(-5./16)));             \
00088         _dg = (2*_r)*(-1./2 + (_s-1)*(3./4 + (_s-1)*(-15./16))); \
00089         break;                                                                 \
00090       case SPLIT_TAYLOR4: \
00091         _g = 1 + (_s-1)*(-1./2 + (_s-1)*(3./8 + (_s-1)*(-5./16                 \
00092                 + (_s-1)*(35./128))));                                         \
00093         _dg = (2*_r)*(-1./2 + (_s-1)*(3./4 + (_s-1)*(-15./16 \
00094                 + (_s-1)*(35./32))));      \
00095         break;                                                                 \
00096       case SPLIT_TAYLOR5: \
00097         _g = 1 + (_s-1)*(-1./2 + (_s-1)*(3./8 + (_s-1)*(-5./16                 \
00098                 + (_s-1)*(35./128 + (_s-1)*(-63./256)))));                     \
00099         _dg = (2*_r)*(-1./2 + (_s-1)*(3./4 + (_s-1)*(-15./16 + (_s-1)*(35./32  \
00100                 + (_s-1)*(-315./256)))));                                      \
00101         break;                                                                 \
00102       case SPLIT_TAYLOR6: \
00103         _g = 1 + (_s-1)*(-1./2 + (_s-1)*(3./8 + (_s-1)*(-5./16                 \
00104                 + (_s-1)*(35./128 + (_s-1)*(-63./256                           \
00105                     + (_s-1)*(231./1024))))));                                 \
00106         _dg = (2*_r)*(-1./2 + (_s-1)*(3./4 + (_s-1)*(-15./16 + (_s-1)*(35./32  \
00107                 + (_s-1)*(-315./256 + (_s-1)*(693./512))))));                  \
00108         break;                                                                 \
00109       case SPLIT_TAYLOR7: \
00110         _g = 1 + (_s-1)*(-1./2 + (_s-1)*(3./8 + (_s-1)*(-5./16                 \
00111                 + (_s-1)*(35./128 + (_s-1)*(-63./256                           \
00112                     + (_s-1)*(231./1024 + (_s-1)*(-429./2048)))))));           \
00113         _dg = (2*_r)*(-1./2 + (_s-1)*(3./4 + (_s-1)*(-15./16 + (_s-1)*(35./32  \
00114                 + (_s-1)*(-315./256 + (_s-1)*(693./512                         \
00115                     + (_s-1)*(-3003./2048)))))));                              \
00116         break;                                                                 \
00117       case SPLIT_TAYLOR8: \
00118         _g = 1 + (_s-1)*(-1./2 + (_s-1)*(3./8 + (_s-1)*(-5./16                 \
00119                 + (_s-1)*(35./128 + (_s-1)*(-63./256                           \
00120                     + (_s-1)*(231./1024 + (_s-1)*(-429./2048                   \
00121                         + (_s-1)*(6435./32768))))))));                         \
00122         _dg = (2*_r)*(-1./2 + (_s-1)*(3./4 + (_s-1)*(-15./16 + (_s-1)*(35./32  \
00123                 + (_s-1)*(-315./256 + (_s-1)*(693./512                         \
00124                     + (_s-1)*(-3003./2048 + (_s-1)*(6435./4096))))))));        \
00125         break;                                                                 \
00126       case SPLIT_TAYLOR1: \
00127         _g = 1 + (_s-1)*(-1./2); \
00128         _dg = (2*_r)*(-1./2); \
00129         break; \
00130       /* from section 5.2 of thesis */ \
00131       case SPLIT_SIGMA2_3:  /* the "perfect" smoothing */ \
00132         _g = 2 + _s*(-2 + _r);                                                \
00133         _dg = _r*(-4 + _r*3);                                                  \
00134         break;                                                                 \
00135       case SPLIT_SIGMA3_5: \
00136         _g = 9./4 + _s*(-5./2 + _s*(9./4 - _r));                             \
00137         _dg = _r*(-5 + _s*(9 + _r*(-5)));                                     \
00138         break;                                                                 \
00139       case SPLIT_SIGMA4_6: \
00140         _g = 21./8 + _s*(-35./8 + _s*(63./8 + _r*(-7 + _r*(15./8))));        \
00141         _dg = _r*(-35./4 + _s*(63./2 + _r*(-35 + _r*(45./4))));               \
00142         break;                                                                 \
00143       case SPLIT_SIGMA4_7: \
00144         _g = 5./2 + _s*(-7./2 + _s*(7./2 + _s*(-5./2 + _r)));               \
00145         _dg = _r*(-7 + _s*(14 + _s*(-15 + _r*(7))));                         \
00146         break;                                                                 \
00147       case SPLIT_SIGMA5_8: \
00148         _g = 45./16 + _s*(-21./4 + _s*(63./8 + _s*(-45./4                   \
00149                 + _r*(9 + _r*(-35./16)))));                                    \
00150         _dg = _r*(-21./2 + _s*(63./2 + _s*(-135./2                           \
00151                 + _r*(63 + _r*(-35./2)))));                                    \
00152         break;                                                                 \
00153       case SPLIT_SIGMA5_9: \
00154         _g = 175./64 + _s*(-75./16 + _s*(189./32 + _s*(-75./16              \
00155                 + _s*(175./64 - _r))));                                       \
00156         _dg = _r*(-75./8 + _s*(189./8 + _s*(-225./8 + _s*(175./8            \
00157                   + _r*(-9)))));                                               \
00158         break;                                                                 \
00159       case SPLIT_SIGMA6_9: \
00160         _g = 25./8 + _s*(-15./2 + _s*(63./4 + _s*(-75./2                    \
00161                 + _r*(45 + _r*(-175./8 + _r*4)))));                            \
00162         _dg = _r*(-15 + _s*(63 + _s*(-225                                    \
00163                 + _r*(315 + _r*(-175 + _r*36)))));                             \
00164         break;                                                                 \
00165       case SPLIT_SIGMA6_10: \
00166         _g = 385./128 + _s*(-825./128 + _s*(693./64 + _s*(-825./64          \
00167                 + _s*(1925./128 + _r*(-11 + _r*(315./128))))));               \
00168         _dg = _r*(-825./64 + _s*(693./16 + _s*(-2475./32                     \
00169                 + _s*(1925./16 + _r*(-99 + _r*(1575./64))))));                \
00170         break;                                                                 \
00171       case SPLIT_SIGMA6_11: \
00172         _g = 189./64 + _s*(-385./64 + _s*(297./32 + _s*(-297./32            \
00173                 + _s*(385./64 + _s*(-189./64 + _r)))));                      \
00174         _dg = _r*(-385./32 + _s*(297./8 + _s*(-891./16 + _s*(385./8         \
00175                   + _s*(-945./32 + _r*(11))))));                              \
00176         break;                                                                 \
00177       case SPLIT_SIGMA7_11: \
00178         _g = 105./32 + _s*(-275./32 + _s*(297./16 + _s*(-495./16            \
00179                 + _s*(1925./32 + _r*(-66 + _r*(945./32 + _r*(-5)))))));       \
00180         _dg = _r*(-275./16 + _s*(297./4 + _s*(-1485./8                       \
00181                 + _s*(1925./4 + _r*(-594 + _r*(4725./16 + _r*(-55)))))));     \
00182         break;                                                                 \
00183       case SPLIT_SIGMA7_12: \
00184         _g = 819./256 + _s*(-1001./128 + _s*(3861./256                       \
00185               + _s*(-1287./64 + _s*(5005./256 + _s*(-2457./128              \
00186                     + _r*(13 + _r*(-693./256)))))));                           \
00187         _dg = _r*(-1001./64 + _s*(3861./64 + _s*(-3861./32                   \
00188                 + _s*(5005./32 + _s*(-12285./64 + _r*(143                    \
00189                       + _r*(-2079./64)))))));                                  \
00190         break;                                                                 \
00191       case SPLIT_SIGMA7_13: \
00192         _g = 1617./512 + _s*(-1911./256 + _s*(7007./512 + _s*(-2145./128    \
00193                 + _s*(7007./512 + _s*(-1911./256 + _s*(1617./512 - _r))))));\
00194         _dg = _r*(-1911./128 + _s*(7007./128 + _s*(-6435./64 + _s*(7007./64 \
00195                   + _s*(-9555./128 + _s*(4851./128 + _r*(-13)))))));         \
00196         break;                                                                 \
00197       case SPLIT_SIGMA8_12: \
00198         _g = 455./128 + _s*(-715./64 + _s*(3861./128 + _s*(-2145./32        \
00199                 + _s*(25025./128 + _r*(-286 + _r*(12285./64 + _r*(-65         \
00200                         + _r*(1155./128))))))));                               \
00201         _dg = _r*(-715./32 + _s*(3861./32 + _s*(-6435./16                    \
00202                 + _s*(25025./16 + _r*(-2574 + _r*(61425./32 + _r*(-715        \
00203                         + _r*(3465./32))))))));                                \
00204         break;                                                                 \
00205       case SPLIT_SIGMA8_13: \
00206         _g = 441./128 + _s*(-637./64 + _s*(3003./128                         \
00207               + _s*(-1287./32 + _s*(7007./128 + _s*(-5733./64               \
00208                     + _r*(91 + _r*(-4851./128 + _r*(6))))))));                 \
00209         _dg = _r*(-637./32 + _s*(3003./32 + _s*(-3861./16                    \
00210                 + _s*(7007./16 + _s*(-28665./32 + _r*(1001                   \
00211                       + _r*(-14553./32 + _r*(78))))))));                       \
00212         break;                                                                 \
00213       case SPLIT_SIGMA8_14: \
00214         _g = 3465./1024 + _s*(-9555./1024 + _s*(21021./1024                  \
00215               + _s*(-32175./1024 + _s*(35035./1024 + _s*(-28665./1024       \
00216                     + _s*(24255./1024 + _r*(-15 + _r*(3003./1024))))))));     \
00217         _dg = _r*(-9555./512 + _s*(21021./256 + _s*(-96525./512              \
00218                 + _s*(35035./128 + _s*(-143325./512 + _s*(72765./256        \
00219                       + _r*(-195 + _r*(21021./512))))))));                     \
00220         break;                                                                 \
00221       case SPLIT_SIGMA8_15: \
00222         _g = 429./128 + _s*(-1155./128 + _s*(2457./128 + _s*(-3575./128     \
00223                 + _s*(3575./128 + _s*(-2457./128 + _s*(1155./128            \
00224                       + _s*(-429./128 + _r)))))));                            \
00225         _dg = _r*(-1155./64 + _s*(2457./32 + _s*(-10725./64                  \
00226                 + _s*(3575./16 + _s*(-12285./64 + _s*(3465./32              \
00227                       + _s*(-3003./64 + _r*(15))))))));                       \
00228         break;                                                                 \
00229       /* from section 5.3 of thesis */ \
00230       case SPLIT_SIGMA2_6: \
00231         _g = (31./16) + _s*(-23./16 + _s*(9./16 + _s*(-1./16))); \
00232         _dg = (2*_r)*(-23./16 + _s*(9./8 + _s*(-3./16))); \
00233         break; \
00234       /* from section 5.4 of thesis */ \
00235       case SPLIT_SWITCH1_2:                                             \
00236         if (_r > 1./2) {                                                       \
00237           _g = 5./3 + _r + _s*(-3 + _r*(4./3));                               \
00238           _dg = 1 + _r*(-6 + _r*(4));                                          \
00239         }                                                                      \
00240         else {                                                                 \
00241           _g = 11./6 - _s;                                                    \
00242           _dg = _r*(-2);                                                       \
00243         }                                                                      \
00244         break;                                                                 \
00245       case SPLIT_SWITCH3_4:                                             \
00246         if (_r > 3./4) {                                                       \
00247           _g = 5./7 + _r*(27./7 + _r*(-41./7 + _r*(16./7)));                   \
00248           _dg = 27./7 + _r*(-82./7 + _r*(48./7));                              \
00249         }                                                                      \
00250         else {                                                                 \
00251           _g = 47./28 + _s*(-5./7);                                           \
00252           _dg = _r*(-10./7);                                                   \
00253         }                                                                      \
00254         break;                                                                 \
00255       case SPLIT_SWITCH7_8:                                             \
00256         if (_r > 7./8) {                                                       \
00257           _g = -19./15 + _r*(49./5 + _r*(-59./5 + _r*(64./15)));               \
00258           _dg = 49./5 + _r*(-118./5 + _r*(64./5));                             \
00259         }                                                                      \
00260         else {                                                                 \
00261           _g = 191./120 + _s*(-3./5);                                         \
00262           _dg = _r*(-6./5);                                                    \
00263         }                                                                      \
00264         break;                                                                 \
00265       default: \
00266         return /* NL_MSM_ERROR_SUPPORT */; \
00267     } \
00268     *(pg) = _g; \
00269     *(pdg) = _dg; \
00270   } while (0)
00271   /* closing ';' from use as function call */
00272 
00273 
00279 #define STENCIL_1D(_phi, _delta, _approx) \
00280   do { \
00281     float *phi = _phi; \
00282     float t = _delta; \
00283     switch (_approx) { \
00284       case APPROX_CUBIC: \
00285         phi[0] = 0.5f * (1 - t) * (2 - t) * (2 - t); \
00286         t--; \
00287         phi[1] = (1 - t) * (1 + t - 1.5f * t * t); \
00288         t--; \
00289         phi[2] = (1 + t) * (1 - t - 1.5f * t * t); \
00290         t--; \
00291         phi[3] = 0.5f * (1 + t) * (2 + t) * (2 + t); \
00292         break; \
00293       case APPROX_QUINTIC: \
00294         phi[0] = (1.f/24) * (1-t) * (2-t) * (3-t) * (3-t) * (4-t); \
00295         t--; \
00296         phi[1] = (1-t) * (2-t) * (3-t) * ((1.f/6) + t * (0.375f - (5.f/24)*t));\
00297         t--; \
00298         phi[2] = (1-t*t) * (2-t) * (0.5f + t * (0.25f - (5.f/12)*t)); \
00299         t--; \
00300         phi[3] = (1-t*t) * (2+t) * (0.5f - t * (0.25f + (5.f/12)*t)); \
00301         t--; \
00302         phi[4] = (1+t) * (2+t) * (3+t) * ((1.f/6) - t * (0.375f + (5.f/24)*t));\
00303         t--; \
00304         phi[5] = (1.f/24) * (1+t) * (2+t) * (3+t) * (3+t) * (4+t); \
00305         break; \
00306       case APPROX_QUINTIC2: \
00307         phi[0] = (1.f/24) * (3-t) * (3-t) * (3-t) * (t-2) * (5*t-8); \
00308         t--; \
00309         phi[1] = (-1.f/24) * (2-t) * (t-1) * (-48+t*(153+t*(-114+t*25))); \
00310         t--; \
00311         phi[2] = (1.f/12) * (1-t) * (12+t*(12+t*(-3+t*(-38+t*25)))); \
00312         t--; \
00313         phi[3] = (1.f/12) * (1+t) * (12+t*(-12+t*(-3+t*(38+t*25)))); \
00314         t--; \
00315         phi[4] = (-1.f/24) * (2+t) * (t+1) * (48+t*(153+t*(114+t*25))); \
00316         t--; \
00317         phi[5] = (1.f/24) * (3+t) * (3+t) * (3+t) * (t+2) * (5*t+8); \
00318         break; \
00319       case APPROX_SEPTIC: \
00320         phi[0] = (-1.f/720)*(t-1)*(t-2)*(t-3)*(t-4)*(t-4)*(t-5)*(t-6); \
00321         t--; \
00322         phi[1] = (1.f/720)*(t-1)*(t-2)*(t-3)*(t-4)*(t-5)*(-6+t*(-20+7*t)); \
00323         t--; \
00324         phi[2] = (-1.f/240)*(t*t-1)*(t-2)*(t-3)*(t-4)*(-10+t*(-12+7*t)); \
00325         t--; \
00326         phi[3] = (1.f/144)*(t*t-1)*(t*t-4)*(t-3)*(-12+t*(-4+7*t)); \
00327         t--; \
00328         phi[4] = (-1.f/144)*(t*t-1)*(t*t-4)*(t+3)*(-12+t*(4+7*t)); \
00329         t--; \
00330         phi[5] = (1.f/240)*(t*t-1)*(t+2)*(t+3)*(t+4)*(-10+t*(12+7*t)); \
00331         t--; \
00332         phi[6] = (-1.f/720)*(t+1)*(t+2)*(t+3)*(t+4)*(t+5)*(-6+t*(20+7*t)); \
00333         t--; \
00334         phi[7] = (1.f/720)*(t+1)*(t+2)*(t+3)*(t+4)*(t+4)*(t+5)*(t+6); \
00335         break; \
00336       case APPROX_SEPTIC3: \
00337         phi[0] = (3632.f/5) + t*((-7456.f/5) + t*((58786.f/45) + t*(-633 \
00338                 + t*((26383.f/144) + t*((-22807.f/720) + t*((727.f/240) \
00339                       + t*(-89.f/720))))))); \
00340         t--; \
00341         phi[1] = -440 + t*((25949.f/20) + t*((-117131.f/72) + t*((2247.f/2) \
00342                 + t*((-66437.f/144) + t*((81109.f/720) + t*((-727.f/48) \
00343                       + t*(623.f/720))))))); \
00344         t--; \
00345         phi[2] = (138.f/5) + t*((-8617.f/60) + t*((12873.f/40) + t*((-791.f/2) \
00346                 + t*((4557.f/16) + t*((-9583.f/80) + t*((2181.f/80) \
00347                       + t*(-623.f/240))))))); \
00348         t--; \
00349         phi[3] = 1 + t*t*((-49.f/36) + t*t*((-959.f/144) + t*((2569.f/144) \
00350                 + t*((-727.f/48) + t*(623.f/144))))); \
00351         t--; \
00352         phi[4] = 1 + t*t*((-49.f/36) + t*t*((-959.f/144) + t*((-2569.f/144) \
00353                 + t*((-727.f/48) + t*(-623.f/144))))); \
00354         t--; \
00355         phi[5] = (138.f/5) + t*((8617.f/60) + t*((12873.f/40) + t*((791.f/2) \
00356                 + t*((4557.f/16) + t*((9583.f/80) + t*((2181.f/80) \
00357                       + t*(623.f/240))))))); \
00358         t--; \
00359         phi[6] = -440 + t*((-25949.f/20) + t*((-117131.f/72) + t*((-2247.f/2) \
00360                 + t*((-66437.f/144) + t*((-81109.f/720) + t*((-727.f/48) \
00361                       + t*(-623.f/720))))))); \
00362         t--; \
00363         phi[7] = (3632.f/5) + t*((7456.f/5) + t*((58786.f/45) + t*(633 \
00364                 + t*((26383.f/144) + t*((22807.f/720) + t*((727.f/240) \
00365                       + t*(89.f/720))))))); \
00366         break; \
00367       case APPROX_NONIC: \
00368         phi[0] = (-1.f/40320)*(t-8)*(t-7)*(t-6)*(t-5)*(t-5)*(t-4)*(t-3)* \
00369           (t-2)*(t-1); \
00370         t--; \
00371         phi[1] = (1.f/40320)*(t-7)*(t-6)*(t-5)*(t-4)*(t-3)*(t-2)*(t-1)* \
00372           (-8+t*(-35+9*t)); \
00373         t--; \
00374         phi[2] = (-1.f/10080)*(t-6)*(t-5)*(t-4)*(t-3)*(t-2)*(t-1)*(t+1)* \
00375           (-14+t*(-25+9*t)); \
00376         t--; \
00377         phi[3] = (1.f/1440)*(t-5)*(t-4)*(t-3)*(t-2)*(t-1)*(t+1)*(t+2)* \
00378           (-6+t*(-5+3*t)); \
00379         t--; \
00380         phi[4] = (-1.f/2880)*(t-4)*(t-3)*(t-2)*(t-1)*(t+1)*(t+2)*(t+3)* \
00381           (-20+t*(-5+9*t)); \
00382         t--; \
00383         phi[5] = (1.f/2880)*(t-3)*(t-2)*(t-1)*(t+1)*(t+2)*(t+3)*(t+4)* \
00384           (-20+t*(5+9*t)); \
00385         t--; \
00386         phi[6] = (-1.f/1440)*(t-2)*(t-1)*(t+1)*(t+2)*(t+3)*(t+4)*(t+5)* \
00387           (-6+t*(5+3*t)); \
00388         t--; \
00389         phi[7] = (1.f/10080)*(t-1)*(t+1)*(t+2)*(t+3)*(t+4)*(t+5)*(t+6)* \
00390           (-14+t*(25+9*t)); \
00391         t--; \
00392         phi[8] = (-1.f/40320)*(t+1)*(t+2)*(t+3)*(t+4)*(t+5)*(t+6)*(t+7)* \
00393           (-8+t*(35+9*t)); \
00394         t--; \
00395         phi[9] = (1.f/40320)*(t+1)*(t+2)*(t+3)*(t+4)*(t+5)*(t+5)*(t+6)* \
00396           (t+7)*(t+8); \
00397         break; \
00398       case APPROX_NONIC4: \
00399         phi[0] = 439375.f/7+t*(-64188125.f/504+t*(231125375.f/2016 \
00400               +t*(-17306975.f/288+t*(7761805.f/384+t*(-2895587.f/640 \
00401                     +t*(129391.f/192+t*(-259715.f/4032+t*(28909.f/8064 \
00402                           +t*(-3569.f/40320))))))))); \
00403         t--; \
00404         phi[1] = -56375+t*(8314091.f/56+t*(-49901303.f/288+t*(3763529.f/32 \
00405                 +t*(-19648027.f/384+t*(9469163.f/640+t*(-545977.f/192 \
00406                       +t*(156927.f/448+t*(-28909.f/1152 \
00407                           +t*(3569.f/4480))))))))); \
00408         t--; \
00409         phi[2] = 68776.f/7+t*(-1038011.f/28+t*(31157515.f/504+t*(-956669.f/16 \
00410                 +t*(3548009.f/96+t*(-2422263.f/160+t*(197255.f/48 \
00411                       +t*(-19959.f/28+t*(144545.f/2016 \
00412                           +t*(-3569.f/1120))))))))); \
00413         t--; \
00414         phi[3] = -154+t*(12757.f/12+t*(-230123.f/72+t*(264481.f/48 \
00415                 +t*(-576499.f/96+t*(686147.f/160+t*(-96277.f/48 \
00416                       +t*(14221.f/24+t*(-28909.f/288+t*(3569.f/480))))))))); \
00417         t--; \
00418         phi[4] = 1+t*t*(-205.f/144+t*t*(91.f/192+t*(-6181.f/320 \
00419                 +t*(6337.f/96+t*(-2745.f/32+t*(28909.f/576 \
00420                       +t*(-3569.f/320))))))); \
00421         t--; \
00422         phi[5] = 1+t*t*(-205.f/144+t*t*(91.f/192+t*(6181.f/320 \
00423                 +t*(6337.f/96+t*(2745.f/32+t*(28909.f/576 \
00424                       +t*(3569.f/320))))))); \
00425         t--; \
00426         phi[6] = -154+t*(-12757.f/12+t*(-230123.f/72+t*(-264481.f/48 \
00427                 +t*(-576499.f/96+t*(-686147.f/160+t*(-96277.f/48 \
00428                       +t*(-14221.f/24+t*(-28909.f/288+t*(-3569.f/480))))))))); \
00429         t--; \
00430         phi[7] = 68776.f/7+t*(1038011.f/28+t*(31157515.f/504+t*(956669.f/16 \
00431                 +t*(3548009.f/96+t*(2422263.f/160+t*(197255.f/48 \
00432                       +t*(19959.f/28+t*(144545.f/2016+t*(3569.f/1120))))))))); \
00433         t--; \
00434         phi[8] = -56375+t*(-8314091.f/56+t*(-49901303.f/288+t*(-3763529.f/32 \
00435                 +t*(-19648027.f/384+t*(-9469163.f/640+t*(-545977.f/192 \
00436                       +t*(-156927.f/448+t*(-28909.f/1152 \
00437                           +t*(-3569.f/4480))))))))); \
00438         t--; \
00439         phi[9] = 439375.f/7+t*(64188125.f/504+t*(231125375.f/2016 \
00440               +t*(17306975.f/288+t*(7761805.f/384+t*(2895587.f/640 \
00441                     +t*(129391.f/192+t*(259715.f/4032+t*(28909.f/8064 \
00442                           +t*(3569.f/40320))))))))); \
00443         break; \
00444       case APPROX_BSPLINE: \
00445         phi[0] = (1.f/6) * (2-t) * (2-t) * (2-t); \
00446         t--; \
00447         phi[1] = (2.f/3) + t*t*(-1 + 0.5f*t); \
00448         t--; \
00449         phi[2] = (2.f/3) + t*t*(-1 - 0.5f*t); \
00450         t--; \
00451         phi[3] = (1.f/6) * (2+t) * (2+t) * (2+t); \
00452         break; \
00453       default: \
00454         return /* XXX NL_MSM_ERROR_SUPPORT */; \
00455     } \
00456   } while (0)
00457   /* closing ';' from use as function call */
00458 
00459 
00467 #define D_STENCIL_1D(_dphi, _phi, _h_1, _delta, _approx) \
00468   do { \
00469     float *dphi = _dphi; \
00470     float *phi = _phi; \
00471     float h_1 = _h_1; \
00472     float t = _delta; \
00473     switch (_approx) { \
00474       case APPROX_CUBIC: \
00475         phi[0] = 0.5f * (1 - t) * (2 - t) * (2 - t); \
00476         dphi[0] = (1.5f * t - 2) * (2 - t) * h_1; \
00477         t--; \
00478         phi[1] = (1 - t) * (1 + t - 1.5f * t * t); \
00479         dphi[1] = (-5 + 4.5f * t) * t * h_1; \
00480         t--; \
00481         phi[2] = (1 + t) * (1 - t - 1.5f * t * t); \
00482         dphi[2] = (-5 - 4.5f * t) * t * h_1; \
00483         t--; \
00484         phi[3] = 0.5f * (1 + t) * (2 + t) * (2 + t); \
00485         dphi[3] = (1.5f * t + 2) * (2 + t) * h_1; \
00486         break; \
00487       case APPROX_QUINTIC: \
00488         phi[0] = (1.f/24) * (1-t) * (2-t) * (3-t) * (3-t) * (4-t); \
00489         dphi[0] = ((-1.f/24) * ((3-t) * (3-t) * (14 + t * (-14 + 3*t)) \
00490               + 2 * (1-t) * (2-t) * (3-t) * (4-t))) * h_1; \
00491         t--; \
00492         phi[1] = (1-t) * (2-t) * (3-t) * ((1.f/6) + t * (0.375f - (5.f/24)*t));\
00493         dphi[1] = (-((1.f/6) + t * (0.375f - (5.f/24)*t)) * (11 + t * (-12 + 3*t))\
00494             + (1-t) * (2-t) * (3-t) * (0.375f - (5.f/12)*t)) * h_1; \
00495         t--; \
00496         phi[2] = (1-t*t) * (2-t) * (0.5f + t * (0.25f - (5.f/12)*t)); \
00497         dphi[2] = (-(0.5f + t * (0.25f - (5.f/12)*t)) * (1 + t * (4 - 3*t)) \
00498             + (1-t*t) * (2-t) * (0.25f - (5.f/6)*t)) * h_1; \
00499         t--; \
00500         phi[3] = (1-t*t) * (2+t) * (0.5f - t * (0.25f + (5.f/12)*t)); \
00501         dphi[3] = ((0.5f + t * (-0.25f - (5.f/12)*t)) * (1 + t * (-4 - 3*t)) \
00502             - (1-t*t) * (2+t) * (0.25f + (5.f/6)*t)) * h_1; \
00503         t--; \
00504         phi[4] = (1+t) * (2+t) * (3+t) * ((1.f/6) - t * (0.375f + (5.f/24)*t));\
00505         dphi[4] = (((1.f/6) + t * (-0.375f - (5.f/24)*t)) * (11 + t * (12 + 3*t)) \
00506             - (1+t) * (2+t) * (3+t) * (0.375f + (5.f/12)*t)) * h_1; \
00507         t--; \
00508         phi[5] = (1.f/24) * (1+t) * (2+t) * (3+t) * (3+t) * (4+t); \
00509         dphi[5] = ((1.f/24) * ((3+t) * (3+t) * (14 + t * (14 + 3*t)) \
00510               + 2 * (1+t) * (2+t) * (3+t) * (4+t))) * h_1; \
00511         break; \
00512       case APPROX_QUINTIC2: \
00513         phi[0] = (1.f/24) * (3-t) * (3-t) * (3-t) * (t-2) * (5*t-8); \
00514         dphi[0] = ((1.f/24) * (3-t) * (3-t) * ((3-t)*(5*t-8) - 3*(t-2)*(5*t-8) \
00515               + 5*(t-2)*(3-t))) * h_1; \
00516         t--; \
00517         phi[1] = (-1.f/24) * (2-t) * (t-1) * (-48+t*(153+t*(-114+t*25))); \
00518         dphi[1] = ((-1.f/24) * ((2-t)*(-48+t*(153+t*(-114+t*25))) - (t-1)* \
00519               (-48+t*(153+t*(-114+t*25))) \
00520               + (2-t)*(t-1)*(153+t*(-228+t*75)))) * h_1; \
00521         t--; \
00522         phi[2] = (1.f/12) * (1-t) * (12+t*(12+t*(-3+t*(-38+t*25)))); \
00523         dphi[2] = ((1.f/12) * (-(12+t*(12+t*(-3+t*(-38+t*25)))) \
00524               + (1-t)*(12+t*(-6+t*(-114+t*100))))) * h_1; \
00525         t--; \
00526         phi[3] = (1.f/12) * (1+t) * (12+t*(-12+t*(-3+t*(38+t*25)))); \
00527         dphi[3] = ((1.f/12) * ((12+t*(-12+t*(-3+t*(38+t*25)))) \
00528               + (1+t)*(-12+t*(-6+t*(114+t*100))))) * h_1; \
00529         t--; \
00530         phi[4] = (-1.f/24) * (2+t) * (t+1) * (48+t*(153+t*(114+t*25))); \
00531         dphi[4] = ((-1.f/24) * ((2+t)*(48+t*(153+t*(114+t*25))) + (t+1)* \
00532               (48+t*(153+t*(114+t*25))) \
00533               + (2+t)*(t+1)*(153+t*(228+t*75)))) * h_1; \
00534         t--; \
00535         phi[5] = (1.f/24) * (3+t) * (3+t) * (3+t) * (t+2) * (5*t+8); \
00536         dphi[5] = ((1.f/24) * (3+t) * (3+t) * ((3+t)*(5*t+8) + 3*(t+2)*(5*t+8) \
00537               + 5*(t+2)*(3+t))) * h_1; \
00538         break; \
00539       case APPROX_SEPTIC: \
00540         phi[0] = (-1.f/720)*(t-1)*(t-2)*(t-3)*(t-4)*(t-4)*(t-5)*(t-6); \
00541         dphi[0] = (-1.f/720)*(t-4)*(-1944+t*(3644+t*(-2512+t*(807 \
00542                   +t*(-122+t*7))))) * h_1; \
00543         t--; \
00544         phi[1] = (1.f/720)*(t-1)*(t-2)*(t-3)*(t-4)*(t-5)*(-6+t*(-20+7*t)); \
00545         dphi[1] = (1.f/720)*(756+t*(-9940+t*(17724+t*(-12740+t*(4445 \
00546                     +t*(-750+t*49)))))) * h_1; \
00547         t--; \
00548         phi[2] = (-1.f/240)*(t*t-1)*(t-2)*(t-3)*(t-4)*(-10+t*(-12+7*t)); \
00549         dphi[2] = (-1.f/240)*(-28+t*(1260+t*(-756+t*(-1260+t*(1365 \
00550                     +t*(-450+t*49)))))) * h_1; \
00551         t--; \
00552         phi[3] = (1.f/144)*(t*t-1)*(t*t-4)*(t-3)*(-12+t*(-4+7*t)); \
00553         dphi[3] = (1.f/144)*t*(-560+t*(84+t*(644+t*(-175+t*(-150+t*49))))) * \
00554           h_1; \
00555         t--; \
00556         phi[4] = (-1.f/144)*(t*t-1)*(t*t-4)*(t+3)*(-12+t*(4+7*t)); \
00557         dphi[4] = (-1.f/144)*t*(560+t*(84+t*(-644+t*(-175+t*(150+t*49))))) * \
00558           h_1; \
00559         t--; \
00560         phi[5] = (1.f/240)*(t*t-1)*(t+2)*(t+3)*(t+4)*(-10+t*(12+7*t)); \
00561         dphi[5] = (1.f/240)*(-28+t*(-1260+t*(-756+t*(1260+t*(1365 \
00562                     +t*(450+t*49)))))) * h_1; \
00563         t--; \
00564         phi[6] = (-1.f/720)*(t+1)*(t+2)*(t+3)*(t+4)*(t+5)*(-6+t*(20+7*t)); \
00565         dphi[6] = (-1.f/720)*(756+t*(9940+t*(17724+t*(12740+t*(4445 \
00566                     +t*(750+t*49)))))) * h_1; \
00567         t--; \
00568         phi[7] = (1.f/720)*(t+1)*(t+2)*(t+3)*(t+4)*(t+4)*(t+5)*(t+6); \
00569         dphi[7] = (1.f/720)*(t+4)*(1944+t*(3644+t*(2512+t*(807 \
00570                   +t*(122+t*7))))) * h_1; \
00571         break; \
00572       case APPROX_SEPTIC3: \
00573         phi[0] = (3632.f/5) + t*((-7456.f/5) + t*((58786.f/45) + t*(-633 \
00574                 + t*((26383.f/144) + t*((-22807.f/720) + t*((727.f/240) \
00575                       + t*(-89.f/720))))))); \
00576         dphi[0] = ((-7456.f/5) + t*((117572.f/45) + t*(-1899 + t*((26383.f/36) \
00577                   + t*((-22807.f/144) + t*((727.f/40) + t*(-623.f/720)))))))*h_1; \
00578         t--; \
00579         phi[1] = -440 + t*((25949.f/20) + t*((-117131.f/72) + t*((2247.f/2) \
00580                 + t*((-66437.f/144) + t*((81109.f/720) + t*((-727.f/48) \
00581                       + t*(623.f/720))))))); \
00582         dphi[1] = ((25949.f/20) + t*((-117131.f/36) + t*((6741.f/2) \
00583                 + t*((-66437.f/36) + t*((81109.f/144) + t*((-727.f/8) \
00584                       + t*(4361.f/720))))))) * h_1; \
00585         t--; \
00586         phi[2] = (138.f/5) + t*((-8617.f/60) + t*((12873.f/40) + t*((-791.f/2) \
00587                 + t*((4557.f/16) + t*((-9583.f/80) + t*((2181.f/80) \
00588                       + t*(-623.f/240))))))); \
00589         dphi[2] = ((-8617.f/60) + t*((12873.f/20) + t*((-2373.f/2) + t*((4557.f/4) \
00590                   + t*((-9583.f/16) + t*((6543.f/40) + t*(-4361.f/240)))))))*h_1; \
00591         t--; \
00592         phi[3] = 1 + t*t*((-49.f/36) + t*t*((-959.f/144) + t*((2569.f/144) \
00593                 + t*((-727.f/48) + t*(623.f/144))))); \
00594         dphi[3] = (t*((-49.f/18) + t*t*((-959.f/36) + t*((12845.f/144) \
00595                   + t*((-727.f/8) + t*(4361.f/144)))))) * h_1; \
00596         t--; \
00597         phi[4] = 1 + t*t*((-49.f/36) + t*t*((-959.f/144) + t*((-2569.f/144) \
00598                 + t*((-727.f/48) + t*(-623.f/144))))); \
00599         dphi[4] = (t*((-49.f/18) + t*t*((-959.f/36) + t*((-12845.f/144) \
00600                   + t*((-727.f/8) + t*(-4361.f/144)))))) * h_1; \
00601         t--; \
00602         phi[5] = (138.f/5) + t*((8617.f/60) + t*((12873.f/40) + t*((791.f/2) \
00603                 + t*((4557.f/16) + t*((9583.f/80) + t*((2181.f/80) \
00604                       + t*(623.f/240))))))); \
00605         dphi[5] = ((8617.f/60) + t*((12873.f/20) + t*((2373.f/2) + t*((4557.f/4) \
00606                   + t*((9583.f/16) + t*((6543.f/40) + t*(4361.f/240)))))))*h_1; \
00607         t--; \
00608         phi[6] = -440 + t*((-25949.f/20) + t*((-117131.f/72) + t*((-2247.f/2) \
00609                 + t*((-66437.f/144) + t*((-81109.f/720) + t*((-727.f/48) \
00610                       + t*(-623.f/720))))))); \
00611         dphi[6] = ((-25949.f/20) + t*((-117131.f/36) + t*((-6741.f/2) \
00612                 + t*((-66437.f/36) + t*((-81109.f/144) + t*((-727.f/8) \
00613                       + t*(-4361.f/720))))))) * h_1; \
00614         t--; \
00615         phi[7] = (3632.f/5) + t*((7456.f/5) + t*((58786.f/45) + t*(633 \
00616                 + t*((26383.f/144) + t*((22807.f/720) + t*((727.f/240) \
00617                       + t*(89.f/720))))))); \
00618         dphi[7] = ((7456.f/5) + t*((117572.f/45) + t*(1899 + t*((26383.f/36) \
00619                   + t*((22807.f/144) + t*((727.f/40) + t*(623.f/720)))))))*h_1; \
00620         break; \
00621       case APPROX_NONIC: \
00622         phi[0] = (-1.f/40320)*(t-8)*(t-7)*(t-6)*(t-5)*(t-5)*(t-4)*(t-3)* \
00623           (t-2)*(t-1); \
00624         dphi[0] = (-1.f/40320)*(t-5)*(-117648+t*(256552+t*(-221416 \
00625                 +t*(99340+t*(-25261+t*(3667+t*(-283+t*9)))))))*h_1; \
00626         t--; \
00627         phi[1] = (1.f/40320)*(t-7)*(t-6)*(t-5)*(t-4)*(t-3)*(t-2)*(t-1)* \
00628           (-8+t*(-35+9*t)); \
00629         dphi[1] = (1.f/40320)*(71856+t*(-795368+t*(1569240+t*(-1357692 \
00630                   +t*(634725+t*(-172116+t*(27090+t*(-2296+t*81))))))))*h_1; \
00631         t--; \
00632         phi[2] = (-1.f/10080)*(t-6)*(t-5)*(t-4)*(t-3)*(t-2)*(t-1)*(t+1)* \
00633           (-14+t*(-25+9*t)); \
00634         dphi[2] = (1.f/10080)*(3384+t*(-69080+t*(55026 \
00635                 +t*(62580+t*(-99225+t*(51660+t*(-13104+t*(1640 \
00636                           +t*(-81)))))))))*h_1; \
00637         t--; \
00638         phi[3] = (1.f/1440)*(t-5)*(t-4)*(t-3)*(t-2)*(t-1)*(t+1)*(t+2)* \
00639           (-6+t*(-5+3*t)); \
00640         dphi[3] = (1.f/1440)*(72+t*(-6344+t*(2070 \
00641                 +t*(7644+t*(-4725+t*(-828+t*(1260+t*(-328+t*27))))))))*h_1; \
00642         t--; \
00643         phi[4] = (-1.f/2880)*(t-4)*(t-3)*(t-2)*(t-1)*(t+1)*(t+2)*(t+3)* \
00644           (-20+t*(-5+9*t)); \
00645         dphi[4] = (-1.f/2880)*t*(10792+t*(-972+t*(-12516 \
00646                 +t*(2205+t*(3924+t*(-882+t*(-328+t*81)))))))*h_1; \
00647         t--; \
00648         phi[5] = (1.f/2880)*(t-3)*(t-2)*(t-1)*(t+1)*(t+2)*(t+3)*(t+4)* \
00649           (-20+t*(5+9*t)); \
00650         dphi[5] = (1.f/2880)*t*(-10792+t*(-972+t*(12516 \
00651                 +t*(2205+t*(-3924+t*(-882+t*(328+t*81)))))))*h_1; \
00652         t--; \
00653         phi[6] = (-1.f/1440)*(t-2)*(t-1)*(t+1)*(t+2)*(t+3)*(t+4)*(t+5)* \
00654           (-6+t*(5+3*t)); \
00655         dphi[6] = (1.f/1440)*(-72+t*(-6344+t*(-2070 \
00656                 +t*(7644+t*(4725+t*(-828+t*(-1260+t*(-328+t*(-27)))))))))*h_1; \
00657         t--; \
00658         phi[7] = (1.f/10080)*(t-1)*(t+1)*(t+2)*(t+3)*(t+4)*(t+5)*(t+6)* \
00659           (-14+t*(25+9*t)); \
00660         dphi[7] = (1.f/10080)*(-3384+t*(-69080+t*(-55026 \
00661                 +t*(62580+t*(99225+t*(51660+t*(13104+t*(1640+t*81))))))))*h_1; \
00662         t--; \
00663         phi[8] = (-1.f/40320)*(t+1)*(t+2)*(t+3)*(t+4)*(t+5)*(t+6)*(t+7)* \
00664           (-8+t*(35+9*t)); \
00665         dphi[8] = (-1.f/40320)*(71856+t*(795368+t*(1569240 \
00666                 +t*(1357692+t*(634725+t*(172116+t*(27090+t*(2296 \
00667                           +t*81))))))))*h_1; \
00668         t--; \
00669         phi[9] = (1.f/40320)*(t+1)*(t+2)*(t+3)*(t+4)*(t+5)*(t+5)*(t+6)* \
00670           (t+7)*(t+8); \
00671         dphi[9] = (1.f/40320)*(t+5)*(117648+t*(256552+t*(221416 \
00672                 +t*(99340+t*(25261+t*(3667+t*(283+t*9)))))))*h_1; \
00673         break; \
00674       case APPROX_NONIC4: \
00675         phi[0] = 439375.f/7+t*(-64188125.f/504+t*(231125375.f/2016 \
00676               +t*(-17306975.f/288+t*(7761805.f/384+t*(-2895587.f/640 \
00677                     +t*(129391.f/192+t*(-259715.f/4032+t*(28909.f/8064 \
00678                           +t*(-3569.f/40320))))))))); \
00679         dphi[0] = (-64188125.f/504+t*(231125375.f/1008 \
00680               +t*(-17306975.f/96+t*(7761805.f/96+t*(-2895587.f/128 \
00681                     +t*(129391.f/32+t*(-259715.f/576+t*(28909.f/1008 \
00682                           +t*(-3569.f/4480)))))))))*h_1; \
00683         t--; \
00684         phi[1] = -56375+t*(8314091.f/56+t*(-49901303.f/288+t*(3763529.f/32 \
00685                 +t*(-19648027.f/384+t*(9469163.f/640+t*(-545977.f/192 \
00686                       +t*(156927.f/448+t*(-28909.f/1152 \
00687                           +t*(3569.f/4480))))))))); \
00688         dphi[1] = (8314091.f/56+t*(-49901303.f/144+t*(11290587.f/32 \
00689                 +t*(-19648027.f/96+t*(9469163.f/128+t*(-545977.f/32 \
00690                       +t*(156927.f/64+t*(-28909.f/144 \
00691                           +t*(32121.f/4480)))))))))*h_1; \
00692         t--; \
00693         phi[2] = 68776.f/7+t*(-1038011.f/28+t*(31157515.f/504+t*(-956669.f/16 \
00694                 +t*(3548009.f/96+t*(-2422263.f/160+t*(197255.f/48 \
00695                       +t*(-19959.f/28+t*(144545.f/2016 \
00696                           +t*(-3569.f/1120))))))))); \
00697         dphi[2] = (-1038011.f/28+t*(31157515.f/252+t*(-2870007.f/16 \
00698                 +t*(3548009.f/24+t*(-2422263.f/32+t*(197255.f/8 \
00699                       +t*(-19959.f/4+t*(144545.f/252 \
00700                           +t*(-32121.f/1120)))))))))*h_1; \
00701         t--; \
00702         phi[3] = -154+t*(12757.f/12+t*(-230123.f/72+t*(264481.f/48 \
00703                 +t*(-576499.f/96+t*(686147.f/160+t*(-96277.f/48 \
00704                       +t*(14221.f/24+t*(-28909.f/288+t*(3569.f/480))))))))); \
00705         dphi[3] = (12757.f/12+t*(-230123.f/36+t*(264481.f/16 \
00706                 +t*(-576499.f/24+t*(686147.f/32+t*(-96277.f/8 \
00707                       +t*(99547.f/24+t*(-28909.f/36 \
00708                           +t*(10707.f/160)))))))))*h_1; \
00709         t--; \
00710         phi[4] = 1+t*t*(-205.f/144+t*t*(91.f/192+t*(-6181.f/320 \
00711                 +t*(6337.f/96+t*(-2745.f/32+t*(28909.f/576 \
00712                       +t*(-3569.f/320))))))); \
00713         dphi[4] = t*(-205.f/72+t*t*(91.f/48+t*(-6181.f/64 \
00714                 +t*(6337.f/16+t*(-19215.f/32+t*(28909.f/72 \
00715                       +t*(-32121.f/320)))))))*h_1; \
00716         t--; \
00717         phi[5] = 1+t*t*(-205.f/144+t*t*(91.f/192+t*(6181.f/320 \
00718                 +t*(6337.f/96+t*(2745.f/32+t*(28909.f/576 \
00719                       +t*(3569.f/320))))))); \
00720         dphi[5] = t*(-205.f/72+t*t*(91.f/48+t*(6181.f/64 \
00721                 +t*(6337.f/16+t*(19215.f/32+t*(28909.f/72 \
00722                       +t*(32121.f/320)))))))*h_1; \
00723         t--; \
00724         phi[6] = -154+t*(-12757.f/12+t*(-230123.f/72+t*(-264481.f/48 \
00725                 +t*(-576499.f/96+t*(-686147.f/160+t*(-96277.f/48 \
00726                       +t*(-14221.f/24+t*(-28909.f/288+t*(-3569.f/480))))))))); \
00727         dphi[6] = (-12757.f/12+t*(-230123.f/36+t*(-264481.f/16 \
00728                 +t*(-576499.f/24+t*(-686147.f/32+t*(-96277.f/8 \
00729                       +t*(-99547.f/24+t*(-28909.f/36 \
00730                           +t*(-10707.f/160)))))))))*h_1; \
00731         t--; \
00732         phi[7] = 68776.f/7+t*(1038011.f/28+t*(31157515.f/504+t*(956669.f/16 \
00733                 +t*(3548009.f/96+t*(2422263.f/160+t*(197255.f/48 \
00734                       +t*(19959.f/28+t*(144545.f/2016+t*(3569.f/1120))))))))); \
00735         dphi[7] = (1038011.f/28+t*(31157515.f/252+t*(2870007.f/16 \
00736                 +t*(3548009.f/24+t*(2422263.f/32+t*(197255.f/8 \
00737                       +t*(19959.f/4+t*(144545.f/252 \
00738                           +t*(32121.f/1120)))))))))*h_1; \
00739         t--; \
00740         phi[8] = -56375+t*(-8314091.f/56+t*(-49901303.f/288+t*(-3763529.f/32 \
00741                 +t*(-19648027.f/384+t*(-9469163.f/640+t*(-545977.f/192 \
00742                       +t*(-156927.f/448+t*(-28909.f/1152 \
00743                           +t*(-3569.f/4480))))))))); \
00744         dphi[8] = (-8314091.f/56+t*(-49901303.f/144+t*(-11290587.f/32 \
00745                 +t*(-19648027.f/96+t*(-9469163.f/128+t*(-545977.f/32 \
00746                       +t*(-156927.f/64+t*(-28909.f/144 \
00747                           +t*(-32121.f/4480)))))))))*h_1; \
00748         t--; \
00749         phi[9] = 439375.f/7+t*(64188125.f/504+t*(231125375.f/2016 \
00750               +t*(17306975.f/288+t*(7761805.f/384+t*(2895587.f/640 \
00751                     +t*(129391.f/192+t*(259715.f/4032+t*(28909.f/8064 \
00752                           +t*(3569.f/40320))))))))); \
00753         dphi[9] = (64188125.f/504+t*(231125375.f/1008 \
00754               +t*(17306975.f/96+t*(7761805.f/96+t*(2895587.f/128 \
00755                     +t*(129391.f/32+t*(259715.f/576+t*(28909.f/1008 \
00756                           +t*(3569.f/4480)))))))))*h_1; \
00757         break; \
00758       case APPROX_BSPLINE: \
00759         phi[0] = (1.f/6) * (2-t) * (2-t) * (2-t); \
00760         dphi[0] = -0.5f * (2-t) * (2-t) * h_1; \
00761         t--; \
00762         phi[1] = (2.f/3) + t*t*(-1 + 0.5f*t); \
00763         dphi[1] = t*(-2 + 1.5f*t) * h_1; \
00764         t--; \
00765         phi[2] = (2.f/3) + t*t*(-1 - 0.5f*t); \
00766         dphi[2] = t*(-2 - 1.5f*t) * h_1; \
00767         t--; \
00768         phi[3] = (1.f/6) * (2+t) * (2+t) * (2+t); \
00769         dphi[3] = 0.5f * (2+t) * (2+t) * h_1; \
00770         break; \
00771       default: \
00772         return /* XXX NL_MSM_ERROR_SUPPORT */; \
00773     } \
00774   } while (0)
00775   /* closing ';' from use as function call */
00776 
00777 
00778 #endif // MSM_MACROS_H

Generated on Thu Nov 23 01:17:13 2017 for NAMD by  doxygen 1.4.7