void vegas(VecDoub_I ®n, Doub fxn(VecDoub_I &, const Doub), const Int init, const Int ncall, const Int itmx, const Int nprn, Doub &tgral, Doub &sd, Doub &chi2a) { static const Int NDMX=50, MXDIM=10, RANSEED=5330; static const Doub ALPH=1.5, TINY=1.0e-30; static Int i,it,j,k,mds,nd,ndo,ng,npg; static Doub calls,dv2g,dxg,f,f2,f2b,fb,rc,ti; static Doub tsi,wgt,xjac,xn,xnd,xo,schi,si,swgt; static VecInt ia(MXDIM),kg(MXDIM); static VecDoub dt(MXDIM),dx(MXDIM),r(NDMX),x(MXDIM),xin(NDMX); static MatDoub d(NDMX,MXDIM),di(NDMX,MXDIM),xi(MXDIM,NDMX); static Ran ran_vegas(RANSEED); Int ndim=regn.size()/2; if (init <= 0) { mds=ndo=1; for (j=0;j= 0) { mds = -1; npg=ng/NDMX+1; nd=ng/npg; ng=npg*nd; } } for (k=1,i=0;i= 0) { cout << " Input parameters for vegas"; cout << " ndim= " << setw(4) << ndim; cout << " ncall= " << setw(8) << calls << endl; cout << setw(34) << " it=" << setw(5) << it; cout << " itmx=" << setw(5) << itmx << endl; cout << setw(34) << " nprn=" << setw(5) << nprn; cout << " ALPH=" << setw(9) << ALPH << endl; cout << setw(34) << " mds=" << setw(5) << mds; cout << " nd=" << setw(5) << nd << endl; for (j=0;j