AdvApp2Var_SysBase::mcrgene_ size reduced from 1000 to 32 elements, and each element reworked into typed structure.
fixed IntAna_Curve.cxx to prevent access to #NAN# SigneSqrtDis
fixed alignment of doubles by 8 bytes, and minor corrections
Minor correction: static const N given more specific name (MAX_ALLOC_NB)
Added QAcommands OCC23952sweep and OCC23952intersect
Added test cases bugs/modalg_5/bug23952_1 bug23952_2
doublereal *hermit,
integer *iercod)
{
- static integer c__1 = 1;
+ integer c__1 = 1;
/* System generated locals */
integer contr1_dim1, contr1_offset, contr2_dim1, contr2_offset,
i__2, i__3;
/* Local variables */
- static integer nroo2, ncfhe, nd, ii, kk;
- static integer ibb, kkm, kkp;
- static doublereal bid1, bid2, bid3;
+ integer nroo2, ncfhe, nd, ii, kk;
+ integer ibb, kkm, kkp;
+ doublereal bid1, bid2, bid3;
/* **********************************************************************
*/
i__2, i__3;
/* Local variables */
- static integer nd, ii, jj, ibb;
- static doublereal bid;
+ integer nd, ii, jj, ibb;
+ doublereal bid;
/* ***********************************************************************
doublereal d__1;
/* Local variables */
- static integer ideb, ifin, nroo2, ideru, iderv;
- static doublereal renor;
- static integer ii, nd, ibb, iim, nbp, iip;
- static doublereal bid1, bid2;
+ integer ideb, ifin, nroo2, ideru, iderv;
+ doublereal renor;
+ integer ii, nd, ibb, iim, nbp, iip;
+ doublereal bid1, bid2;
/* **********************************************************************
*/
integer crvjac_dim1, crvjac_offset, i__1, i__2;
/* Local variables */
- static integer idim, ncfja, ncfnw, ndses, ii, kk, ibb, ier;
- static integer nbr0;
+ integer idim, ncfja, ncfnw, ndses, ii, kk, ibb, ier;
+ integer nbr0;
/* ***********************************************************************
integer hermit_dim1, hermit_offset;
/* Local variables */
- static integer ibb;
+ integer ibb;
crvjac_dim1, crvjac_offset, cgauss_dim1;
/* Local variables */
- static integer ibb;
+ integer ibb;
/* **********************************************************************
*/
doublereal d__1;
/* Local variables */
- static doublereal rider, riord;
- static integer nd, ibb;
- static doublereal bid;
+ doublereal rider, riord;
+ integer nd, ibb;
+ doublereal bid;
/* **********************************************************************
*/
integer i__1;
/* Local variables */
- static doublereal alinu, blinu, alinv, blinv;
- static integer ii, ibb;
+ doublereal alinu, blinu, alinv, blinv;
+ integer ii, ibb;
/* ***********************************************************************
*/
patjac_dim2, patjac_offset, i__1, i__2, i__3, i__4, i__5;
/* Local variables */
- static logical ldbg;
- static integer ndgu, ndgv;
- static doublereal bidu1, bidu2, bidv1, bidv2;
- static integer ioru1, iorv1, ii, nd, jj, ku, kv;
- static doublereal cnt1, cnt2, cnt3, cnt4;
+ logical ldbg;
+ integer ndgu, ndgv;
+ doublereal bidu1, bidu2, bidv1, bidv2;
+ integer ioru1, iorv1, ii, nd, jj, ku, kv;
+ doublereal cnt1, cnt2, cnt3, cnt4;
/* **********************************************************************
*/
vhermt_dim1, vhermt_offset, i__1, i__2, i__3, i__4;
/* Local variables */
- static logical ldbg;
- static integer ndgv1, ndgv2, ii, jj, nd, kk;
- static doublereal bid1, bid2;
+ logical ldbg;
+ integer ndgv1, ndgv2, ii, jj, nd, kk;
+ doublereal bid1, bid2;
/* **********************************************************************
*/
uhermt_dim1, uhermt_offset, i__1, i__2, i__3, i__4;
/* Local variables */
- static logical ldbg;
- static integer ndgu1, ndgu2, ii, jj, nd, kk;
- static doublereal bid1, bid2;
+ logical ldbg;
+ integer ndgu1, ndgu2, ii, jj, nd, kk;
+ doublereal bid1, bid2;
/* **********************************************************************
*/
patcan_offset, i__1, i__2;
/* Local variables */
- static logical ldbg;
- static integer ilon1, ilon2, ii, nd;
+ logical ldbg;
+ integer ilon1, ilon2, ii, nd;
/* **********************************************************************
*/
doublereal *diditb)
{
- static integer c__1 = 1;
+ integer c__1 = 1;
/* System generated locals */
integer contr1_dim1, contr1_dim2, contr1_offset, contr2_dim1, contr2_dim2,
i__5;
/* Local variables */
- static integer ncfhu, ncfhv, nuroo, nvroo, nd, ii, jj, kk, ll, ibb, kkm,
+ integer ncfhu, ncfhv, nuroo, nvroo, nd, ii, jj, kk, ll, ibb, kkm,
llm, kkp, llp;
- static doublereal bid1, bid2, bid3, bid4;
- static doublereal diu1, diu2, div1, div2, sou1, sou2, sov1, sov2;
+ doublereal bid1, bid2, bid3, bid4;
+ doublereal diu1, diu2, div1, div2, sou1, sou2, sov1, sov2;
/* **********************************************************************
*/
doublereal *diditb)
{
- static integer c__1 = 1;
+ integer c__1 = 1;
/* System generated locals */
integer sotbv1_dim1, sotbv1_dim2, sotbv1_offset, sotbv2_dim1, sotbv2_dim2,
sotbv2_offset, ditbv1_dim1, ditbv1_dim2, ditbv1_offset,
disotb_dim1, disotb_dim2, disotb_offset, i__1, i__2, i__3, i__4;
/* Local variables */
- static integer ncfhv, nuroo, nvroo, ii, nd, jj, kk, ibb, jjm, jjp;
- static doublereal bid1, bid2, bid3, bid4;
+ integer ncfhv, nuroo, nvroo, ii, nd, jj, kk, ibb, jjm, jjp;
+ doublereal bid1, bid2, bid3, bid4;
/* **********************************************************************
*/
doublereal *diditb)
{
- static integer c__1 = 1;
+ integer c__1 = 1;
/* System generated locals */
integer sotbu1_dim1, sotbu1_dim2, sotbu1_offset, sotbu2_dim1, sotbu2_dim2,
disotb_dim1, disotb_dim2, disotb_offset, i__1, i__2, i__3, i__4;
/* Local variables */
- static integer ncfhu, nuroo, nvroo, ii, nd, jj, kk, ibb, kkm, kkp;
- static doublereal bid1, bid2, bid3, bid4;
+ integer ncfhu, nuroo, nvroo, ii, nd, jj, kk, ibb, kkm, kkp;
+ doublereal bid1, bid2, bid3, bid4;
/* **********************************************************************
*/
integer *iercod)
{
- static integer c__8 = 8;
+ integer c__8 = 8;
/* System generated locals */
integer contr1_dim1, contr1_dim2, contr1_offset, contr2_dim1, contr2_dim2,
disotb_offset;
/* Local variables */
- static integer ilong;
- static intptr_t iofwr;
- static doublereal wrkar[1];
- static integer iszwr;
- static integer ibb, ier;
- static integer isz1, isz2, isz3, isz4;
- static intptr_t ipt1, ipt2, ipt3, ipt4;
+ integer ilong;
+ intptr_t iofwr;
+ doublereal* wrkar = 0;
+ integer iszwr;
+ integer ibb, ier;
+ integer isz1, isz2, isz3, isz4;
+ intptr_t ipt1, ipt2, ipt3, ipt4;
--sotbv2;
--ditbv1;
--ditbv2;
+ AdvApp2Var_SysBase anAdvApp2Var_SysBase;
/* Function Body */
ibb = AdvApp2Var_SysBase::mnfndeb_();
isz3 = ((*iordru + 1) << 1) * *nbpntu;
isz4 = ((*iordrv + 1) << 1) * *nbpntv;
iszwr = isz1 + isz2 + isz3 + isz4;
- AdvApp2Var_SysBase::mcrrqst_(&c__8, &iszwr, wrkar, &iofwr, &ier);
+ anAdvApp2Var_SysBase.mcrrqst_(&c__8, &iszwr, wrkar, &iofwr, &ier);
if (ier > 0) {
goto L9013;
}
L9999:
if (iofwr != 0) {
- AdvApp2Var_SysBase::mcrdelt_(&c__8, &iszwr, wrkar, &iofwr, &ier);
+ anAdvApp2Var_SysBase.mcrdelt_(&c__8, &iszwr, wrkar, &iofwr, &ier);
}
if (ier > 0) {
*iercod = 13;
integer *iercod)
{
- static integer c__8 = 8;
+ integer c__8 = 8;
/* System generated locals */
integer sosotb_dim1, sosotb_dim2, sosotb_offset, disotb_dim1, disotb_dim2,
patjac_offset;
/* Local variables */
- static logical ldbg;
- static intptr_t iofwr;
- static doublereal wrkar[1];
- static integer iszwr;
- static integer ier;
- static integer isz1, isz2, isz3, isz4, isz5, isz6, isz7;
- static intptr_t ipt1, ipt2, ipt3, ipt4, ipt5, ipt6, ipt7;
+ logical ldbg;
+ intptr_t iofwr;
+ doublereal* wrkar = 0;
+ integer iszwr;
+ integer ier;
+ integer isz1, isz2, isz3, isz4, isz5, isz6, isz7;
+ intptr_t ipt1, ipt2, ipt3, ipt4, ipt5, ipt6, ipt7;
isz6 = *ndjacv + 1 - ((*iordrv + 1) << 1);
isz7 = *ndimen << 2;
iszwr = isz1 + isz2 + isz3 + isz4 + isz5 + isz6 + isz7;
- AdvApp2Var_SysBase::mcrrqst_(&c__8, &iszwr, wrkar, &iofwr, &ier);
+ AdvApp2Var_SysBase anAdvApp2Var_SysBase;
+ anAdvApp2Var_SysBase.mcrrqst_(&c__8, &iszwr, wrkar, &iofwr, &ier);
if (ier > 0) {
goto L9013;
}
L9999:
if (iofwr != 0) {
- AdvApp2Var_SysBase::mcrdelt_(&c__8, &iszwr, wrkar, &iofwr, &ier);
+ anAdvApp2Var_SysBase.mcrdelt_(&c__8, &iszwr, wrkar, &iofwr, &ier);
}
if (ier > 0) {
*iercod = 13;
patjac_offset, vecerr_dim1, vecerr_offset, i__1, i__2, i__3, i__4;
/* Local variables */
- static logical ldbg;
- static integer idim, igsu, minu, minv, maxu, maxv, igsv;
- static doublereal vaux[3];
- static integer i2rdu, i2rdv, ndses, nd, ii, jj, kk, nu, nv;
- static doublereal zu, zv;
- static integer nu1, nv1;
+ logical ldbg;
+ integer idim, igsu, minu, minv, maxu, maxv, igsv;
+ doublereal vaux[3];
+ integer i2rdu, i2rdv, ndses, nd, ii, jj, kk, nu, nv;
+ doublereal zu, zv;
+ integer nu1, nv1;
/* **********************************************************************
*/
soditb_offset, diditb_dim1, i__1, i__2;
/* Local variables */
- static logical ldbg;
- static integer nptu2, nptv2, ii, jj;
- static doublereal bid0, bid1, bid2;
+ logical ldbg;
+ integer nptu2, nptv2, ii, jj;
+ doublereal bid0, bid1, bid2;
/* **********************************************************************
*/
patjac_offset, i__1, i__2;
/* Local variables */
- static logical ldbg;
- static integer nptv2, ii, jj;
- static doublereal bid1;
+ logical ldbg;
+ integer nptv2, ii, jj;
+ doublereal bid1;
/* **********************************************************************
*/
fpntab_offset, i__1;
/* Local variables */
- static logical ldbg;
- static integer ibid1, ibid2, iuouv, nd;
- static integer isz1, isz2;
+ logical ldbg;
+ integer ibid1, ibid2, iuouv, nd;
+ integer isz1, isz2;
/* **********************************************************************
*/
integer *iercod)
{
- static integer c__0 = 0;
+ integer c__0 = 0;
/* System generated locals */
integer sosotb_dim1, sosotb_dim2, sosotb_offset, disotb_dim1, disotb_dim2,
disotb_offset, soditb_dim1, soditb_dim2, soditb_offset,
fpntab_offset, i__1, i__2, i__3;
/* Local variables */
- static integer jdec;
- static logical ldbg;
- static doublereal alinu, blinu, alinv, blinv, tcons;
- static doublereal dbfn1[2], dbfn2[2];
- static integer nuroo, nvroo, id, iu, iv;
- static doublereal um, up;
+ integer jdec;
+ logical ldbg;
+ doublereal alinu, blinu, alinv, blinv, tcons;
+ doublereal dbfn1[2], dbfn2[2];
+ integer nuroo, nvroo, id, iu, iv;
+ doublereal um, up;
/* **********************************************************************
doublereal d__1;
/* Local variables */
- static logical ldbg;
- static integer minu, minv;
- static doublereal vaux[2];
- static integer ii, nd, jj;
- static doublereal bid0, bid1;
+ logical ldbg;
+ integer minu, minv;
+ doublereal vaux[2];
+ integer ii, nd, jj;
+ doublereal bid0, bid1;
/* **********************************************************************
*/
doublereal d__1;
/* Local variables */
- static logical ldbg;
- static doublereal vaux[2];
- static integer i2rdu, i2rdv;
- static doublereal errnu, errnv;
- static integer ii, nd, jj, nu, nv;
- static doublereal bid0, bid1;
+ logical ldbg;
+ doublereal vaux[2];
+ integer i2rdu, i2rdv;
+ doublereal errnu, errnv;
+ integer ii, nd, jj, nu, nv;
+ doublereal bid0, bid1;
/* **********************************************************************
*/
integer *iercod)
{
- static integer c__8 = 8;
+ integer c__8 = 8;
/* System generated locals */
integer courbe_dim1, courbe_dim2, courbe_offset, somtab_dim1, somtab_dim2,
doublereal d__1;
/* Local variables */
- static integer ideb;
- static doublereal tmil;
- static integer ideb1, ibid1, ibid2, ncfja, ndgre, ilong,
+ integer ideb;
+ doublereal tmil;
+ integer ideb1, ibid1, ibid2, ncfja, ndgre, ilong,
ndwrk;
- static doublereal wrkar[1];
- static integer nupil;
- static intptr_t iofwr;
- static doublereal uvpav[4] /* was [2][2] */;
- static integer nd, ii;
- static integer ibb;
- static integer ier;
- static doublereal uv11[4] /* was [2][2] */;
- static integer ncb1;
- static doublereal eps3;
- static integer isz1, isz2, isz3, isz4, isz5;
- static intptr_t ipt1, ipt2, ipt3, ipt4, ipt5,iptt, jptt;
+ doublereal* wrkar = 0;
+ integer nupil;
+ intptr_t iofwr;
+ doublereal uvpav[4] /* was [2][2] */;
+ integer nd, ii;
+ integer ibb;
+ integer ier;
+ doublereal uv11[4] /* was [2][2] */;
+ integer ncb1;
+ doublereal eps3;
+ integer isz1, isz2, isz3, isz4, isz5;
+ intptr_t ipt1, ipt2, ipt3, ipt4, ipt5,iptt, jptt;
/* **********************************************************************
*/
courbe_dim2 = *ndimen;
courbe_offset = courbe_dim1 * (courbe_dim2 + 1) + 1;
courbe -= courbe_offset;
+ AdvApp2Var_SysBase anAdvApp2Var_SysBase;
/* Function Body */
ibb = AdvApp2Var_SysBase::mnfndeb_();
isz5 = (*ndgjac + 1) * *ndimen;
ndwrk = isz1 + isz2 + isz3 + isz4 + isz5;
- AdvApp2Var_SysBase::mcrrqst_(&c__8, &ndwrk, wrkar, &iofwr, &ier);
+ anAdvApp2Var_SysBase.mcrrqst_(&c__8, &ndwrk, wrkar, &iofwr, &ier);
if (ier > 0) {
goto L9013; }
/* --> For the parameters of discretisation (NBROOT+2 extremities). */
L9900:
if (iofwr != 0) {
- AdvApp2Var_SysBase::mcrdelt_(&c__8, &ndwrk, wrkar, &iofwr, &ier);
+ anAdvApp2Var_SysBase.mcrdelt_(&c__8, &ndwrk, wrkar, &iofwr, &ier);
}
if (ier > 0) {
*iercod = 13;
doublereal d__1, d__2;
/* Local variables */
- static integer idim, ncfu, ncfv, id, ii, nd, jj, ku, kv, ns, ibb;
- static doublereal bid;
- static doublereal tol;
+ integer idim, ncfu, ncfv, id, ii, nd, jj, ku, kv, ns, ibb;
+ doublereal bid;
+ doublereal tol;
/* **********************************************************************
*/
integer i__1;
/* Local variables */
- static logical ldbg;
- static integer numax, ii;
- static doublereal bid;
+ logical ldbg;
+ integer numax, ii;
+ doublereal bid;
/* **********************************************************************
integer patjac_dim1, patjac_dim2, patjac_offset, i__1, i__2, i__3;
/* Local variables */
- static logical ldbg;
- static integer minu, minv, idebu, idebv, ii, nd, jj;
- static doublereal bid0, bid1;
+ logical ldbg;
+ integer minu, minv, idebu, idebv, ii, nd, jj;
+ doublereal bid0, bid1;
/* **********************************************************************
integer i__1;
/* Local variables */
- static integer ii, ibb;
+ integer ii, ibb;
/* **********************************************************************
*/
crvjac_dim1, crvjac_offset, gsstab_dim1, i__1, i__2, i__3;
/* Local variables */
- static integer igss, ikdeb;
- static doublereal bidon;
- static integer nd, ik, ir, nbroot, ibb;
+ integer igss, ikdeb;
+ doublereal bidon;
+ integer nd, ik, ir, nbroot, ibb;
/* **********************************************************************
*/
integer crvjac_dim1, crvjac_offset, i__1, i__2;
/* Local variables */
- static doublereal bidj;
- static integer i__, ia, nd, ncfcut, ibb;
- static doublereal bid;
+ doublereal bidj;
+ integer i__, ia, nd, ncfcut, ibb;
+ doublereal bid;
/* **********************************************************************
*/
integer cgauss_dim1, i__1;
/* Local variables */
- static integer kjac, iptt, ipdb0, infdg, iptdb, mxjac, ilong, ibb;
+ integer kjac, iptt, ipdb0, infdg, iptdb, mxjac, ilong, ibb;
/* **********************************************************************
*/
ptcaux_offset, i__1, i__2, i__3;
/* Local variables */
- static integer kdim, nd, ii, jj, ibb;
+ integer kdim, nd, ii, jj, ibb;
/* ***********************************************************************
*/
doublereal *distan)
{
- static integer c__8 = 8;
+ integer c__8 = 8;
/* System generated locals */
integer i__1;
doublereal d__1;
/* Local variables */
- static integer i__;
- static doublereal differ[100];
- static integer ier;
+ integer i__;
+ doublereal* differ = 0;
+ integer ier;
intptr_t iofset, j;
/* **********************************************************************
/* ***********************************************************************
*/
+ AdvApp2Var_SysBase anAdvApp2Var_SysBase;
if (*ndimen > 100) {
- AdvApp2Var_SysBase::mcrrqst_(&c__8, ndimen, differ, &iofset, &ier);
+ anAdvApp2Var_SysBase.mcrrqst_(&c__8, ndimen, differ, &iofset, &ier);
}
/* --- If allocation is refused, the trivial method is applied. */
/* --- Dynamic Desallocation */
if (iofset != 0) {
- AdvApp2Var_SysBase::mcrdelt_(&c__8, ndimen, differ, &iofset, &ier);
+ anAdvApp2Var_SysBase.mcrdelt_(&c__8, ndimen, differ, &iofset, &ier);
}
return 0 ;
integer i__1;
/* Local variables */
- static integer i__;
+ integer i__;
/* FORTRAN CONFORME AU TEXT */
/* CALCUL DE MFACTORIEL N */
i__2;
/* Local variables */
- static integer ipair, nd, ndegre, impair, ibb, idg;
+ integer ipair, nd, ndegre, impair, ibb, idg;
//extern int mgsomsg_();//mgenmsg_(),
/* **********************************************************************
doublereal d__1;
/* Local variables */
- static integer ncut;
- static doublereal bidon;
- static integer ii, nd;
+ integer ncut;
+ doublereal bidon;
+ integer ii, nd;
/* ***********************************************************************
*/
doublereal d__1;
/* Local variables */
- static integer idec, ncut;
- static doublereal bidon;
- static integer ii, nd;
+ integer idec, ncut;
+ doublereal bidon;
+ integer ii, nd;
doublereal d__1;
/* Local variables */
- static integer idec, ncut;
- static doublereal bidon;
- static integer ii, nd;
+ integer idec, ncut;
+ doublereal bidon;
+ integer ii, nd;
doublereal d__1;
/* Local variables */
- static integer idec, ncut;
- static doublereal bidon;
- static integer ii, nd;
+ integer idec, ncut;
+ doublereal bidon;
+ integer ii, nd;
integer crvjac_dim1, crvjac_offset;
/* Local variables */
- static integer jord;
+ integer jord;
/* **********************************************************************
*/
i__2, i__3;
/* Local variables */
- static integer nboct;
- static doublereal tbaux[61];
- static integer nd;
- static doublereal bid;
- static integer ncf, ncj;
+ integer nboct;
+ doublereal tbaux[61];
+ integer nd;
+ doublereal bid;
+ integer ncf, ncj;
/* IMPLICIT DOUBLE PRECISION(A-H,O-Z) */
doublereal d__1;
/* Local variables */
- static doublereal x0, x1;
- static integer nd;
- static doublereal tabaux[61];
- static integer ibb;
- static doublereal bid;
- static integer ncf;
- static integer ncj;
- static doublereal eps3;
+ doublereal x0, x1;
+ integer nd;
+ doublereal tabaux[61];
+ integer ibb;
+ doublereal bid;
+ integer ncf;
+ integer ncj;
+ doublereal eps3;
integer i__1, i__2;
/* Local variables */
- static logical ldbg;
- static integer jmin, jmax, i__, j, k;
- static doublereal somme;
- static integer aux;
+ logical ldbg;
+ integer jmin, jmax, i__, j, k;
+ doublereal somme;
+ integer aux;
/* ***********************************************************************
integer dtabtr_dim1, dtabtr_offset, i__1, i__2;
/* Local variables */
- static logical ldbg;
- static doublereal daux;
- static integer nite1, nite2, nchan, i1, i2;
+ logical ldbg;
+ doublereal daux;
+ integer nite1, nite2, nchan, i1, i2;
/* ***********************************************************************
*/
i__2;
/* Local variables */
- static integer i__, j, k;
- static doublereal mfactk, bid;
+ integer i__, j, k;
+ doublereal mfactk, bid;
/* ***********************************************************************
doublereal d__1;
/* Local variables */
- static integer ndec;
- static doublereal tdeb, tfin;
- static integer iter;
- static doublereal oldso;
- static integer itmax;
- static doublereal sottc;
- static integer kk, ibb;
- static doublereal dif, pas;
- static doublereal som;
+ integer ndec;
+ doublereal tdeb, tfin;
+ integer iter;
+ doublereal oldso;
+ integer itmax;
+ doublereal sottc;
+ integer kk, ibb;
+ doublereal dif, pas;
+ doublereal som;
/* ***********************************************************************
//double sqrt();
/* Local variables */
- static logical ldbg;
- static integer kmin, i__, j, k;
- static doublereal somme;
- static integer ptini, ptcou;
+ logical ldbg;
+ integer kmin, i__, j, k;
+ doublereal somme;
+ integer ptini, ptcou;
/* ***********************************************************************
i__2;
/* Local variables */
- static integer moup1, nordr;
- static integer nd;
- static integer ibb, ncf, ndv;
- static doublereal eps1;
+ integer moup1, nordr;
+ integer nd;
+ integer ibb, ncf, ndv;
+ doublereal eps1;
/* ***********************************************************************
integer curve_dim1, curve_offset, curveo_dim1, curveo_offset, i__1, i__2;
/* Local variables */
- static integer i__, nd, ibb;
+ integer i__, nd, ibb;
/* ***********************************************************************
integer courbe_dim1, crvcan_dim1, crvcan_offset, i__1, i__2, i__3;
/* Local variables */
- static integer ndeg, i__, j, j1, nd, ibb;
- static doublereal bid;
+ integer ndeg, i__, j, j1, nd, ibb;
+ doublereal bid;
/* ***********************************************************************
/* Local variables */
- static integer ndeg, i__, j, ndgcb, nd, ibb;
+ integer ndeg, i__, j, ndgcb, nd, ibb;
/* **********************************************************************
integer courbe_dim1, tabpnt_dim1, i__1, i__2, i__3;
/* Local variables */
- static integer ndeg, i__, j, nd, ndgcrb, iptpnt, ibb;
+ integer ndeg, i__, j, nd, ndgcrb, iptpnt, ibb;
/* ***********************************************************************
integer courbe_dim1, courbe_offset, i__1, i__2;
/* Local variables */
- static integer i__, j, k, nd;
- static doublereal mfactk, bid;
+ integer i__, j, k, nd;
+ doublereal mfactk, bid;
/* IMPLICIT INTEGER (I-N) */
integer i__1;
/* Local variables */
- static integer iadd, ideb, ndeg2, nmod2, ii, ibb;
- static integer kpt;
+ integer iadd, ideb, ndeg2, nmod2, ii, ibb;
+ integer kpt;
/* **********************************************************************
*/
integer i__1;
/* Local variables */
- static integer iadd, ideb, ndeg2, nmod2, ii, ibb;
- static integer kpt;
+ integer iadd, ideb, ndeg2, nmod2, ii, ibb;
+ integer kpt;
/* **********************************************************************
tabres_offset;
/* Local variables */
- static integer i__, j, k, ilong;
+ integer i__, j, k, ilong;
tabres_offset, i__1, i__2, i__3;
/* Local variables */
- static integer i__, j, k, ilong;
+ integer i__, j, k, ilong;
integer *iercod)
{
- static integer c__8 = 8;
+ integer c__8 = 8;
/* System generated locals */
integer patold_dim1, patold_dim2, patnew_dim1, patnew_dim2,
i__1, patold_offset,patnew_offset;
/* Local variables */
- static doublereal tbaux[1];
- static integer ksize, numax, kk;
- static intptr_t iofst;
- static integer ibb, ier;
+ doublereal* tbaux = 0;
+ integer ksize, numax, kk;
+ intptr_t iofst;
+ integer ibb, ier;
/* ***********************************************************************
*/
}
*iercod = 0;
iofst = 0;
+ AdvApp2Var_SysBase anAdvApp2Var_SysBase;
/* **********************************************************************
*/
/* ------------------------- Dynamic allocation -------------------
---- */
ksize = *ndimen * *ncoefu * *ncoefv;
- AdvApp2Var_SysBase::mcrrqst_(&c__8, &ksize, tbaux, &iofst, &ier);
+ anAdvApp2Var_SysBase.mcrrqst_(&c__8, &ksize, tbaux, &iofst, &ier);
if (ier > 0) {
*iercod = 13;
goto L9900;
L9900:
if (iofst != 0) {
- AdvApp2Var_SysBase::mcrdelt_(&c__8, &ksize, tbaux, &iofst, &ier);
+ anAdvApp2Var_SysBase.mcrdelt_(&c__8, &ksize, tbaux, &iofst, &ier);
}
if (ier > 0) {
*iercod = 13;
i__2;
/* Local variables */
- static integer i__, nboct, nd;
+ integer i__, nboct, nd;
/* **********************************************************************
integer *jsize2,
integer *iercod)
{
- static integer c__8 = 8;
+ integer c__8 = 8;
/* System generated locals */
integer table1_dim1, table1_offset, table2_dim1, table2_offset, i__1,
i__2;
/* Local variables */
- static doublereal work[1];
- static integer ilong, isize, ii, jj, ier;
- static intptr_t iofst,iipt, jjpt;
+ doublereal* work = 0;
+ integer ilong, isize, ii, jj, ier;
+ intptr_t iofst,iipt, jjpt;
/************************************************************************
table2_dim1 = *maxsz2;
table2_offset = table2_dim1 + 1;
table2 -= table2_offset;
+ AdvApp2Var_SysBase anAdvApp2Var_SysBase;
/* Function Body */
*iercod = 0;
iofst = 0;
isize = *maxsz2 * *isize1;
- AdvApp2Var_SysBase::mcrrqst_(&c__8, &isize, work, &iofst, &ier);
+ anAdvApp2Var_SysBase.mcrrqst_(&c__8, &isize, work, &iofst, &ier);
if (ier > 0) {
goto L9200;
}
L9999:
if (iofst != 0) {
- AdvApp2Var_SysBase::mcrdelt_(&c__8, &isize, work, &iofst, &ier);
+ anAdvApp2Var_SysBase.mcrdelt_(&c__8, &isize, work, &iofst, &ier);
}
if (ier > 0) {
*iercod = 2;
integer i__1, i__2;
/* Local variables */
- static integer ndeg;
- static doublereal h__[20];
- static integer j;
- static doublereal t, u[20], x;
- static integer idimf;
- static doublereal c1x, c2x;
+ integer ndeg;
+ doublereal h__[20];
+ integer j;
+ doublereal t, u[20], x;
+ integer idimf;
+ doublereal c1x, c2x;
/* **********************************************************************
*/
int mmherm0_(doublereal *debfin,
integer *iercod)
{
- static integer c__576 = 576;
- static integer c__6 = 6;
+ integer c__576 = 576;
+ integer c__6 = 6;
/* System generated locals */
doublereal d__1;
/* Local variables */
- static doublereal amat[36] /* was [6][6] */;
- static integer iord[2];
- static doublereal prod;
- static integer iord1, iord2;
- static doublereal miden[36] /* was [6][6] */;
- static integer ncmat;
- static doublereal epspi, d1, d2;
- static integer ii, jj, pp, ncf;
- static doublereal cof[6];
- static integer iof[2], ier;
- static doublereal mat[36] /* was [6][6] */;
- static integer cot;
- static doublereal abid[72] /* was [12][6] */;
+ doublereal amat[36] /* was [6][6] */;
+ integer iord[2];
+ doublereal prod;
+ integer iord1, iord2;
+ doublereal miden[36] /* was [6][6] */;
+ integer ncmat;
+ doublereal epspi, d1, d2;
+ integer ii, jj, pp, ncf;
+ doublereal cof[6];
+ integer iof[2], ier;
+ doublereal mat[36] /* was [6][6] */;
+ integer cot;
+ doublereal abid[72] /* was [12][6] */;
/* ***********************************************************************
*/
integer hermit_dim1, hermit_dim2, hermit_offset;
/* Local variables */
- static integer nbval;
- static doublereal d1;
- static integer cot;
+ integer nbval;
+ doublereal d1;
+ integer cot;
/* ***********************************************************************
*/
integer *iercod)
{
- static integer c__2 = 2;
- static integer c__21 = 21;
+ integer c__2 = 2;
+ integer c__21 = 21;
/* System generated locals */
integer tcbold_dim1, tcbold_dim2, tcbold_offset, tcbnew_dim1, tcbnew_dim2,
tcbnew_offset, i__1, i__2, i__3, i__4, i__5;
/* Local variables */
- static logical ldbg;
- static integer ndeg;
- static doublereal taux1[21];
- static integer d__, e, i__, k;
- static doublereal mfact;
- static integer ncoeff;
- static doublereal tjacap[21];
- static integer iordre[2];
- static doublereal hermit[36]/* was [6][3][2] */, ctenor, bornes[2];
- static integer ier;
- static integer aux1, aux2;
+ logical ldbg;
+ integer ndeg;
+ doublereal taux1[21];
+ integer d__, e, i__, k;
+ doublereal mfact;
+ integer ncoeff;
+ doublereal tjacap[21];
+ integer iordre[2];
+ doublereal hermit[36]/* was [6][3][2] */, ctenor, bornes[2];
+ integer ier;
+ integer aux1, aux2;
/* ***********************************************************************
*/
integer tabtri_dim1, tabtri_offset, i__1, i__2;
/* Local variables */
- static logical idbg;
- static integer icol, ilgn, nlgn, noct, inser;
- static doublereal epsega;
- static integer ibb;
+ logical idbg;
+ integer icol, ilgn, nlgn, noct, inser;
+ doublereal epsega = 0.;
+ integer ibb;
/* ***********************************************************************
*/
integer poljac_dim1, i__1, i__2;
/* Local variables */
- static integer iptt, i__, j, ibb;
- static doublereal bid;
+ integer iptt, i__, j, ibb;
+ doublereal bid;
/* ***********************************************************************
*/
polaux_dim1, i__1, i__2;
/* Local variables */
- static integer ndeg, i__, nd, ii, ibb;
+ integer ndeg, i__, nd, ii, ibb;
/* ***********************************************************************
*/
{
/* Initialized data */
- static integer kgar = 0;
+ integer kgar = 0;
/* System generated locals */
integer courbe_dim1, courbe_offset, i__1, i__2;
/* Local variables */
- static doublereal tran;
- static integer ngaus;
- static doublereal c1, c2, d1, d2, wgaus[20], uroot[20], x1, x2, dd;
- static integer ii, jj, kk;
- static doublereal som;
- static doublereal der1, der2;
+ doublereal tran;
+ integer ngaus;
+ doublereal c1, c2, d1, d2, wgaus[20], uroot[20], x1, x2, dd;
+ integer ii, jj, kk;
+ doublereal som;
+ doublereal der1, der2;
integer *iercod)
{
- static integer c__2 = 2;
- static integer c__1 = 1;
+ integer c__2 = 2;
+ integer c__1 = 1;
/* Initialized data */
- static doublereal moin11[2] = { -1.,1. };
+ doublereal moin11[2] = { -1.,1. };
/* System generated locals */
integer valbas_dim1, i__1;
/* Local variables */
- static doublereal vjac[80], herm[24];
- static integer iord[2];
- static doublereal wval[4];
- static integer nwcof, iunit;
- static doublereal wpoly[7];
- static integer ii, jj, iorjac;
- static doublereal hermit[36] /* was [6][3][2] */;
- static integer kk1, kk2, kk3;
- static integer khe, ier;
+ doublereal vjac[80], herm[24];
+ integer iord[2];
+ doublereal wval[4];
+ integer nwcof, iunit;
+ doublereal wpoly[7];
+ integer ii, jj, iorjac;
+ doublereal hermit[36] /* was [6][3][2] */;
+ integer kk1, kk2, kk3;
+ integer khe, ier;
/* ***********************************************************************
integer courbe_dim1, courbe_offset, i__1, i__2;
/* Local variables */
- static integer ncof2;
- static integer isize, nd, kcf, ncf;
+ integer ncof2;
+ integer isize, nd, kcf, ncf;
/* ***********************************************************************
integer courbe_dim1, courbe_offset, i__1;
/* Local variables */
- static integer i__, nd;
- static doublereal fu;
+ integer i__, nd;
+ doublereal fu;
/* ***********************************************************************
integer *iercod)
{
- static integer c__2 = 2;
+ integer c__2 = 2;
/* Initialized data */
- static integer nbcof = -1;
+ integer nbcof = -1;
/* System generated locals */
integer valjac_dim1, i__1, i__2;
/* Local variables */
- static doublereal cofa, cofb, denom, tnorm[100];
- static integer ii, jj, kk1, kk2;
- static doublereal aux1, aux2;
+ doublereal cofa, cofb, denom, tnorm[100];
+ integer ii, jj, kk1, kk2;
+ doublereal aux1, aux2;
/* ***********************************************************************
integer i__1, i__2;
/* Local variables */
- static logical ldbg;
- static integer imin, jmin, i__, j, k;
- static logical trouve;
+ logical ldbg;
+ integer imin, jmin, i__, j, k;
+ logical trouve;
/* ***********************************************************************
*/
integer *iercod)
{
- static integer c__100 = 100;
+ integer c__100 = 100;
/* System generated locals */
integer i__1, i__2;
/* Local variables */
- static logical ldbg;
- static doublereal mcho[100];
- static integer jmin, jmax, i__, j, k, l;
- static intptr_t iofv1, iofv2, iofv3, iofv4;
- static doublereal v1[100], v2[100], v3[100], v4[100];
- static integer deblig, dimhch;
- static doublereal hchole[100];
- static intptr_t iofmch, iofmam, iofhch;
- static doublereal matsym[100];
- static integer ier;
- static integer aux;
+ logical ldbg;
+ doublereal* mcho = 0;
+ integer jmin, jmax, i__, j, k, l;
+ intptr_t iofv1, iofv2, iofv3, iofv4;
+ doublereal *v1 = 0, *v2 = 0, *v3 = 0, *v4 = 0;
+ integer deblig, dimhch;
+ doublereal* hchole = 0;
+ intptr_t iofmch, iofmam, iofhch;
+ doublereal* matsym = 0;
+ integer ier;
+ integer aux;
*/
/* Dynamic allocation */
-
- AdvApp2Var_SysBase::macrar8_(hdimen, &c__100, v1, &iofv1, &ier);
+ AdvApp2Var_SysBase anAdvApp2Var_SysBase;
+ anAdvApp2Var_SysBase.macrar8_(hdimen, &c__100, v1, &iofv1, &ier);
if (ier > 0) {
goto L9102;
}
dimhch = hposit[(*hdimen << 1) + 2];
- AdvApp2Var_SysBase::macrar8_(&dimhch, &c__100, hchole, &iofhch, &ier);
+ anAdvApp2Var_SysBase.macrar8_(&dimhch, &c__100, hchole, &iofhch, &ier);
if (ier > 0) {
goto L9102;
}
/* where G=MATSYG */
/* c=VECSYG */
- AdvApp2Var_SysBase::macrar8_(gdimen, &c__100, v2, &iofv2, &ier);
+ anAdvApp2Var_SysBase.macrar8_(gdimen, &c__100, v2, &iofv2, &ier);
if (ier > 0) {
goto L9102;
}
- AdvApp2Var_SysBase::macrar8_(hdimen, &c__100, v3, &iofv3, &ier);
+ anAdvApp2Var_SysBase.macrar8_(hdimen, &c__100, v3, &iofv3, &ier);
if (ier > 0) {
goto L9102;
}
- AdvApp2Var_SysBase::macrar8_(gdimen, &c__100, v4, &iofv4, &ier);
+ anAdvApp2Var_SysBase.macrar8_(gdimen, &c__100, v4, &iofv4, &ier);
if (ier > 0) {
goto L9102;
}
- AdvApp2Var_SysBase::macrar8_(mnstoc, &c__100, matsym, &iofmam, &ier);
+ anAdvApp2Var_SysBase.macrar8_(mnstoc, &c__100, matsym, &iofmam, &ier);
if (ier > 0) {
goto L9102;
}
AdvApp2Var_SysBase::mvriraz_(gdimen, &v4[iofv4]);
- AdvApp2Var_SysBase::macrar8_(mnstoc, &c__100, mcho, &iofmch, &ier);
+ anAdvApp2Var_SysBase.macrar8_(mnstoc, &c__100, mcho, &iofmch, &ier);
if (ier > 0) {
goto L9102;
}
L9999:
/* ___ DESALLOCATION, ... */
- AdvApp2Var_SysBase::macrdr8_(hdimen, &c__100, v1, &iofv1, &ier);
+ anAdvApp2Var_SysBase.macrdr8_(hdimen, &c__100, v1, &iofv1, &ier);
if (*iercod == 0 && ier > 0) {
*iercod = 3;
}
- AdvApp2Var_SysBase::macrdr8_(&dimhch, &c__100, hchole, &iofhch, &ier);
+ anAdvApp2Var_SysBase.macrdr8_(&dimhch, &c__100, hchole, &iofhch, &ier);
if (*iercod == 0 && ier > 0) {
*iercod = 3;
}
- AdvApp2Var_SysBase::macrdr8_(gdimen, &c__100, v2, &iofv2, &ier);
+ anAdvApp2Var_SysBase.macrdr8_(gdimen, &c__100, v2, &iofv2, &ier);
if (*iercod == 0 && ier > 0) {
*iercod = 3;
}
- AdvApp2Var_SysBase::macrdr8_(hdimen, &c__100, v3, &iofv3, &ier);
+ anAdvApp2Var_SysBase.macrdr8_(hdimen, &c__100, v3, &iofv3, &ier);
if (*iercod == 0 && ier > 0) {
*iercod = 3;
}
- AdvApp2Var_SysBase::macrdr8_(gdimen, &c__100, v4, &iofv4, &ier);
+ anAdvApp2Var_SysBase.macrdr8_(gdimen, &c__100, v4, &iofv4, &ier);
if (*iercod == 0 && ier > 0) {
*iercod = 3;
}
- AdvApp2Var_SysBase::macrdr8_(mnstoc, &c__100, matsym, &iofmam, &ier);
+ anAdvApp2Var_SysBase.macrdr8_(mnstoc, &c__100, matsym, &iofmam, &ier);
if (*iercod == 0 && ier > 0) {
*iercod = 3;
}
- AdvApp2Var_SysBase::macrdr8_(mnstoc, &c__100, mcho, &iofmch, &ier);
+ anAdvApp2Var_SysBase.macrdr8_(mnstoc, &c__100, mcho, &iofmch, &ier);
if (*iercod == 0 && ier > 0) {
*iercod = 3;
}
integer i__1, i__2;
/* Local variables */
- static logical ldbg;
- static integer i__, j;
- static doublereal somme;
- static integer pointe, ptcour;
+ logical ldbg;
+ integer i__, j;
+ doublereal somme;
+ integer pointe, ptcour;
/* ***********************************************************************
*/
doublereal d__1;
/* Local variables */
- static integer kpiv;
- static doublereal pivot;
- static integer ii, jj, kk;
- static doublereal akj;
+ integer kpiv;
+ doublereal pivot;
+ integer ii, jj, kk;
+ doublereal akj;
/* **********************************************************************
xmat_offset, aaux_dim1, aaux_offset, i__1, i__2;
/* Local variables */
- static integer i__, j;
- static integer ibb;
+ integer i__, j;
+ integer ibb;
/* IMPLICIT DOUBLE PRECISION (A-H,O-Z) */
/* IMPLICIT INTEGER (I-N) */
doublereal *rtlegd)
{
- static integer ideb, nmod2, nsur2, ilong, ibb;
+ integer ideb, nmod2, nsur2, ilong, ibb;
/* **********************************************************************
doublereal d__1;
/* Local variables */
- static integer ideb, ifin, imil, ibb;
+ integer ideb, ifin, imil, ibb;
/* ***********************************************************************
*/
integer i__1, i__2;
/* Local variables */
- static logical ldbg;
- static integer imin, imax, i__, j, k;
- static doublereal somme;
- static integer aux;
+ logical ldbg;
+ integer imin, imax, i__, j, k;
+ doublereal somme;
+ integer aux;
/* ***********************************************************************
doublereal d__1;
/* Local variables */
- static integer ncut, i__;
- static doublereal bidon, error;
- static integer nd;
+ integer ncut, i__;
+ doublereal bidon, error;
+ integer nd;
/* ***********************************************************************
doublereal d__1;
/* Local variables */
- static integer ncut, i__;
- static doublereal bidon, error;
- static integer ia, nd;
- static doublereal bid, eps1;
+ integer ncut, i__;
+ doublereal bidon, error;
+ integer ia, nd;
+ doublereal bid, eps1;
/* ***********************************************************************
doublereal d__1;
/* Local variables */
- static integer ncut, i__;
- static doublereal bidon, error;
- static integer ia, nd;
- static doublereal bid, eps1;
+ integer ncut, i__;
+ doublereal bidon, error;
+ integer ia, nd;
+ doublereal bid, eps1;
doublereal d__1;
/* Local variables */
- static integer ncut, i__;
- static doublereal bidon, error;
- static integer ia, nd;
- static doublereal bid, eps1;
+ integer ncut, i__;
+ doublereal bidon, error;
+ integer ia, nd;
+ doublereal bid, eps1;
integer crvlgd_dim1, crvlgd_offset;
/* Local variables */
- static integer ia;
+ integer ia;
/* ***********************************************************************
integer *iercod)
{
- static doublereal c_b2 = 10.;
+ doublereal c_b2 = 10.;
/* System generated locals */
integer i__1;
doublereal d__1;
/* Local variables */
- static integer nchif, iunit, izero;
- static doublereal vnorm;
- static integer ii;
- static doublereal bid;
- static doublereal eps0;
+ integer nchif, iunit, izero;
+ doublereal vnorm;
+ integer ii;
+ doublereal bid;
+ doublereal eps0;
static char nomprg[8+1] = "MMEPS1 ";
- static integer ibb;
+ integer ibb;
integer i__1;
/* Local variables */
- static logical ldbg;
- static integer d__;
- static doublereal vaux1[3], vaux2[3];
- static logical colin;
- static doublereal valaux;
- static integer aux;
- static logical nul;
+ logical ldbg;
+ integer d__;
+ doublereal vaux1[3], vaux2[3];
+ logical colin;
+ doublereal valaux;
+ integer aux;
+ logical nul;
/* ***********************************************************************
*/
doublereal ret_val;
/* Local variables */
- static integer i__;
- static doublereal x;
+ integer i__;
+ doublereal x;
integer i__1, i__2;
/* Local variables */
- static integer m1jm1, ncfm1, j, k;
- static doublereal bid;
- static doublereal cij1, cij2;
+ integer m1jm1, ncfm1, j, k;
+ doublereal bid;
+ doublereal cij1, cij2;
integer i__1, i__2;
/* Local variables */
- static integer m1jm1, ncfm1, j, k;
- static doublereal bid;
+ integer m1jm1, ncfm1, j, k;
+ doublereal bid;
//extern /* Subroutine */ int maermsg_();
- static doublereal cij1, cij2, cij3;
+ doublereal cij1, cij2, cij3;
/* **********************************************************************
integer i__1;
/* Local variables */
- static doublereal tamp[40];
- static integer ndegl, kg, ii;
+ doublereal tamp[40];
+ integer ndegl, kg, ii;
/* **********************************************************************
*/
integer i__1;
/* Local variables */
- static integer ndeg, kk;
- static doublereal xxx, yyy;
+ integer ndeg, kk;
+ doublereal xxx, yyy;
integer i__1;
/* Local variables */
- static integer ndeg, kk;
- static doublereal xxx, yyy, zzz;
+ integer ndeg, kk;
+ doublereal xxx, yyy, zzz;
integer dtab_dim1, dtab_offset, i__1, i__2;
/* Local variables */
- static integer incr;
- static doublereal dsave;
- static integer i3, i4, i5, incrp1;
+ integer incr;
+ doublereal dsave;
+ integer i3, i4, i5, incrp1;
/************************************************************************
doublereal ret_val, d__1, d__2;
/* Local variables */
- static doublereal xsom;
- static integer i__, irmax;
+ doublereal xsom;
+ integer i__, irmax;
// and conditions governing the rights and limitations under the License.
// AdvApp2Var_SysBase.cxx
+#include <assert.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
static
int macrbrk_();
-static
-int macrchk_();
-
static
int macrclw_(intptr_t *iadfld,
intptr_t *iadflf,
void* *iad,
integer *ier);
-static
-int mcrlist_(integer *ier);
-
static
int mcrlocv_(void* t,
intptr_t *l);
-/* Structures */
-static struct {
- intptr_t icore[12000];
- integer ncore, lprot;
-} mcrgene_;
-
-static struct {
- integer nrqst[2], ndelt[2], nbyte[2], mbyte[2];
-} mcrstac_;
-
static struct {
integer lec, imp, keyb, mae, jscrn, itblt, ibb;
} mblank__;
#define mcrfill_ABS(a) (((a)<0)?(-(a)):(a))
+//=======================================================================
+//function : AdvApp2Var_SysBase
+//purpose :
+//=======================================================================
+AdvApp2Var_SysBase::AdvApp2Var_SysBase()
+{
+ mainial_();
+ memset (&mcrstac_, 0, sizeof (mcrstac_));
+}
+
+//=======================================================================
+//function : ~AdvApp2Var_SysBase
+//purpose :
+//=======================================================================
+AdvApp2Var_SysBase::~AdvApp2Var_SysBase()
+{
+ assert (mcrgene_.ncore == 0); //otherwise memory leaking
+}
+
//=======================================================================
//function : macinit_
//purpose :
{
/* Fortran I/O blocks */
- static cilist io______1 = { 0, 0, 0, (char*) "(' --- Debug-mode : ',I10,' ---')", 0 };
+ cilist io______1 = { 0, 0, 0, (char*) "(' --- Debug-mode : ',I10,' ---')", 0 };
/* ************************************************************************/
/* FUNCTION : */
*/
integer iunit;
- /* Parameter adjustments */
- --itablo;
iunit = sizeof(integer);
/* Function Body */
if (*nbelem > *maxelm) {
- AdvApp2Var_SysBase::mcrrqst_(&iunit, nbelem, &itablo[1], iofset, iercod);
+ /*AdvApp2Var_SysBase::*/mcrrqst_(&iunit, nbelem, itablo, iofset, iercod);
} else {
*iercod = 0;
*iofset = 0;
integer *iercod)
{
- static integer c__8 = 8;
+ integer c__8 = 8;
/* ***********************************************************************
*/
*/
- /* Parameter adjustments */
- --xtablo;
-
/* Function Body */
if (*nbelem > *maxelm) {
- AdvApp2Var_SysBase::mcrrqst_(&c__8, nbelem, &xtablo[1], iofset, iercod);
+ /*AdvApp2Var_SysBase::*/mcrrqst_(&c__8, nbelem, xtablo, iofset, iercod);
} else {
*iercod = 0;
*iofset = 0;
//function : macrchk_
//purpose :
//=======================================================================
-int macrchk_()
+int AdvApp2Var_SysBase::macrchk_()
{
/* System generated locals */
integer i__1;
/* Local variables */
- static integer i__, j;
- static intptr_t ioff;
- static doublereal t[1];
- static intptr_t loc;
+ integer i__, j;
+ intptr_t ioff;
+ doublereal* t = 0;
+ intptr_t loc;
/* ***********************************************************************
*/
mcrlocv_(t, &loc);
/* CONTROL OF FLAGS IN THE TABLE */
i__1 = mcrgene_.ncore;
- for (i__ = 1; i__ <= i__1; ++i__) {
-
- for (j = 10; j <= 11; ++j) {
-
- if (mcrgene_.icore[j + i__ * 12 - 13] != -1) {
+ for (i__ = 0; i__ < i__1; ++i__) {
+
+ //p to access startaddr and endaddr
+ intptr_t* p = &mcrgene_.icore[i__].startaddr;
+ for (j = 0; j <= 1; ++j) {
+ intptr_t* pp = p + j;
+ if (*pp != -1) {
- ioff = (mcrgene_.icore[j + i__ * 12 - 13] - loc) / 8;
+ ioff = (*pp - loc) / 8;
if (t[ioff] != -134744073.) {
/* MSG : '*** ERREUR : REMOVAL FROM MEMORY OF ADDRESS
E:',ICORE(J,I) */
/* AND OF RANK ICORE(12,I) */
- macrerr_(&mcrgene_.icore[j + i__ * 12 - 13],
- &mcrgene_.icore[i__ * 12 - 1]);
+ macrerr_(pp, p + 2);
/* BACK-PARCING IN PHASE OF PRODUCTION */
maostrb_();
/* REMOVAL OF THE ADDRESS OF FLAG TO AVOID REMAKING ITS CONTROL */
- mcrgene_.icore[j + i__ * 12 - 13] = -1;
+ *pp = -1;
}
*/
integer iunit;
- /* Parameter adjustments */
- --itablo;
iunit = sizeof(integer);
/* Function Body */
if (*iofset != 0) {
AdvApp2Var_SysBase::mcrdelt_(&iunit,
nbelem,
- &itablo[1],
+ itablo,
iofset,
iercod);
} else {
integer *iercod)
{
- static integer c__8 = 8;
+ integer c__8 = 8;
/* ***********************************************************************
*/
/* ***********************************************************************
*/
-
- /* Parameter adjustments */
- --xtablo;
-
/* Function Body */
if (*iofset != 0) {
- AdvApp2Var_SysBase::mcrdelt_(&c__8, nbelem, &xtablo[1], iofset, iercod);
+ AdvApp2Var_SysBase::mcrdelt_(&c__8, nbelem, xtablo, iofset, iercod);
} else {
*iercod = 0;
}
intptr_t *)//nalloc)
{
- //static integer c__1 = 1;
+ //integer c__1 = 1;
/* Builtin functions */
//integer /*s__wsfe(),*/ /*do__fio(),*/ e__wsfe();
/* Fortran I/O blocks */
- //static cilist io___1 = { 0, 6, 0, "(X,A,I9,A,I3)", 0 };
+ //cilist io___1 = { 0, 6, 0, "(X,A,I9,A,I3)", 0 };
/* ***********************************************************************
*/
{
/* Initialized data */
- static integer ifois = 0;
+ /* original code used static integer ifois=0 which served as static
+ initialization flag and was only used to call matrsym_() once; now
+ this flag is not used as matrsym_() always returns 0 and has no
+ useful contents
+ */
+ integer ifois = 1;
- static char cbid[1];
- static integer ibid, ienr;
- static doublereal t[1];
- static integer novfl;
- static intptr_t ioff,iadrfl, iadt;
+ char cbid[1];
+ integer ibid, ienr;
+ doublereal* t = 0;
+ integer novfl;
+ intptr_t ioff,iadrfl, iadt;
/* ***********************************************************************
{
/* Local variables */
- static integer inum, iunite;
- static char cfm[80], cln[3];
+ integer inum, iunite;
+ char cfm[80], cln[3];
/* Fortran I/O blocks */
- static cilist io___5 = { 0, 0, 0, cfm, 0 };
- static cilist io___6 = { 0, 0, 0, cfm, 0 };
- static cilist io___7 = { 0, 0, 0, cfm, 0 };
+ cilist io___5 = { 0, 0, 0, cfm, 0 };
+ cilist io___6 = { 0, 0, 0, cfm, 0 };
+ cilist io___7 = { 0, 0, 0, cfm, 0 };
/* ***********************************************************************
{
/* Local variables */
- static char cbid[255];
- static integer ibid, ier;
+ char cbid[255];
+ integer ibid, ier;
/* **********************************************************************
int AdvApp2Var_SysBase::mainial_()
{
mcrgene_.ncore = 0;
+ mcrgene_.lprot = 0;
return 0 ;
} /* mainial_ */
doublereal *xval)
{
- static integer c__504 = 504;
+ integer c__504 = 504;
/* Initialized data */
- static doublereal buff0[63] = {
+ doublereal buff0[63] = {
0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,
0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,
0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,
integer i__1;
/* Local variables */
- static integer i__;
- static doublereal buffx[63];
- static integer nbfois, noffst, nreste, nufois;
+ integer i__;
+ doublereal buffx[63];
+ integer nbfois, noffst, nreste, nufois;
/* ***********************************************************************
*/
//=======================================================================
int maostrd_()
{
- static integer imod;
+ integer imod;
/* ***********************************************************************
*/
{
/* Initialized data */
- static integer ifois = 0;
+ integer ifois = 0;
/* System generated locals */
integer i__1;
/* Local variables */
- static integer ibid;
- static doublereal buff[63];
- static integer ioct, indic, nrest, icompt;
+ integer ibid;
+ doublereal buff[63];
+ integer ioct, indic, nrest, icompt;
/* ***********************************************************************
*/
{
/* Local variables */
- static char chainx[255];
+ char chainx[255];
/* ***********************************************************************
*/
{
/* Initialized data */
- static integer ntab = 0;
+ integer ntab = 0;
/* System generated locals */
integer i__1, i__2;
/* Local variables */
- static intptr_t ideb;
- static doublereal dtab[32000];
- static intptr_t itab[160] /* was [4][40] */;
- static intptr_t ipre;
- static integer i__, j, k;
+ intptr_t ideb;
+ doublereal dtab[32000];
+ intptr_t itab[160] /* was [4][40] */;
+ intptr_t ipre;
+ integer i__, j, k;
/************************************************************************
integer *iercod)
{
- static integer ibid;
- static doublereal xbid;
- static integer noct, iver, ksys, i__, n, nrang,
+ integer ibid;
+ doublereal xbid;
+ integer noct, iver, ksys, i__, n, nrang,
ibyte, ier;
- static intptr_t iadfd, iadff, iaddr, loc; /* Les adrresses en long*/
- static integer kop;
+ intptr_t iadfd, iadff, iaddr, loc; /* Les adrresses en long*/
+ integer kop;
/* ***********************************************************************
*/
/* SEARCH IN MCRGENE */
- n = 0;
+ n = -1;
mcrlocv_(t, &loc);
- for (i__ = mcrgene_.ncore; i__ >= 1; --i__) {
- if (*iunit == mcrgene_.icore[i__ * 12 - 11] && *isize ==
- mcrgene_.icore[i__ * 12 - 10] && loc == mcrgene_.icore[i__ *
- 12 - 9] && *iofset == mcrgene_.icore[i__ * 12 - 8]) {
+ for (i__ = mcrgene_.ncore - 1; i__ >= 0; --i__) {
+ if (*iunit == mcrgene_.icore[i__].unit && *isize ==
+ mcrgene_.icore[i__].reqsize && loc == mcrgene_.icore[i__].loc
+ && *iofset == mcrgene_.icore[i__].offset) {
n = i__;
goto L1100;
}
/* IF THE ALLOCATION DOES NOT EXIST, LEAVE */
- if (n <= 0) {
+ if (n < 0) {
goto L9003;
}
/* ALLOCATION RECOGNIZED : RETURN OTHER INFOS */
- ksys = static_cast<integer> (mcrgene_.icore[n * 12 - 7]);
- ibyte = static_cast<integer> (mcrgene_.icore[n * 12 - 6]);
- iaddr = mcrgene_.icore[n * 12 - 5];
- iadfd = mcrgene_.icore[n * 12 - 3];
- iadff = mcrgene_.icore[n * 12 - 2];
- nrang = static_cast<integer> (mcrgene_.icore[n * 12 - 1]);
+ ksys = mcrgene_.icore[n].alloctype;
+ ibyte = mcrgene_.icore[n].size;
+ iaddr = mcrgene_.icore[n].addr;
+ iadfd = mcrgene_.icore[n].startaddr;
+ iadff = mcrgene_.icore[n].endaddr;
+ nrang = mcrgene_.icore[n].rank;
/* Control of flags */
macrchk_();
}
- if (ksys <= 1) {
+ if (ksys == static_allocation) {
/* DE-ALLOCATION ON COMMON */
kop = 2;
mcrcomm_(&kop, &ibyte, &iaddr, &ier);
macrclw_(&iadfd, &iadff, &nrang);
/* UPDATE OF STATISTICS */
- if (ksys <= 1) {
- i__ = 1;
- } else {
- i__ = 2;
- }
- ++mcrstac_.ndelt[i__ - 1];
- mcrstac_.nbyte[i__ - 1] -= static_cast<integer> (mcrgene_.icore[n * 12 - 11] *
- mcrgene_.icore[n * 12 - 10]);
+ ++mcrstac_.ndelt[ksys];
+ mcrstac_.nbyte[ksys] -= mcrgene_.icore[n].unit *
+ mcrgene_.icore[n].reqsize;
/* REMOVAL OF PARAMETERS IN MCRGENE */
- if (n < 1000) {
-/* noct = (mcrgene_1.ncore - n) * 48; */
- noct = (mcrgene_.ncore - n) * 12 * sizeof(mcrgene_.icore[0]);
+ if (n < MAX_ALLOC_NB - 1) {
+ noct = (mcrgene_.ncore - (n + 1)) * sizeof(mcrgene_.icore[0]);
AdvApp2Var_SysBase::mcrfill_(&noct,
- &mcrgene_.icore[(n + 1) * 12 - 12],
- &mcrgene_.icore[n * 12 - 12]);
+ &mcrgene_.icore[n + 1],
+ &mcrgene_.icore[n]);
}
--mcrgene_.ncore;
//function : mcrlist_
//purpose :
//=======================================================================
-int mcrlist_(integer *ier)
+int AdvApp2Var_SysBase::mcrlist_(integer *ier) const
{
/* System generated locals */
/* Builtin functions */
/* Local variables */
- static char cfmt[1];
- static doublereal dfmt;
- static integer ifmt, i__, nufmt, ntotal;
- static char subrou[7];
+ char cfmt[1];
+ doublereal dfmt;
+ integer ifmt, i__, nufmt, ntotal;
+ char subrou[7];
/************************************************************************
ntotal = 0;
i__1 = mcrgene_.ncore;
- for (i__ = 1; i__ <= i__1; ++i__) {
+ for (i__ = 0; i__ < i__1; ++i__) {
nufmt = 2;
- ifmt = static_cast<integer> (mcrgene_.icore[i__ * 12 - 11] * mcrgene_.icore[i__ * 12 - 10])
+ ifmt = mcrgene_.icore[i__].unit * mcrgene_.icore[i__].reqsize
;
macrmsg_(subrou, &nufmt, &ifmt, &dfmt, cfmt, 7L, 1L);
ntotal += ifmt;
integer i__1, i__2;
/* Local variables */
- static doublereal dfmt;
- static integer ifmt, iver;
- static char subr[7];
- static integer ksys , ibyte, irest, isyst, ier;
- static intptr_t iadfd, iadff, iaddr,lofset, loc;
- static integer izu;
+ doublereal dfmt;
+ integer ifmt, iver;
+ char subr[7];
+ integer ksys , ibyte, irest, isyst, ier;
+ intptr_t iadfd, iadff, iaddr,lofset, loc;
+ integer izu;
/* **********************************************************************
/* Function Body */
*iercod = 0;
- if (mcrgene_.ncore >= 1000) {
+ if (mcrgene_.ncore >= MAX_ALLOC_NB) {
goto L9001;
}
if (*iunit != 1 && *iunit != 2 && *iunit != 4 && *iunit != 8) {
/* ENDIF */
/* ELSE */
/* ALLOCATION SYSTEME */
- ksys = 2;
+ ksys = heap_allocation;
mcrgetv_(&ibyte, reinterpret_cast<void**> (&iaddr), &ier);
if (ier != 0) {
goto L9003;
/* RANGING OF PARAMETERS IN MCRGENE */
+ mcrgene_.icore[mcrgene_.ncore].prot = mcrgene_.lprot;
+ mcrgene_.icore[mcrgene_.ncore].unit = *iunit;
+ mcrgene_.icore[mcrgene_.ncore].reqsize = *isize;
+ mcrgene_.icore[mcrgene_.ncore].loc = loc;
+ mcrgene_.icore[mcrgene_.ncore].offset = *iofset;
+ mcrgene_.icore[mcrgene_.ncore].alloctype = ksys;
+ mcrgene_.icore[mcrgene_.ncore].size = ibyte;
+ mcrgene_.icore[mcrgene_.ncore].addr = iaddr;
+ mcrgene_.icore[mcrgene_.ncore].userzone = mcrgene_.ncore;
+ mcrgene_.icore[mcrgene_.ncore].startaddr = iadfd;
+ mcrgene_.icore[mcrgene_.ncore].endaddr = iadff;
+ mcrgene_.icore[mcrgene_.ncore].rank = mcrgene_.ncore + 1;
++mcrgene_.ncore;
- mcrgene_.icore[mcrgene_.ncore * 12 - 12] = mcrgene_.lprot;
- mcrgene_.icore[mcrgene_.ncore * 12 - 11] = *iunit;
- mcrgene_.icore[mcrgene_.ncore * 12 - 10] = *isize;
- mcrgene_.icore[mcrgene_.ncore * 12 - 9] = loc;
- mcrgene_.icore[mcrgene_.ncore * 12 - 8] = *iofset;
- mcrgene_.icore[mcrgene_.ncore * 12 - 7] = ksys;
- mcrgene_.icore[mcrgene_.ncore * 12 - 6] = ibyte;
- mcrgene_.icore[mcrgene_.ncore * 12 - 5] = iaddr;
- mcrgene_.icore[mcrgene_.ncore * 12 - 4] = mcrgene_.ncore;
- mcrgene_.icore[mcrgene_.ncore * 12 - 3] = iadfd;
- mcrgene_.icore[mcrgene_.ncore * 12 - 2] = iadff;
- mcrgene_.icore[mcrgene_.ncore * 12 - 1] = mcrgene_.ncore;
mcrgene_.lprot = 0;
/* STATISTICS */
- ++mcrstac_.nrqst[ksys - 1];
- mcrstac_.nbyte[ksys - 1] += static_cast<integer> (mcrgene_.icore[mcrgene_.ncore * 12 - 11] *
- mcrgene_.icore[mcrgene_.ncore * 12 - 10]);
+ ++mcrstac_.nrqst[ksys];
+ mcrstac_.nbyte[ksys] += mcrgene_.icore[mcrgene_.ncore - 1].unit *
+ mcrgene_.icore[mcrgene_.ncore - 1].reqsize;
/* Computing MAX */
- i__1 = mcrstac_.mbyte[ksys - 1], i__2 = mcrstac_.nbyte[ksys - 1];
- mcrstac_.mbyte[ksys - 1] = advapp_max(i__1,i__2);
+ i__1 = mcrstac_.mbyte[ksys], i__2 = mcrstac_.nbyte[ksys];
+ mcrstac_.mbyte[ksys] = advapp_max(i__1,i__2);
goto L9900;
/* MAX NB OF ALLOC REACHED : */
L9001:
*iercod = 1;
- ifmt = 1000;
+ ifmt = MAX_ALLOC_NB;
//__s__copy(subr, "MCRRQST", 7L, 7L);
macrmsg_(subr, iercod, &ifmt, &dfmt, " ", 7L, 1L);
maostrd_();
integer *ivecin,
integer *ivecou)
{
- static integer nocte;
+ integer nocte;
/* ***********************************************************************
*/
doublereal *vecent,
doublereal * vecsor)
{
- static integer nocte;
+ integer nocte;
/* ***********************************************************************
{
- static cilist io___1 = { 0, 0, 0, 0, 0 };
+ cilist io___1 = { 0, 0, 0, 0, 0 };
/* ***********************************************************************
#endif
class AdvApp2Var_SysBase {
- public:
+ public:
+ Standard_EXPORT AdvApp2Var_SysBase();
+ Standard_EXPORT ~AdvApp2Var_SysBase();
+
//
- Standard_EXPORT static int mainial_();
+ Standard_EXPORT int mainial_();
Standard_EXPORT static int macinit_(int *,
int *);
//
- Standard_EXPORT static int mcrdelt_(integer *iunit,
+ Standard_EXPORT int mcrdelt_(integer *iunit,
integer *isize,
void *t,
intptr_t *iofset,
void *tin,
void *tout);
- Standard_EXPORT static int mcrrqst_(integer *iunit,
+ Standard_EXPORT int mcrrqst_(integer *iunit,
integer *isize,
void *t,
intptr_t *iofset,
Standard_EXPORT static int e__wsle ();
Standard_EXPORT static int s__wsfe ();
Standard_EXPORT static int s__wsle ();
- Standard_EXPORT static int macrai4_(integer *nbelem,
+ Standard_EXPORT int macrai4_(integer *nbelem,
integer *maxelm,
integer *itablo,
intptr_t *iofset,
integer *iercod);
- Standard_EXPORT static int macrar8_(integer *nbelem,
+ Standard_EXPORT int macrar8_(integer *nbelem,
integer *maxelm,
doublereal *xtablo,
intptr_t *iofset,
integer *iercod);
- Standard_EXPORT static int macrdi4_(integer *nbelem,
+ Standard_EXPORT int macrdi4_(integer *nbelem,
integer *maxelm,
integer *itablo,
intptr_t *iofset,
integer *iercod);
- Standard_EXPORT static int macrdr8_(integer *nbelem,
+ Standard_EXPORT int macrdr8_(integer *nbelem,
integer *maxelm,
doublereal *xtablo,
intptr_t *iofset,
Standard_EXPORT static void mvriraz_(integer *taille,
void*adt);
+private:
+ int macrchk_();
+ int mcrlist_(integer *ier) const;
+
+ /* Maximum number of allowed allocation requests.
+ Currently the maximum known number of requests is 7 - see
+ AdvApp2Var_MathBase::mmresol_(). So the current value is a safe margin and
+ a reasonable balance to not provoke stack overflow (especially in
+ multi-threaded execution). Previous number of 1000 was excessive but
+ tolerable when used for static memory.
+ */
+ static const int MAX_ALLOC_NB = 32;
+
+ enum {
+ static_allocation = 0, /* indicates static allocation, currently not used */
+ heap_allocation = 1 /* indicates heap allocation */
+ };
+
+ /* Describes an individual memory allocation request.
+ See format description in the AdvApp2Var_SysBase.cxx.
+ The field order is preserved and the sizes are chosen to minimize
+ memory footprint. Fields containing address have the intptr_t type
+ for easier arithmetic and to avoid casts in the source code.
+
+ No initialization constructor should be provided to avoid wasting
+ time when allocating a field mcrgene_.
+ */
+ struct mitem {
+ unsigned char prot;
+ unsigned char unit; //unit of allocation: 1, 2, 4 or 8
+ integer reqsize;
+ intptr_t loc;
+ intptr_t offset;
+ unsigned char alloctype; // static_allocation or heap_allocation
+ integer size;
+ intptr_t addr;
+ integer userzone; //not used
+ intptr_t startaddr;
+ intptr_t endaddr;
+ integer rank;
+ };
+
+ struct {
+ mitem icore[MAX_ALLOC_NB];
+ integer ncore;
+ unsigned char lprot;
+ } mcrgene_;
+
+ /* Contains statistics on allocation requests.
+ Index 0 corresponds to static_allocation, 1 - to heap allocation.
+ nrqst - number of allocation requests;
+ ndelt - number of deallocation requests;
+ nbyte - current number of allocated bytes;
+ mbyte - maximum number of ever allocated bytes.
+ */
+ struct {
+ integer nrqst[2], ndelt[2], nbyte[2], mbyte[2];
+ } mcrstac_;
};
#endif
static int init_STBAS(void)
{
int ICODE = 0;
+ //allocation tables are now local, so no global initialization is required
+#if 0
// Init du Tableau des allocs
AdvApp2Var_SysBase::mainial_();
+#endif
// Init de LEC IBB IMP
AdvApp2Var_SysBase::macinit_(&ICODE, &ICODE);
//
}
- static math_Vector BornInf(1,2),BornSup(1,2),F(1,1),X(1,2),Tolerance(1,2);
- static math_Matrix D(1, 1, 1, 2);
+ Standard_Real aBornInf[2],aBornSup[2],aF[1],aX[2],aTolerance[2];
+ math_Vector BornInf(aBornInf,1,2),BornSup(aBornSup,1,2),F(aF,1,1),
+ X(aX,1,2),Tolerance(aTolerance,1,2);
+ Standard_Real aD[1][2];
+ math_Matrix D(aD,1, 1, 1, 2);
Standard_Real binfu,bsupu,binfv,bsupv;
binfu = ThePSurfaceTool::FirstUParameter(MyPSurf);
MyIsTangent = Standard_True;
- static TColStd_Array1OfReal Param(1,4);
+ Standard_Real aParam[4];//stack vs heap allocation
+ TColStd_Array1OfReal Param (aParam[0],1,4);
Param(1) = u1; Param(2) = v1;
Param(3) = u2; Param(4) = v2;
math_FunctionSetRoot Rsnld(MyIntersectionOn2S.Function());
InternalUVValue(theta,U,V,A,B,C,cost,sint,SigneSqrtDis);
//
Pt = Value(theta);
- if(Abs(SigneSqrtDis)<0.0000000001 || Abs(A)<0.0000001) return(Standard_False);
+ if(Abs(A)<0.0000001 || Abs(SigneSqrtDis)<0.0000000001) return(Standard_False);
//-- Approximation de la derivee (mieux que le calcul mathematique!)
is
+ Create returns HInterTool from IntPatch;
-- Pour polyedres
-- Methodes pour recherche des points interieurs
- NbSamplePoints(myclass; S: HSurface from Adaptor3d)
+ NbSamplePoints(me: in out; S: HSurface from Adaptor3d)
returns Integer from Standard;
- SamplePoint(myclass; S : HSurface from Adaptor3d;
+ SamplePoint(me; S: HSurface from Adaptor3d;
Index: Integer from Standard;
U,V: out Real from Standard);
returns Boolean from Standard;
+fields
+
+ uinf,vinf,usup,vsup: Real from Standard;
end HInterTool;
#include <Geom2d_BezierCurve.hxx>
#include <Geom2d_BSplineCurve.hxx>
-static Standard_Real uinf,vinf,usup,vsup;
-
+IntPatch_HInterTool::IntPatch_HInterTool() :
+ uinf (0.), vinf (0.), usup (0.), vsup (0.)
+{
+}
Standard_Integer IntPatch_HInterTool::NbSamplesV (const Handle(Adaptor3d_HSurface)& S,
const Standard_Real, const Standard_Real)
void IntPatch_HInterTool::SamplePoint (const Handle(Adaptor3d_HSurface)& S,
const Standard_Integer Index,
Standard_Real& U,
- Standard_Real& V )
+ Standard_Real& V ) const
{
Standard_Integer nbIntU = 1+NbSamplesU(S,uinf,usup);
nbIntU>>=1;
gp_Pnt2d p2d;
gp_Vec2d d2d;
//
- static math_Vector X(1, 2);
- static math_Vector F(1, 1);
- static math_Matrix D(1, 1, 1, 2);
+ double aX[2], aF[1], aD[1][2];
+ math_Vector X(aX, 1, 2);
+ math_Vector F(aF, 1, 1);
+ math_Matrix D(aD, 1, 1, 1, 2);
//
seqlength = 0;
NbPoints = solrst.NbPoints();
// Si OnFirst = True, c est que la surface Surf correspond a la 1ere
// surface donnee aux algo d intersection.
- static IntPatch_SearchPnt Commun;
+ IntPatch_SearchPnt Commun;
Standard_Real U,V,W;
Standard_Real U1,V1,U2,V2;
done = Standard_False;
list.Clear();
- static math_Vector Binf(1,2), Bsup(1,2), UVap(1,2),toler(1,2);
+ Standard_Real aBinf[2], aBsup[2], aUVap[2], atoler[2];
+ math_Vector Binf(aBinf,1,2), Bsup(aBsup,1,2), UVap(aUVap,1,2), toler(atoler,1,2);
gp_Pnt psol;
Standard_Boolean testpnt;
Standard_Integer i,j,nbpt;
//-- gp_Pnt Pmilieu = ThePSurfaceTool::Value(PS,0.5*(u1+u2),0.5*(v1+v2));
gp_Pnt Pextrm1 = ThePSurfaceTool::Value(PS,u1,v1);
gp_Pnt Pextrm2 = ThePSurfaceTool::Value(PS,u2,v2);
- static math_Vector Valf(1,1);
+ Standard_Real aValf[1];
+ math_Vector Valf(aValf,1,1);
Func.Value(UVap,Valf);
Standard_Real rvalf = Valf(1);
Standard_Real DistPP = Pextrm1.SquareDistance(Pextrm2);
(const Standard_Integer theUIndex,
const Standard_Integer theVIndex) const
{
- static gp_Pnt aNullPnt(0., 0., 0.);
-
Standard_Integer aFrmUInd = theUIndex + myUIndMin - 1;
Standard_Integer aFrmVInd = theVIndex + myVIndMin - 1;
if (aFrmUInd > myUIndMax || aFrmVInd > myVIndMax)
- return aNullPnt;
+ return gp::Origin();
return myGridPoints->Value(aFrmUInd, aFrmVInd);
}
is
- Create
-
- returns IWalking from IntWalk;
-
-
Create(Epsilon, Deflection, Step : Real from Standard)
---Purpose: Deflection is the maximum deflection admitted between two
previousd2d : Dir2d from gp;
seqAjout : SequenceOfInteger from TColStd;
lines : SequenceOfIWLine;
-
+ NbPointsConfondusConsecutifs: Integer from Standard;
+ EpsilonSembleTropGrand : Integer from Standard;
end IWalking;
fleche(Deflection),
pas(Increment),
tolerance(1,2),
- epsilon(Epsilon*Epsilon)
+ epsilon(Epsilon*Epsilon),
+ NbPointsConfondusConsecutifs(0),
+ EpsilonSembleTropGrand(0)
{
}
}
}
if (Arrive) {
- static math_Vector bidF(1,1);
- static math_Matrix bidD(1,1,1,2);
+ Standard_Real abidF[1], abidD[1][2];
+ math_Vector bidF(abidF,1,1);
+ math_Matrix bidD(abidD,1,1,1,2);
sp.Values(UV,bidF,bidD);
break;
}
Arrive = Standard_True;
UV(1) = U1;
UV(2) = V1;
- static math_Vector bidF(1,1);
- static math_Matrix bidD(1,1,1,2);
+ Standard_Real abidF[1], abidD[1][2];
+ math_Vector bidF(abidF,1,1);
+ math_Matrix bidD(abidD,1,1,1,2);
sp.Values(UV,bidF,bidD);
break;
}
}
}
if (Found) {
- static math_Vector bidF(1,1);
- static math_Matrix bidD(1,1,1,2);
+ Standard_Real abidF[1], abidD[1][2];
+ math_Vector bidF(abidF,1,1);
+ math_Matrix bidD(abidD,1,1,1,2);
sp.Values(UV,bidF,bidD);
Standard_Integer NBP = Line->NbPoints();
Standard_Integer Indextg;
}
if (Found) {
Irang = -Irang; // jag 941017
- static math_Vector bidF(1,1);
- static math_Matrix bidD(1,1,1,2);
+ Standard_Real abidF[1], abidD[1][2];
+ math_Vector bidF(abidF,1,1);
+ math_Matrix bidD(abidD,1,1,1,2);
sp.Values(UV,bidF,bidD);
return;
}
{
Standard_Integer I, N;
- static math_Vector BornInf(1,2), BornSup(1,2), UVap(1,2);
+ Standard_Real aBornInf[2], aBornSup[2], aUVap[2];
+ math_Vector BornInf(aBornInf,1,2), BornSup(aBornSup,1,2), UVap(aUVap,1,2);
Standard_Real PasC, PasCu, PasCv;
Standard_Boolean Arrive; // shows if the line ends
Standard_Boolean Cadre; // shows if one is on border of the domain
}
}
if (Arrive) {
- static math_Vector bidF(1,1);
- static math_Matrix bidD(1,1,1,2);
+ Standard_Real abidF[1], abidD[1][2];
+ math_Vector bidF(abidF,1,1);
+ math_Matrix bidD(abidD,1,1,1,2);
sp.Values(UV,bidF,bidD);
break;
}
{
Standard_Integer I,N;
- static math_Vector BornInf(1,2),BornSup(1,2);
- static math_Vector Uvap(1,2);// parameters of current approach
+ Standard_Real aBornInf[2], aBornSup[2], aUVap[2];
+ math_Vector BornInf(aBornInf,1,2), BornSup(aBornSup,1,2);
+ math_Vector Uvap(aUVap,1,2);// parameters of current approach
Standard_Real PasC; // rate of advancement on the tangent
Standard_Real PasCu; // rate of advancement current by U
Standard_Real PasCv; // step of advancement current by V
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
+namespace {
+ static const Standard_Real CosRef3D = 0.98;// regle par tests dans U4
+ // correspond a 11.478 d
+ static const Standard_Real CosRef2D = 0.88; // correspond a 25 d
+ static const Standard_Integer MaxDivision = 60; // nombre maxi de division
+ // du pas a cause de
+ // l angle trop grand en 2d (U4)
+}
+
IntWalk_StatusDeflection IntWalk_IWalking::TestDeflection
(TheIWFunction& sp,
const Standard_Boolean Finished,
IntWalk_StatusDeflection Status = IntWalk_OK;
- static const Standard_Real CosRef3D = 0.98;// regle par tests dans U4
- // correspond a 11.478 d
- static const Standard_Real CosRef2D = 0.88; // correspond a 25 d
- static const Standard_Integer MaxDivision = 60; // nombre maxi de division
- // du pas a cause de
- // l angle trop grand en 2d (U4)
//---------------------------------------------------------------------------------
//-- lbr le 4 Avril 95 : On peut se trouver ds le cas ou Status renvoie point
//-- confondus si epsilon est assez grand (1e-11) . Dans ce cas on boucle
//-- sans jamais changer les valeurs envoyees a Rsnld.
- static Standard_Integer NbPointsConfondusConsecutifs = 0 ;
- static Standard_Integer EpsilonSembleTropGrand = 0 ;
//---------------------------------------------------------------------------------
Standard_Real Paramu, Paramv, StepU,StepV;
Standard_Real Cosi, Cosi2, Norme;
Psol.SetValue(sp.Point(),reversed, U, V);
}
else if (Case == 11 || Case == 12 ) {
- static math_Vector UV(1, 2);
- static math_Vector FF(1, 1);
- static math_Matrix DD(1, 1, 1, 2);
+ Standard_Real aUV[2], aFF[1], aDD[1][2];
+ math_Vector UV(aUV,1, 2);
+ math_Vector FF(aFF,1, 1);
+ math_Matrix DD(aDD,1, 1, 1, 2);
UV(1) = U;
UV(2) = V;
sp.Values(UV, FF, DD);
{
ThePointOfPath PathPnt;
- static math_Vector UV(1, 2);
- static math_Vector FF(1, 1);
- static math_Matrix DD(1, 1, 1, 2);
+ Standard_Real aUV[2], aFF[1], aDD[1][2];
+ math_Vector UV(aUV,1, 2);
+ math_Vector FF(aFF,1, 1);
+ math_Matrix DD(aDD,1, 1, 1, 2);
previousPoint = Line->Value(1);
if (!reversed) {
firstd2 : Dir2d from gp;
myIntersectionOn2S : TheInt2S ;
-
+ STATIC_BLOCAGE_SUR_PAS_TROP_GRAND : Integer from Standard;
+ STATIC_PRECEDENT_INFLEXION : Integer from Standard;
end PWalking;
fleche(Deflection),
tolconf(Epsilon),
sensCheminement(1),
- myIntersectionOn2S(Caro1,Caro2,TolTangency)
+ myIntersectionOn2S(Caro1,Caro2,TolTangency),
+ STATIC_BLOCAGE_SUR_PAS_TROP_GRAND(0),
+ STATIC_PRECEDENT_INFLEXION(0)
{
Standard_Real KELARG=20.;
//
fleche(Deflection),
tolconf(Epsilon),
sensCheminement(1),
- myIntersectionOn2S(Caro1,Caro2,TolTangency)
+ myIntersectionOn2S(Caro1,Caro2,TolTangency),
+ STATIC_BLOCAGE_SUR_PAS_TROP_GRAND(0),
+ STATIC_PRECEDENT_INFLEXION(0)
{
Standard_Real KELARG=20.;
//
//#define DEBUG 0
+namespace {
+//OCC431(apo): modified ->
+static const Standard_Real CosRef2D = Cos(M_PI/9.0), AngRef2D = M_PI/2.0;
+
+static const Standard_Real d = 7.0;
+}
+
IntWalk_StatusDeflection IntWalk_PWalking::TestDeflection()
// tester si fleche respectee en calculant un majorant de fleche
// tester s il n y a pas changement de rive
//
{
- static Standard_Integer STATIC_BLOCAGE_SUR_PAS_TROP_GRAND = 0;
- static Standard_Integer STATIC_PRECEDENT_INFLEXION = 0;
-
if(line->NbPoints() ==1 ) {
STATIC_BLOCAGE_SUR_PAS_TROP_GRAND=STATIC_PRECEDENT_INFLEXION=0;
}
return(IntWalk_ArretSurPointPrecedent);
}
//==================================================================================
- //OCC431(apo): modified ->
- static Standard_Real CosRef2D = Cos(M_PI/9.0), AngRef2D = M_PI/2.0;
-
- static Standard_Real /*tolArea = 100.0,*/ d = 7.0;
+
Standard_Real tolArea = 100.0;
if (ResoU1 < Precision::PConfusion() ||
ResoV1 < Precision::PConfusion() ||
return 0;
}
-#include <Geom_SurfaceOfRevolution.hxx>
+#include <GeomConvert_ApproxSurface.hxx>
+#include <Geom_BSplineSurface.hxx>
+#include <Draw.hxx>
+#include <OSD_Thread.hxx>
+static void GeomConvertTest (Draw_Interpretor& di, Standard_Integer theTargetNbUPoles, Standard_CString theFileName)
+{
+ Handle(Geom_Surface) aSurf = DrawTrSurf::GetSurface(theFileName);
+ GeomConvert_ApproxSurface aGAS (aSurf, 1e-4, GeomAbs_C1, GeomAbs_C1, 9, 9, 100, 1);
+ if (!aGAS.IsDone()) {
+ di << "ApproxSurface is not done!" << "\n";
+ return;
+ }
+ const Handle(Geom_BSplineSurface)& aBSurf = aGAS.Surface();
+ if (aBSurf.IsNull()) {
+ di << "BSplineSurface is not created!" << "\n";
+ return;
+ }
+ di << "Number of UPoles:" << aBSurf->NbUPoles() << "\n";
+ QCOMPARE (aBSurf->NbUPoles(), theTargetNbUPoles);
+}
+
+struct aData {
+ Draw_Interpretor* di;
+ Standard_Integer nbupoles;
+ Standard_CString filename;
+};
+
+Standard_EXPORT Standard_Address convert(Standard_Address data)
+{
+ aData* info = (aData*) data;
+ GeomConvertTest(*(info->di),info->nbupoles,info->filename);
+ return NULL;
+}
+
+static Standard_Integer OCC23952sweep (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
+{
+ if (argc != 3) {
+ di << "Usage: " << argv[0] << " invalid number of arguments" << "\n";
+ return 1;
+ }
+ struct aData aStorage;
+ aStorage.di = &di;
+ aStorage.nbupoles = Draw::Atoi(argv[1]);
+ aStorage.filename = argv[2];
+
+ OSD_Thread aThread1(convert);
+ aThread1.Run(&aStorage);
+ GeomConvertTest(di,aStorage.nbupoles,aStorage.filename);
+
+ return 0;
+}
+#include <GeomInt_IntSS.hxx>
+static void GeomIntSSTest (Draw_Interpretor& di, Standard_Integer theNbSol, Standard_CString theFileName1, Standard_CString theFileName2)
+{
+ Handle(Geom_Surface) aSurf1 = DrawTrSurf::GetSurface(theFileName1);
+ Handle(Geom_Surface) aSurf2 = DrawTrSurf::GetSurface(theFileName2);
+ GeomInt_IntSS anInter;
+ anInter.Perform(aSurf1, aSurf2, Precision::Confusion(), Standard_True);
+ if (!anInter.IsDone()) {
+ di << "An intersection is not done!" << "\n";
+ return;
+ }
+
+ di << "Number of Lines:" << anInter.NbLines() << "\n";
+ QCOMPARE (anInter.NbLines(), theNbSol);
+}
+
+struct aNewData {
+ Draw_Interpretor* di;
+ Standard_Integer nbsol;
+ Standard_CString filename1;
+ Standard_CString filename2;
+};
+Standard_EXPORT Standard_Address convert_inter(Standard_Address data)
+{
+ aNewData* info = (aNewData*) data;
+ GeomIntSSTest(*(info->di),info->nbsol,info->filename1,info->filename2);
+ return NULL;
+}
+
+static Standard_Integer OCC23952intersect (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
+{
+ if (argc != 4) {
+ di << "Usage: " << argv[0] << " invalid number of arguments" << "\n";
+ return 1;
+ }
+ struct aNewData aStorage;
+ aStorage.di = &di;
+ aStorage.nbsol = Draw::Atoi(argv[1]);
+ aStorage.filename1 = argv[2];
+ aStorage.filename2 = argv[3];
+
+ OSD_Thread aThread1(convert_inter);
+ aThread1.Run(&aStorage);
+ GeomIntSSTest(di,aStorage.nbsol,aStorage.filename1,aStorage.filename2);
+
+ return 0;
+}
+
+#include <Geom_SurfaceOfRevolution.hxx>
static Standard_Integer OCC23683 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv)
{
if (argc < 2) {
theCommands.Add ("OCC22595", "OCC22595", __FILE__, OCC22595, group);
theCommands.Add ("OCC23774", "OCC23774 shape1 shape2", __FILE__, OCC23774, group);
theCommands.Add ("OCC23683", "OCC23683 shape", __FILE__, OCC23683, group);
+ theCommands.Add ("OCC23952sweep", "OCC23952sweep nbupoles shape", __FILE__, OCC23952sweep, group);
+ theCommands.Add ("OCC23952intersect", "OCC23952intersect nbsol shape1 shape2", __FILE__, OCC23952intersect, group);
theCommands.Add ("test_offset", "test_offset", __FILE__, test_offset, group);
-
return;
}
#define NEWSEQ 1
-#if NEWSEQ
-TColStd_SequenceOfReal StaticSol;
-
-#endif
+static const Standard_Integer methode = 1; //-- 1:(Nv Traitement) 3:(Nv + Ancien +check) 2:(Ancien)
math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F,
const Standard_Real A,
}
#endif
- static Standard_Integer methode = 1; //-- 1:(Nv Traitement) 3:(Nv + Ancien +check) 2:(Ancien)
+#if NEWSEQ
+ TColStd_SequenceOfReal StaticSol;
+#endif
Sol.Clear();
NbStateSol.Clear();
if(methode & 1) {
#include <math_MultipleVarFunction.hxx>
-static Standard_Real sqrarg;
-#define SQR(a) (sqrarg=(a), sqrarg*sqrarg)
+namespace {
+static inline Standard_Real SQR (const Standard_Real a)
+{
+ return a * a;
+}
+}
class DirFunctionBis : public math_Function {
#include <math_IntegerVector.hxx>
#include <math_Matrix.hxx>
-static Standard_Real at, bt, ct;
-#define PYTHAG(a,b) ((at=fabs(a)) > (bt=fabs(b)) ? \
-(ct=bt/at,at*sqrt(1.0+ct*ct)) : (bt ? (ct=at/bt,bt*sqrt(1.0+ct*ct)) : 0.0))
+namespace {
+static inline Standard_Real PYTHAG (const Standard_Real a, const Standard_Real b)
+{
+ Standard_Real at = fabs (a), bt = fabs (b), ct = 0.;
+ if (at > bt) {
+ ct = bt / at;
+ ct = at * sqrt (1.0 + ct * ct);
+ } else if (bt) {
+ ct = at / bt;
+ ct = bt * sqrt (1.0 + ct * ct);
+ }
+ return ct;
+}
+}
#define SIGN(a,b) ((b) >= 0.0 ? fabs(a) : -fabs(a))
--- /dev/null
+puts "================"
+puts "OCC23952"
+puts "================"
+puts ""
+###########################################################################################
+# Improving thread-safety of intersections, approximations and other modeling algorithms
+###########################################################################################
+
+pload QAcommands
+restore [locate_data_file bug23952_trim-torus.draw] res
+
+set NbUPoles 18
+set info [OCC23952sweep $NbUPoles res]
+
+if { [regexp "theTargetNbUPoles: OK" $info] != 1 } {
+ puts "Error : Number of UPoles is incorrect"
+} else {
+ puts "OK: Number of UPoles is correct"
+}
--- /dev/null
+puts "================"
+puts "OCC23952"
+puts "================"
+puts ""
+###########################################################################################
+# Improving thread-safety of intersections, approximations and other modeling algorithms
+###########################################################################################
+
+pload QAcommands
+restore [locate_data_file bug23952_s1.draw] a
+restore [locate_data_file bug23952_s2.draw] b
+
+set NbLines 5
+set info [OCC23952intersect $NbLines a b]
+
+if { [regexp "theNbSol: OK" $info] != 1 } {
+ puts "Error : Number of intersections is incorrect"
+} else {
+ puts "OK: Number of intersections is correct"
+}
+