eg2hprivatef.h

Go to the documentation of this file.
00001 
00002 /* ///////////////////////////////////////////////////////////////////////// */
00003 /* This file is a part of the BSTools package                                */
00004 /* written by Przemyslaw Kiciak                                              */
00005 /* ///////////////////////////////////////////////////////////////////////// */
00006 /* (C) Copyright by Przemyslaw Kiciak, 2005, 2008                            */
00007 /* this package is distributed under the terms of the                        */
00008 /* Lesser GNU Public License, see the file COPYING.LIB                       */
00009 /* ///////////////////////////////////////////////////////////////////////// */
00010 
00011 /* this header file is private for g2hole library functions; */
00012 /* it is NOT intended to be #included in application source files */
00013 
00014 #ifndef EG2HPRIVATEF_H
00015 #define EG2HPRIVATEF_H
00016 
00017 #ifndef EGHPRIVATEF_H
00018 #include "eghprivatef.h"
00019 #endif
00020 
00021 /* degrees of polynomial junction functions */
00022 #define G2_BF01DEG 2
00023 #define G2_CG01DEG 1
00024 #define G2_BF11DEG 4
00025 #define G2_CG11DEG 3
00026 #define G2_BF02DEG 3
00027 #define G2_CG02DEG 2
00028 #define G2_BF12DEG 5
00029 #define G2_CG12DEG 4
00030 
00031 /* degrees of patch cross derivatives */
00032 #define G2_CROSS00DEG 7  /* == G2H_OMCDEG */
00033 #define G2_CROSS01DEG 8
00034 #define G2_CROSS02DEG 9
00035 #define G2_CROSS10DEG 3
00036 #define G2_CROSS11DEG 6
00037 #define G2_CROSS12DEG 9
00038 
00039 #define G2_CROSSDEGSUM \
00040         (G2_CROSS00DEG+G2_CROSS01DEG+G2_CROSS02DEG+ \
00041          G2_CROSS10DEG+G2_CROSS11DEG+G2_CROSS12DEG)
00042 
00043 /* the following two numbers are relevant for spline bases */
00044 #define G2_AUXDEG0 (G2_CROSS01DEG-G2H_OMCDEG+1)
00045 #define G2_AUXDEG1 (G2_CROSS02DEG-G2H_OMCDEG+2)
00046 
00047 /* the #definitions below are for the construction with */
00048 /* the extended basis */
00049 #define G2_DBDIM 16    /* diagonal block dimension, 4*4 */
00050 #define G2_DIAGBLSIZE (G2_DBDIM*(G2_DBDIM+1)/2)
00051 
00052 
00053 /* number of quadrature knots */
00054 #define G2_NQUAD 16
00055 #define G2_NQUADSQ (G2_NQUAD*G2_NQUAD)
00056 #define G2_QUAD_FACTOR 10  /* for integration of spline basis functions */
00057 
00058 
00059 /* ////////////////////////////////////////////////////////////////////////// */
00060 /* private data of the construction procedures */
00061 typedef struct G2HolePrivateRecf {
00062     int      hole_m;
00063     int      nfunc_a,   /* number of "inner" basis functions */
00064              nfunc_b;   /* number of "outer" basis functions */
00065     char     opt_cp, opt_der1, opt_basis, opt_quad;  /* recorded options */
00066     vector2f *omcbc;    /* boundary conditions for auxiliary patches */
00067     vector2f *omc;      /* auxiliary patches representation */
00068     float    *jfunc;    /* coefficients of junction functions */
00069     vector2f *dicross;  /* curves describing cross derivatives */
00070                         /* of the domain patches */
00071     float    *AuxiMat;  /* matrices of transformations of derivatives */
00072                         /* for composing functions with domain patches */
00073     float    *basis_a,  /* Coons representations of "inner" basis functions */
00074              *basis_b;  /* Coons represetnationf of "outer" basis functions */
00075     unsigned char spdimen[4];   /* numbers of "inner" basis functions: */
00076                                 /* "half polynomial" and "splines" of degree */
00077                                 /* 3 and 4 */
00078     float    *partition;        /* partition of the full angle */
00079     GHoleSgnPartf *spartition;  /* sorted partition, having hole_k-hole_m */
00080                                 /* elements */
00081     float    spart_alpha0;      /* sorted partition bisectrix */
00082     float    *Amat, *Bmat;      /* matrices of scalar products */
00083                                 /* of basis functions */
00084     float    *Lmat;             /* decomposition factor L:  A=LL^T */
00085     float    *EAmat, *EBmat;    /* matrices for the extended basis */
00086     float    *ELmat;            /* decomposition factor for the */
00087                                 /* extended matrix */
00088 
00089     int      nconstr;           /* number of constraint equations */
00090     float    *Cmat, *RCmat;     /* matrices of constraint equations */
00091     int      naconstr, acdim;
00092     float    *ACmat, *ARCmat;
00093     int      extnconstr;        /* number of constraints and */
00094     float    *ECmat, *ERCmat;   /* matrices of constraint equations for */
00095                                 /* the extended matrix */
00096     int      extnaconstr, extacdim;
00097     float    *AECmat, *AERCmat;
00098 
00099     float    *BBmat;            /* matrix of scalar products, for */
00100                                 /* evaluation of the functional */
00101 
00102     int (*GetOption)( GHoleDomainf *domain, int query, int qn,
00103                       int *ndata, int **idata, float **fdata );
00104   } G2HolePrivateRecf;
00105 
00106 
00107 /* private data for the nonlinear constructions */
00108 typedef struct G2HNLPrivatef {
00109     int      auxc;    /* patch counter */
00110     vector3f *nldi;   /* NL patches */
00111     vector3f *acoeff;
00112     vector3f *rhole_cp;
00113     vector3f nlnv, reflv;
00114     vector2f *diu, *div, *diuu, *diuv, *divv,
00115              *diuuu, *diuuv, *diuvv, *divvv;
00116     float    *jac;
00117     float    *psiu, *psiv, *psiuu, *psiuv, *psivv,
00118              *psiuuu, *psiuuv, *psiuvv, *psivvv;
00119   } G2HNLPrivatef;
00120 
00121 typedef struct G2HNLFuncf {
00122     float    pu, pv, puu, puv, pvv, puuu, puuv, puvv, pvvv, jac;
00123     float    psiu, psiv, psiuu, psiuv, psivv, psiuuu, psiuuv, psiuvv, psivvv,
00124              psju, psjv, psjuu, psjuv, psjvv, psjuuu, psjuuv, psjuvv, psjvvv;
00125     vector2f L, Lpu, Lpv, Lpuu, Lpuv, Lpvv, Lpuuu, Lpuuv, Lpuvv, Lpvvv,
00126              Lpupu, Lpupv, Lpupuu, Lpupuv, Lpupvv, Lpupuuu, Lpupuuv, Lpupuvv,
00127              Lpupvvv, Lpvpv, Lpvpuu, Lpvpuv, Lpvpvv, Lpvpuuu, Lpvpuuv,
00128              Lpvpuvv, Lpvpvvv, Lpuupuu, Lpuupuv, Lpuupvv, Lpuvpuv, Lpuvpvv,
00129              Lpvvpvv, BLT;
00130     float    D, Dpu, Dpv, Dpupu, Dpupv, Dpvpv;
00131     float    B[3], Bpu[3], Bpv[3], Bpupu[3], Bpupv[3], Bpvpv[3];
00132     float    LBLT;
00133   } G2HNLFuncf;
00134 
00135 
00136 /* private data for the spline basis construction */
00137 typedef struct G2HoleSPrivateRecf {
00138     int nk, m1, m2;   /* parameters, which determine the space dimension */
00139     int nsfunc_c, nsfunc_d;
00140                       /* numbers of basis functions of various kinds */
00141     int csize, dsize; /* sizes of the blocks in the form matrix */
00142     int   lastbezknot;
00143     float bezknots[2*(G2H_FINALDEG+1)];  /* knots for Bezier polynomials */
00144     int   lastomcknot;
00145     float *omcknots;  /* knots of basis function auxiliary patches */
00146     int lastpvknot, lastpvvknot;
00147     float *pvknots, *pvvknots;
00148                       /* knots of the basis functions of the D block */
00149     int lastcknot;
00150     float *cknots;    /* knots of the basis functions of the C block */
00151     float *basis_d;   /* Coons representations of basis functions */
00152 
00153     int lastfpknot;
00154     float *fpknots;   /* knots of the final patches */
00155     float *SAMat, *SBMat;  /* form matrices for the spline basis */
00156     float *SLMat;          /* A=LL^T decomposition factor */
00157 
00158     int    splnconstr; /* number of constraints */
00159     float  *SCmat, *SRCmat; /* matrices of constraint equations */
00160     int    splnaconstr, splacdim;
00161     float  *ASCmat, *ASRCmat;
00162   } G2HoleSPrivateRecf;
00163 
00164 
00165 /* private data for spline nonlinear constructions */
00166 typedef struct G2HNLSPrivatef {
00167     G2HNLPrivatef nlpr; /* must be the first field */
00168     int   nkn;          /* number of quadrature knots */
00169     float *tkn;         /* quadrature knots */
00170     int   ftabsize;     /* function values table size */
00171     int   psize;        /* number of control points of each final patch  */
00172     int   *fkn, *lkn;   /* ranges of knots for the functions of block C  */
00173     float *cb, *cbt, *cbtt, *cbttt;  /* B-spline functions and their derivatives */
00174     int   *cfuncvi;     /* indexes of the first samples of C block functions */
00175     int   *dfuncvi;     /* indexes of the first samples of D block functions */
00176   } G2HNLSPrivatef;
00177 
00178 
00179 /* ////////////////////////////////////////////////////////////////////////// */
00180 extern G2HNLPrivatef *_g2h_nlprivf;
00181 
00182 /* ////////////////////////////////////////////////////////////////////////// */
00183 void _g2h_GetDiPatchCurvesf ( GHoleDomainf *domain, int i,
00184                     point2f **c00, vector2f **c01, vector2f **c02,
00185                     point2f **c10, vector2f **c11, vector2f **c12,
00186                     point2f **d00, vector2f **d01, vector2f **d02,
00187                     point2f **d10, vector2f **d11, vector2f **d12 );
00188 boolean _g2h_GetABasisAuxpf ( GHoleDomainf *domain, int fn,
00189                               float *br0, float *br0cr1, float *br0cr2 );
00190 boolean _g2h_GetBBasisAuxpf ( GHoleDomainf *domain, int fn,
00191                               float *bezfc, float *fcomc,
00192                               float *fcomcd, float *fcomcdd );
00193 void _g2h_GetBFAPatchCurvesf ( GHoleDomainf *domain, int fn, int i,
00194                     float **c00, float **c01, float **c02,
00195                     float **d00, float **d01, float **d02 );
00196 void _g2h_GetBFBPatchCurvesf ( GHoleDomainf *domain, int fn, int i,
00197                     float **c00, float **c01, float **c02,
00198                     float **c10, float **c11, float **c12,
00199                     float **d00, float **d01, float **d02,
00200                     float **d10, float **d11, float **d12 );
00201 
00202 boolean _g2h_TabDiPatchJac3f ( int nkn, const float *kn, const float *hfunc,
00203         const float *dhfunc, const float *ddhfunc, const float *dddhfunc,   
00204         const vector2f *c00, const vector2f *c01, const vector2f *c02,      
00205         const vector2f *c10, const vector2f *c11, const vector2f *c12,      
00206         const vector2f *d00, const vector2f *d01, const vector2f *d02,      
00207         const vector2f *d10, const vector2f *d11, const vector2f *d12,      
00208         float *jac, float *trd );
00209 boolean _g2h_TabLaplacianGradf ( int nkn, const float *tkn,
00210         const float *hfunc, const float *dhfunc, const float *ddhfunc,
00211         const float *dddhfunc,
00212         const float *fc00, const float *fc01, const float *fc02,
00213         const float *fc10, const float *fc11, const float *fc12,
00214         const float *fd00, const float *fd01, const float *fd02,
00215         const float *fd10, const float *fd11, const float *fd12,
00216         const float *trd,
00217         vector2f *lapgrad );
00218 boolean _g2h_TabLaplacianGrad0f ( int nkn, const float *tkn,
00219         const float *hfunc, const float *dhfunc, const float *ddhfunc,
00220         const float *dddhfunc,
00221         const float *fc00, const float *fc01, const float *fc02,
00222         const float *fd00, const float *fd01, const float *fd02,
00223         const float *trd,
00224         vector2f *lapgrad );
00225 
00226 boolean _g2h_VerifyJunctionFunctionsf ( GHoleDomainf *domain );
00227 boolean _g2h_VerifyDomPatchesf ( GHoleDomainf *domain );
00228                                                     
00229 /* ////////////////////////////////////////////////////////////////////////// */
00230 void g2h_ReflectVectorsf ( int n, const vector3f *v, vector3f *w );
00231 void g2h_nonlinoutpatchf ( int n, int m, const float *cp, void *usrptr );
00232 boolean _g2h_StopItf ( int itn, float gn0, float gn,
00233                        float cn, float dcn, float scf );
00234 boolean g2h_GetHoleSurrndPatchf ( GHoleDomainf *domain,       
00235                                   const point3f *hole_cp,
00236                                   int i, int j, point3f *bcp );
00237 boolean _g2h_ComputeNLNormalf ( GHoleDomainf *domain,       
00238                                 G2HNLPrivatef *nlprivate,       
00239                                 const point3f *hole_cp );
00240 boolean _g2h_TabNLDer0f ( GHoleDomainf *domain,
00241              int nkn, const float *tkn,       
00242              const float *hfunc, const float *dhfunc,
00243              const float *ddhfunc, const float *dddhfunc,
00244              vector2f *diu, vector2f *div,
00245              vector2f *diuu, vector2f *diuv, vector2f *divv,
00246              vector2f *diuuu, vector2f *diuuv, vector2f *diuvv, vector2f *divvv,
00247              float *fc00, float *fc01, float *fc02,
00248              float *fd00, float *fd01, float *fd02,
00249              float *psiu, float *psiv, 
00250              float *psiuu, float *psiuv, float *psivv,
00251              float *psiuuu, float *psiuuv, float *psiuvv, float *psivvv );
00252 boolean _g2h_TabNLDerf ( GHoleDomainf *domain,
00253              int nkn, float *tkn,       
00254              const float *hfunc, const float *dhfunc,
00255              const float *ddhfunc, const float *dddhfunc,
00256              vector2f *diu, vector2f *div,
00257              vector2f *diuu, vector2f *diuv, vector2f *divv,
00258              vector2f *diuuu, vector2f *diuuv, vector2f *diuvv, vector2f *divvv,
00259              float *fc00, float *fc01, float *fc02,
00260              float *fc10, float *fc11, float *fc12,
00261              float *fd00, float *fd01, float *fd02,
00262              float *fd10, float *fd11, float *fd12,
00263              float *psiu, float *psiv, 
00264              float *psiuu, float *psiuv, float *psivv,
00265              float *psiuuu, float *psiuuv, float *psiuvv, float *psivvv );
00266 boolean _g2h_TabNLBasisFunctionsf ( GHoleDomainf *domain,       
00267                                     G2HNLPrivatef *nlpr );
00268 void _g2h_IntFunc1af ( G2HNLFuncf *f, float *funct );
00269 void _g2h_IntFunc1bf ( G2HNLFuncf *f, float *funct );
00270 void _g2h_IntFunc1cf ( G2HNLFuncf *f, float *funct );
00271 void _g2h_IntFunc2bf ( G2HNLFuncf *f, float *grad );
00272 void _g2h_IntFunc2cf ( G2HNLFuncf *f, vector2f *Li, float *Bi, vector2f *BiLT,       
00273                        float *Di, float *grad );
00274 void _g2h_IntFunc3cf ( G2HNLFuncf *f, vector2f *Li, vector2f *Lj,       
00275                        vector2f *BiLT, vector2f *BjLT,       
00276                        float Di, float Dj, float *hessian );
00277  
00278 /* ////////////////////////////////////////////////////////////////////////// */
00279 /* the following horrible macros are used a number of times in the code. */
00280 /* They assume that some variables are declared and have proper initial */
00281 /* values */
00282 #define G2GetPolynomialAddresses(jfunc,b01,c01,f01,g01,b11,c11,f11,g11,\
00283     b02,c02,f02,g02,b12,c12,f12,g12,b01b01,twob01c01,c01c01,\
00284     f01f01,twof01g01,g01g01,b11b11,twob11c11,c11c11,\
00285     f11f11,twof11g11,g11g11)\
00286   b01 = jfunc; \
00287   c01 = &b01[hole_k*(G2_BF01DEG+1)];  f01 = &c01[hole_k*(G2_CG01DEG+1)]; \
00288   g01 = &f01[hole_k*(G2_BF01DEG+1)];  b11 = &g01[hole_k*(G2_CG01DEG+1)]; \
00289   c11 = &b11[hole_k*(G2_BF11DEG+1)];  f11 = &c11[hole_k*(G2_CG11DEG+1)]; \
00290   g11 = &f11[hole_k*(G2_BF11DEG+1)];  b02 = &g11[hole_k*(G2_CG11DEG+1)]; \
00291   c02 = &b02[hole_k*(G2_BF02DEG+1)];  f02 = &c02[hole_k*(G2_CG02DEG+1)]; \
00292   g02 = &f02[hole_k*(G2_BF02DEG+1)];  b12 = &g02[hole_k*(G2_CG02DEG+1)]; \
00293   c12 = &b12[hole_k*(G2_BF12DEG+1)];  f12 = &c12[hole_k*(G2_CG12DEG+1)]; \
00294   g12 = &f12[hole_k*(G2_BF12DEG+1)]; \
00295   b01b01    = &g12[hole_k*(G2_CG12DEG+1)]; \
00296   twob01c01 = &b01b01[hole_k*(2*G2_BF01DEG+1)]; \
00297   c01c01    = &twob01c01[hole_k*(G2_BF01DEG+G2_CG01DEG+1)]; \
00298   f01f01    = &c01c01[hole_k*(2*G2_CG01DEG+1)]; \
00299   twof01g01 = &f01f01[hole_k*(2*G2_BF01DEG+1)]; \
00300   g01g01    = &twof01g01[hole_k*(G2_BF01DEG+G2_CG01DEG+1)]; \
00301   b11b11    = &g01g01[hole_k*(2*G2_CG01DEG+1)]; \
00302   twob11c11 = &b11b11[hole_k*(2*G2_BF11DEG+1)]; \
00303   c11c11    = &twob11c11[hole_k*(G2_BF11DEG+G2_CG11DEG+1)]; \
00304   f11f11    = &c11c11[hole_k*(2*G2_CG11DEG+1)]; \
00305   twof11g11 = &f11f11[hole_k*(2*G2_BF11DEG+1)]; \
00306   g11g11    = &twof11g11[hole_k*(G2_BF11DEG+G2_CG11DEG+1)]
00307 
00308 #define G2GetPolynomialAddresses0(jfunc,b01,c01,f01,g01,b11,c11,f11,g11,\
00309     b02,c02,f02,g02,b12,c12,f12,g12,b01b01,twob01c01,c01c01,\
00310     f01f01,twof01g01,g01g01)\
00311   b01 = jfunc; \
00312   c01 = &b01[hole_k*(G2_BF01DEG+1)];  f01 = &c01[hole_k*(G2_CG01DEG+1)]; \
00313   g01 = &f01[hole_k*(G2_BF01DEG+1)];  b11 = &g01[hole_k*(G2_CG01DEG+1)]; \
00314   c11 = &b11[hole_k*(G2_BF11DEG+1)];  f11 = &c11[hole_k*(G2_CG11DEG+1)]; \
00315   g11 = &f11[hole_k*(G2_BF11DEG+1)];  b02 = &g11[hole_k*(G2_CG11DEG+1)]; \
00316   c02 = &b02[hole_k*(G2_BF02DEG+1)];  f02 = &c02[hole_k*(G2_CG02DEG+1)]; \
00317   g02 = &f02[hole_k*(G2_BF02DEG+1)];  b12 = &g02[hole_k*(G2_CG02DEG+1)]; \
00318   c12 = &b12[hole_k*(G2_BF12DEG+1)];  f12 = &c12[hole_k*(G2_CG12DEG+1)]; \
00319   g12 = &f12[hole_k*(G2_BF12DEG+1)]; \
00320   b01b01    = &g12[hole_k*(G2_CG12DEG+1)]; \
00321   twob01c01 = &b01b01[hole_k*(2*G2_BF01DEG+1)]; \
00322   c01c01    = &twob01c01[hole_k*(G2_BF01DEG+G2_CG01DEG+1)]; \
00323   f01f01    = &c01c01[hole_k*(2*G2_CG01DEG+1)]; \
00324   twof01g01 = &f01f01[hole_k*(2*G2_BF01DEG+1)]; \
00325   g01g01    = &twof01g01[hole_k*(G2_BF01DEG+G2_CG01DEG+1)]
00326 
00327 #define G2GetPolyAddr(jfunc,b01,c01,f01,g01,b11,c11,f11,g11)\
00328   b01 = jfunc; \
00329   c01 = &b01[hole_k*(G2_BF01DEG+1)];  f01 = &c01[hole_k*(G2_CG01DEG+1)]; \
00330   g01 = &f01[hole_k*(G2_BF01DEG+1)];  b11 = &g01[hole_k*(G2_CG01DEG+1)]; \
00331   c11 = &b11[hole_k*(G2_BF11DEG+1)];  f11 = &c11[hole_k*(G2_CG11DEG+1)]; \
00332   g11 = &f11[hole_k*(G2_BF11DEG+1)]
00333 
00334 #define G2GetDiCrossAddresses() \
00335   dir0cr1 = privateG2->dicross; \
00336   diq0cr1 = &dir0cr1[hole_k*(G2_CROSS01DEG+1)]; \
00337   dir1cr1 = &diq0cr1[hole_k*(G2_CROSS01DEG+1)]; \
00338   diq1cr1 = &dir1cr1[hole_k*(G2_CROSS11DEG+1)]; \
00339   dir0cr2 = &diq1cr1[hole_k*(G2_CROSS11DEG+1)]; \
00340   diq0cr2 = &dir0cr2[hole_k*(G2_CROSS02DEG+1)]; \
00341   dir1cr2 = &diq0cr2[hole_k*(G2_CROSS02DEG+1)]; \
00342   diq1cr2 = &dir1cr2[hole_k*(G2_CROSS12DEG+1)]
00343 
00344 #define G2GetBFuncACrossAddresses() \
00345   bbr0 = privateG2->basis_a; \
00346   bbr0cr1 = &bbr0[nfunc_a*hole_k*(G2_CROSS00DEG+1)]; \
00347   bbq0cr1 = &bbr0cr1[nfunc_a*hole_k*(G2_CROSS01DEG+1)]; \
00348   bbr0cr2 = &bbq0cr1[nfunc_a*hole_k*(G2_CROSS01DEG+1)]; \
00349   bbq0cr2 = &bbr0cr2[nfunc_a*hole_k*(G2_CROSS02DEG+1)]
00350 
00351 #define G2GetBFuncBCrossAddresses() \
00352   bbr0 = privateG2->basis_b; \
00353   bbr1 = &bbr0[nfunc_b*hole_k*(G2_CROSS00DEG+1)]; \
00354   bbq1 = &bbr1[nfunc_b*hole_k*(G2_CROSS10DEG+1)]; \
00355   bbr0cr1 = &bbq1[nfunc_b*hole_k*(G2_CROSS10DEG+1)]; \
00356   bbq0cr1 = &bbr0cr1[nfunc_b*hole_k*(G2_CROSS01DEG+1)]; \
00357   bbr1cr1 = &bbq0cr1[nfunc_b*hole_k*(G2_CROSS01DEG+1)]; \
00358   bbq1cr1 = &bbr1cr1[nfunc_b*hole_k*(G2_CROSS11DEG+1)]; \
00359   bbr0cr2 = &bbq1cr1[nfunc_b*hole_k*(G2_CROSS11DEG+1)]; \
00360   bbq0cr2 = &bbr0cr2[nfunc_b*hole_k*(G2_CROSS02DEG+1)]; \
00361   bbr1cr2 = &bbq0cr2[nfunc_b*hole_k*(G2_CROSS02DEG+1)]; \
00362   bbq1cr2 = &bbr1cr2[nfunc_b*hole_k*(G2_CROSS12DEG+1)]
00363 
00364 #define G2GetFCAddresses() \
00365   fc01 = &fc00[hole_k*spdimen*(G2_CROSS00DEG+1)]; \
00366   fc02 = &fc01[hole_k*spdimen*(G2_CROSS01DEG+1)]; \
00367   fc10 = &fc02[hole_k*spdimen*(G2_CROSS02DEG+1)]; \
00368   fc11 = &fc10[hole_k*spdimen*(G2_CROSS10DEG+1)]; \
00369   fc12 = &fc11[hole_k*spdimen*(G2_CROSS11DEG+1)]; \
00370   fd00 = &fc12[hole_k*spdimen*(G2_CROSS12DEG+1)]; \
00371   fd01 = &fd00[hole_k*spdimen*(G2_CROSS00DEG+1)]; \
00372   fd02 = &fd01[hole_k*spdimen*(G2_CROSS01DEG+1)]; \
00373   fd10 = &fd02[hole_k*spdimen*(G2_CROSS02DEG+1)]; \
00374   fd11 = &fd10[hole_k*spdimen*(G2_CROSS10DEG+1)]; \
00375   fd12 = &fd11[hole_k*spdimen*(G2_CROSS11DEG+1)]
00376 
00377 /* ///////////////////////////////////////////////////////////////////////// */
00378 #define G2GetSFCAddresses() \
00379   sfc01 = &sfc00[hole_k*spdimen*(lastomcknot-G2_CROSS00DEG)]; \
00380   sfc02 = &sfc01[hole_k*spdimen*(lastpvknot-G2_CROSS01DEG)]; \
00381   sfd00 = &sfc02[hole_k*spdimen*(lastpvvknot-G2_CROSS02DEG)]; \
00382   sfd01 = &sfd00[hole_k*spdimen*(lastomcknot-G2_CROSS00DEG)]; \
00383   sfd02 = &sfd01[hole_k*spdimen*(lastpvknot-G2_CROSS01DEG)]
00384 
00385 /* ///////////////////////////////////////////////////////////////////////// */
00386 boolean _g2h_GetExtBlockAddressesf ( GHoleDomainf *domain,
00387                                      float **Aii, float **Aki, float **Akk,
00388                                      float **Bi, float **Bk, float **Lii );
00389 
00390 boolean _g2h_SetRightSidef ( GHoleDomainf *domain,
00391                              int spdimen, CONST_ float *hole_cp,
00392                              float *fc00, float *b );
00393 boolean _g2h_OutputPatchesf ( GHoleDomainf *domain,
00394                        int spdimen, CONST_ float *x, float *fc00, void *usrptr,
00395                        void (*outpatch) ( int n, int m, const float *cp,
00396                                           void *usrptr ) );
00397 
00398 boolean _g2h_SetExtRightSidef ( GHoleDomainf *domain,
00399                                 const float *Bi, const float *Bk,
00400                                 int spdimen, CONST_ float *hole_cp,
00401                                 float *fc00, float *b );
00402 boolean _g2h_OutputExtPatchesf ( GHoleDomainf *domain,
00403                            int spdimen, CONST_ float *x, float *fc00, void *usrptr,
00404                            void (*outpatch) ( int n, int m, const float *cp,
00405                                               void *usrptr ) );
00406 
00407 boolean _g2h_TabTensBezPolyDer3f ( int nkn, const float *tkn,
00408              float *tbez, float *tbezu, float *tbezv,
00409              float *tbezuu, float *tbezuv, float *tbezvv,
00410              float *tbezuuu, float *tbezuuv, float *tbezuvv, float *tbezvvv );
00411 
00412 /* ///////////////////////////////////////////////////////////////////////// */
00413 void _g2h_IntFunc1af ( G2HNLFuncf *f, float *funct );
00414 void _g2h_IntFunc1bf ( G2HNLFuncf *f, float *funct );
00415 void _g2h_IntFunc1cf ( G2HNLFuncf *f, float *funct );
00416 void _g2h_IntFunc2bf ( G2HNLFuncf *f, float *grad );
00417 void _g2h_IntFunc2cf ( G2HNLFuncf *f, vector2f *Li, float *Bi, vector2f *BiLT,
00418                        float *Di, float *grad );
00419 void _g2h_IntFunc3cf ( G2HNLFuncf *f, vector2f *Li, vector2f *Lj,
00420                        vector2f *BiLT, vector2f *BjLT,
00421                        float Di, float Dj, float *hessian );
00422 
00423 /* ///////////////////////////////////////////////////////////////////////// */
00424 void g2h_DestroySPrivateDataf ( GHoleDomainf *domain );
00425 boolean _g2h_GetSplDBasisAuxpf ( GHoleDomainf *domain, int fn, int cn,
00426                    int *nzc, float *fcomc, float *fcomcd, float *fcomcdd );
00427 boolean _g2h_GetSplDBasisCrossDerf ( GHoleDomainf *domain, int fn, int cn,
00428                  float *fcomc, float *pv, float *pvv, float *pu, float *puu );
00429 
00430 boolean _g2h_TabBSFuncDer3f ( int deg, int lastknot, const float *knots,
00431                               int i0, int i1,
00432                               int n, const float *tkn, int *fkn, int *lkn,
00433                               float *b, float *bt, float *btt, float *bttt );
00434 void _g2h_TensDer3f ( float p, float pu, float puu, float puuu,
00435                       float q, float qv, float qvv, float qvvv,
00436                       float *pq );
00437 
00438 boolean _g2h_FuncDSuppf ( int hole_k, int nk, int m1, int fn, int i,
00439                           int *nzc, int *i0, int *i1, int *j0, int *j1 );
00440 
00441 boolean _g2h_SetSplRightSidef ( GHoleDomainf *domain,
00442                                 int spdimen, CONST_ float *hole_cp,
00443                                 float *fc00, float *b );
00444 boolean _g2h_OutputSplPatchesf ( GHoleDomainf *domain,
00445                 int spdimen, CONST_ float *x, float *fc00, void *usrptr,
00446                 void (*outpatch) ( int n, int lknu, const float *knu,
00447                                    int m, int lknv, const float *knv,
00448                                    const float *cp, void *usrptr ) );
00449 
00450 #endif
00451