struct Solvde { const Int itmax; const Doub conv; const Doub slowc; const VecDoub &scalv; const VecInt &indexv; const Int nb; MatDoub &y; Difeq &difeq; Int ne,m; VecInt kmax; VecDoub ermax; Mat3DDoub c; MatDoub s; Solvde(const Int itmaxx, const Doub convv, const Doub slowcc, VecDoub_I &scalvv, VecInt_I &indexvv, const Int nbb, MatDoub_IO &yy, Difeq &difeqq); void pinvs(const Int ie1, const Int ie2, const Int je1, const Int jsf, const Int jc1, const Int k); void bksub(const Int ne, const Int nb, const Int jf, const Int k1, const Int k2); void red(const Int iz1, const Int iz2, const Int jz1, const Int jz2, const Int jm1, const Int jm2, const Int jmf, const Int ic1, const Int jc1, const Int jcf, const Int kc); }; Solvde::Solvde(const Int itmaxx, const Doub convv, const Doub slowcc, VecDoub_I &scalvv, VecInt_I &indexvv, const Int nbb, MatDoub_IO &yy, Difeq &difeqq) : itmax(itmaxx), conv(convv), slowc(slowcc), scalv(scalvv), indexv(indexvv), nb(nbb), y(yy), difeq(difeqq), ne(y.nrows()), m(y.ncols()), kmax(ne), ermax(ne), c(ne,ne-nb+1,m+1), s(ne,2*ne+1) { Int jv,k,nvars=ne*m; Int k1=0,k2=m; Int j1=0,j2=nb,j3=nb,j4=ne,j5=j4+j1,j6=j4+j2,j7=j4+j3,j8=j4+j4,j9=j8+j1; Int ic1=0,ic2=ne-nb,ic3=ic2,ic4=ne,jc1=0,jcf=ic3; for (Int it=0;it vmax) { vmax=vz; km=k+1; } errj += vz; } err += errj/scalv[j]; ermax[j]=c[jv][0][km-1]/scalv[j]; kmax[j]=km; } err /= nvars; Doub fac=(err > slowc ? slowc/err : 1.0); for (Int j=0;j big) big=abs(s[i][j]); if (big == 0.0) throw("Singular matrix - row all 0, in pinvs"); pscl[i-ie1]=1.0/big; indxr[i-ie1]=0; } for (id=0;id big) { jp=j; big=abs(s[i][j]); } } if (big*pscl[i-ie1] > piv) { ipiv=i; jpiv=jp; piv=big*pscl[i-ie1]; } } } if (s[ipiv][jpiv] == 0.0) throw("Singular matrix in routine pinvs"); indxr[ipiv-ie1]=jpiv+1; pivinv=1.0/s[ipiv][jpiv]; for (j=je1;j<=jsf;j++) s[ipiv][j] *= pivinv; s[ipiv][jpiv]=1.0; for (i=ie1;i=k1;k--) { if (k == k1) im=nbf+1; Int kp=k+1; for (Int j=0;j