nr.h
Go to the documentation of this file.
00001 #ifndef _NR_H_
00002 #define _NR_H_
00003 #include <fstream>
00004 #include <complex>
00005 #include "nrutil.h"
00006 #include "nrtypes_nr.h"
00007 using namespace std;
00008 
00009 namespace NR {
00010 
00011 void addint(Mat_O_DP &uf, Mat_I_DP &uc, Mat_O_DP &res);
00012 void airy(const DP x, DP &ai, DP &bi, DP &aip, DP &bip);
00013 void amebsa(Mat_IO_DP &p, Vec_IO_DP &y, Vec_O_DP &pb, DP &yb, const DP ftol,
00014         DP funk(Vec_I_DP &), int &iter, const DP temptr);
00015 void amoeba(Mat_IO_DP &p, Vec_IO_DP &y, const DP ftol, DP funk(Vec_I_DP &),
00016         int &nfunk);
00017 DP amotry(Mat_IO_DP &p, Vec_O_DP &y, Vec_IO_DP &psum, DP funk(Vec_I_DP &),
00018         const int ihi, const DP fac);
00019 DP amotsa(Mat_IO_DP &p, Vec_O_DP &y, Vec_IO_DP &psum, Vec_O_DP &pb, DP &yb,
00020         DP funk(Vec_I_DP &), const int ihi, DP &yhi, const DP fac);
00021 void anneal(Vec_I_DP &x, Vec_I_DP &y, Vec_IO_INT &iorder);
00022 DP anorm2(Mat_I_DP &a);
00023 void arcmak(Vec_I_ULNG &nfreq, unsigned long nchh, unsigned long nradd,
00024         arithcode &acode);
00025 void arcode(unsigned long &ich, string &code, unsigned long &lcd,
00026         const int isign, arithcode &acode);
00027 void arcsum(Vec_I_ULNG &iin, Vec_O_ULNG &iout, unsigned long ja,
00028         const int nwk, const unsigned long nrad, const unsigned long nc);
00029 void asolve(Vec_I_DP &b, Vec_O_DP &x, const int itrnsp);
00030 void atimes(Vec_I_DP &x, Vec_O_DP &r, const int itrnsp);
00031 void avevar(Vec_I_DP &data, DP &ave, DP &var);
00032 void balanc(Mat_IO_DP &a);
00033 void banbks(Mat_I_DP &a, const int m1, const int m2, Mat_I_DP &al,
00034         Vec_I_INT &indx, Vec_IO_DP &b);
00035 void bandec(Mat_IO_DP &a, const int m1, const int m2, Mat_O_DP &al,
00036         Vec_O_INT &indx, DP &d);
00037 void banmul(Mat_I_DP &a, const int m1, const int m2, Vec_I_DP &x,
00038         Vec_O_DP &b);
00039 void bcucof(Vec_I_DP &y, Vec_I_DP &y1, Vec_I_DP &y2, Vec_I_DP &y12,
00040         const DP d1, const DP d2, Mat_O_DP &c);
00041 void bcuint(Vec_I_DP &y, Vec_I_DP &y1, Vec_I_DP &y2, Vec_I_DP &y12,
00042         const DP x1l, const DP x1u, const DP x2l, const DP x2u,
00043         const DP x1, const DP x2, DP &ansy, DP &ansy1, DP &ansy2);
00044 void beschb(const DP x, DP &gam1, DP &gam2, DP &gampl, DP &gammi);
00045 DP bessi(const int n, const DP x);
00046 DP bessi0(const DP x);
00047 DP bessi1(const DP x);
00048 void bessik(const DP x, const DP xnu, DP &ri, DP &rk, DP &rip, DP &rkp);
00049 DP bessj(const int n, const DP x);
00050 DP bessj0(const DP x);
00051 DP bessj1(const DP x);
00052 void bessjy(const DP x, const DP xnu, DP &rj, DP &ry, DP &rjp, DP &ryp);
00053 DP bessk(const int n, const DP x);
00054 DP bessk0(const DP x);
00055 DP bessk1(const DP x);
00056 DP bessy(const int n, const DP x);
00057 DP bessy0(const DP x);
00058 DP bessy1(const DP x);
00059 DP beta(const DP z, const DP w);
00060 DP betacf(const DP a, const DP b, const DP x);
00061 DP betai(const DP a, const DP b, const DP x);
00062 DP bico(const int n, const int k);
00063 void bksub(const int ne, const int nb, const int jf, const int k1,
00064         const int k2, Mat3D_IO_DP &c);
00065 DP bnldev(const DP pp, const int n, int &idum);
00066 DP brent(const DP ax, const DP bx, const DP cx, DP f(const DP),
00067         const DP tol, DP &xmin);
00068 void broydn(Vec_IO_DP &x, bool &check, void vecfunc(Vec_I_DP &, Vec_O_DP &));
00069 void bsstep(Vec_IO_DP &y, Vec_IO_DP &dydx, DP &xx, const DP htry,
00070         const DP eps, Vec_I_DP &yscal, DP &hdid, DP &hnext,
00071         void derivs(const DP, Vec_I_DP &, Vec_O_DP &));
00072 void caldat(const int julian, int &mm, int &id, int &iyyy);
00073 void chder(const DP a, const DP b, Vec_I_DP &c, Vec_O_DP &cder, const int n);
00074 DP chebev(const DP a, const DP b, Vec_I_DP &c, const int m, const DP x);
00075 void chebft(const DP a, const DP b, Vec_O_DP &c, DP func(const DP));
00076 void chebpc(Vec_I_DP &c, Vec_O_DP &d);
00077 void chint(const DP a, const DP b, Vec_I_DP &c, Vec_O_DP &cint, const int n);
00078 DP chixy(const DP bang);
00079 void choldc(Mat_IO_DP &a, Vec_O_DP &p);
00080 void cholsl(Mat_I_DP &a, Vec_I_DP &p, Vec_I_DP &b, Vec_O_DP &x);
00081 void chsone(Vec_I_DP &bins, Vec_I_DP &ebins, const int knstrn, DP &df,
00082         DP &chsq, DP &prob);
00083 void chstwo(Vec_I_DP &bins1, Vec_I_DP &bins2, const int knstrn, DP &df,
00084         DP &chsq, DP &prob);
00085 void cisi(const DP x, complex<DP> &cs);
00086 void cntab1(Mat_I_INT &nn, DP &chisq, DP &df, DP &prob, DP &cramrv, DP &ccc);
00087 void cntab2(Mat_I_INT &nn, DP &h, DP &hx, DP &hy, DP &hygx, DP &hxgy,
00088         DP &uygx, DP &uxgy, DP &uxy);
00089 void convlv(Vec_I_DP &data, Vec_I_DP &respns, const int isign,
00090         Vec_O_DP &ans);
00091 void copy(Mat_O_DP &aout, Mat_I_DP &ain);
00092 void correl(Vec_I_DP &data1, Vec_I_DP &data2, Vec_O_DP &ans);
00093 void cosft1(Vec_IO_DP &y);
00094 void cosft2(Vec_IO_DP &y, const int isign);
00095 void covsrt(Mat_IO_DP &covar, Vec_I_BOOL &ia, const int mfit);
00096 void crank(Vec_IO_DP &w, DP &s);
00097 void cyclic(Vec_I_DP &a, Vec_I_DP &b, Vec_I_DP &c, const DP alpha,
00098         const DP beta, Vec_I_DP &r, Vec_O_DP &x);
00099 void daub4(Vec_IO_DP &a, const int n, const int isign);
00100 DP dawson(const DP x);
00101 DP dbrent(const DP ax, const DP bx, const DP cx, DP f(const DP),
00102         DP df(const DP), const DP tol, DP &xmin);
00103 void ddpoly(Vec_I_DP &c, const DP x, Vec_O_DP &pd);
00104 bool decchk(string str, char &ch);
00105 void derivs_s(const DP x, Vec_I_DP &y, Vec_O_DP &dydx);
00106 DP df1dim(const DP x);
00107 void dfpmin(Vec_IO_DP &p, const DP gtol, int &iter, DP &fret,
00108         DP func(Vec_I_DP &), void dfunc(Vec_I_DP &, Vec_O_DP &));
00109 DP dfridr(DP func(const DP), const DP x, const DP h, DP &err);
00110 void dftcor(const DP w, const DP delta, const DP a, const DP b,
00111         Vec_I_DP &endpts, DP &corre, DP &corim, DP &corfac);
00112 void dftint(DP func(const DP), const DP a, const DP b, const DP w,
00113         DP &cosint, DP &sinint);
00114 void difeq(const int k, const int k1, const int k2, const int jsf,
00115         const int is1, const int isf, Vec_I_INT &indexv, Mat_O_DP &s,
00116         Mat_I_DP &y);
00117 void dlinmin(Vec_IO_DP &p, Vec_IO_DP &xi, DP &fret, DP func(Vec_I_DP &),
00118         void dfunc(Vec_I_DP &, Vec_O_DP &));
00119 void eclass(Vec_O_INT &nf, Vec_I_INT &lista, Vec_I_INT &listb);
00120 void eclazz(Vec_O_INT &nf, bool equiv(const int, const int));
00121 DP ei(const DP x);
00122 void eigsrt(Vec_IO_DP &d, Mat_IO_DP &v);
00123 DP elle(const DP phi, const DP ak);
00124 DP ellf(const DP phi, const DP ak);
00125 DP ellpi(const DP phi, const DP en, const DP ak);
00126 void elmhes(Mat_IO_DP &a);
00127 DP erfcc(const DP x);
00128 DP erff(const DP x);
00129 DP erffc(const DP x);
00130 void eulsum(DP &sum, const DP term, const int jterm, Vec_IO_DP &wksp);
00131 DP evlmem(const DP fdt, Vec_I_DP &d, const DP xms);
00132 DP expdev(int &idum);
00133 DP expint(const int n, const DP x);
00134 DP f1dim(const DP x);
00135 DP factln(const int n);
00136 DP factrl(const int n);
00137 void fasper(Vec_I_DP &x, Vec_I_DP &y, const DP ofac, const DP hifac,
00138         Vec_O_DP &wk1, Vec_O_DP &wk2, int &nout, int &jmax, DP &prob);
00139 void fdjac(Vec_IO_DP &x, Vec_I_DP &fvec, Mat_O_DP &df,
00140         void vecfunc(Vec_I_DP &, Vec_O_DP &));
00141 void fgauss(const DP x, Vec_I_DP &a, DP &y, Vec_O_DP &dyda);
00142 void fit(Vec_I_DP &x, Vec_I_DP &y, Vec_I_DP &sig, const bool mwt, DP &a,
00143         DP &b, DP &siga, DP &sigb, DP &chi2, DP &q);
00144 void fitexy(Vec_I_DP &x, Vec_I_DP &y, Vec_I_DP &sigx, Vec_I_DP &sigy,
00145         DP &a, DP &b, DP &siga, DP &sigb, DP &chi2, DP &q);
00146 void fixrts(Vec_IO_DP &d);
00147 void fleg(const DP x, Vec_O_DP &pl);
00148 void flmoon(const int n, const int nph, int &jd, DP &frac);
00149 DP fmin(Vec_I_DP &x);
00150 void four1(Vec_IO_DP &data, const int isign);
00151 void fourew(Vec_FSTREAM_p &file, int &na, int &nb, int &nc, int &nd);
00152 void fourfs(Vec_FSTREAM_p &file, Vec_I_INT &nn, const int isign);
00153 void fourn(Vec_IO_DP &data, Vec_I_INT &nn, const int isign);
00154 void fpoly(const DP x, Vec_O_DP &p);
00155 void fred2(const DP a, const DP b, Vec_O_DP &t, Vec_O_DP &f, Vec_O_DP &w,
00156         DP g(const DP), DP ak(const DP, const DP));
00157 DP fredin(const DP x, const DP a, const DP b, Vec_I_DP &t, Vec_I_DP &f,
00158         Vec_I_DP &w, DP g(const DP), DP ak(const DP, const DP));
00159 void frenel(const DP x, complex<DP> &cs);
00160 void frprmn(Vec_IO_DP &p, const DP ftol, int &iter, DP &fret,
00161         DP func(Vec_I_DP &), void dfunc(Vec_I_DP &, Vec_O_DP &));
00162 void ftest(Vec_I_DP &data1, Vec_I_DP &data2, DP &f, DP &prob);
00163 DP gamdev(const int ia, int &idum);
00164 DP gammln(const DP xx);
00165 DP gammp(const DP a, const DP x);
00166 DP gammq(const DP a, const DP x);
00167 DP gasdev(int &idum);
00168 void gaucof(Vec_IO_DP &a, Vec_IO_DP &b, const DP amu0, Vec_O_DP &x,
00169         Vec_O_DP &w);
00170 void gauher(Vec_O_DP &x, Vec_O_DP &w);
00171 void gaujac(Vec_O_DP &x, Vec_O_DP &w, const DP alf, const DP bet);
00172 void gaulag(Vec_O_DP &x, Vec_O_DP &w, const DP alf);
00173 void gauleg(const DP x1, const DP x2, Vec_O_DP &x, Vec_O_DP &w);
00174 void gaussj(Mat_IO_DP &a, Mat_IO_DP &b);
00175 void gcf(DP &gammcf, const DP a, const DP x, DP &gln);
00176 DP golden(const DP ax, const DP bx, const DP cx, DP f(const DP),
00177         const DP tol, DP &xmin);
00178 void gser(DP &gamser, const DP a, const DP x, DP &gln);
00179 void hpsel(Vec_I_DP &arr, Vec_O_DP &heap);
00180 void hpsort(Vec_IO_DP &ra);
00181 void hqr(Mat_IO_DP &a, Vec_O_CPLX_DP &wri);
00182 void hufapp(Vec_IO_ULNG &index, Vec_I_ULNG &nprob, const unsigned long n,
00183         const unsigned long m);
00184 void hufdec(unsigned long &ich, string &code, const unsigned long lcode,
00185         unsigned long &nb, huffcode &hcode);
00186 void hufenc(const unsigned long ich, string &code, unsigned long &nb,
00187         huffcode &hcode);
00188 void hufmak(Vec_I_ULNG &nfreq, const unsigned long nchin,
00189         unsigned long &ilong, unsigned long &nlong, huffcode &hcode);
00190 void hunt(Vec_I_DP &xx, const DP x, int &jlo);
00191 void hypdrv(const DP s, Vec_I_DP &yy, Vec_O_DP &dyyds);
00192 complex<DP> hypgeo(const complex<DP> &a, const complex<DP> &b,
00193         const complex<DP> &c, const complex<DP> &z);
00194 void hypser(const complex<DP> &a, const complex<DP> &b,
00195         const complex<DP> &c, const complex<DP> &z,
00196         complex<DP> &series, complex<DP> &deriv);
00197 unsigned short icrc(const unsigned short crc, const string &bufptr,
00198         const short jinit, const int jrev);
00199 unsigned short icrc1(const unsigned short crc, const unsigned char onech);
00200 unsigned long igray(const unsigned long n, const int is);
00201 void indexx(Vec_I_DP &arr, Vec_O_INT &indx);
00202 void indexx(Vec_I_INT &arr, Vec_O_INT &indx);
00203 void interp(Mat_O_DP &uf, Mat_I_DP &uc);
00204 int irbit1(unsigned long &iseed);
00205 int irbit2(unsigned long &iseed);
00206 void jacobi(Mat_IO_DP &a, Vec_O_DP &d, Mat_O_DP &v, int &nrot);
00207 void jacobn_s(const DP x, Vec_I_DP &y, Vec_O_DP &dfdx, Mat_O_DP &dfdy);
00208 int julday(const int mm, const int id, const int iyyy);
00209 void kendl1(Vec_I_DP &data1, Vec_I_DP &data2, DP &tau, DP &z, DP &prob);
00210 void kendl2(Mat_I_DP &tab, DP &tau, DP &z, DP &prob);
00211 void kermom(Vec_O_DP &w, const DP y);
00212 void ks2d1s(Vec_I_DP &x1, Vec_I_DP &y1, void quadvl(const DP, const DP,
00213         DP &, DP &, DP &, DP &), DP &d1, DP &prob);
00214 void ks2d2s(Vec_I_DP &x1, Vec_I_DP &y1, Vec_I_DP &x2, Vec_I_DP &y2, DP &d,
00215         DP &prob);
00216 void ksone(Vec_IO_DP &data, DP func(const DP), DP &d, DP &prob);
00217 void kstwo(Vec_IO_DP &data1, Vec_IO_DP &data2, DP &d, DP &prob);
00218 void laguer(Vec_I_CPLX_DP &a, complex<DP> &x, int &its);
00219 void lfit(Vec_I_DP &x, Vec_I_DP &y, Vec_I_DP &sig, Vec_IO_DP &a,
00220         Vec_I_BOOL &ia, Mat_O_DP &covar, DP &chisq,
00221         void funcs(const DP, Vec_O_DP &));
00222 void linbcg(Vec_I_DP &b, Vec_IO_DP &x, const int itol, const DP tol,
00223         const int itmax, int &iter, DP &err);
00224 void linmin(Vec_IO_DP &p, Vec_IO_DP &xi, DP &fret, DP func(Vec_I_DP &));
00225 void lnsrch(Vec_I_DP &xold, const DP fold, Vec_I_DP &g, Vec_IO_DP &p,
00226         Vec_O_DP &x, DP &f, const DP stpmax, bool &check, DP func(Vec_I_DP &));
00227 void locate(Vec_I_DP &xx, const DP x, int &j);
00228 void lop(Mat_O_DP &out, Mat_I_DP &u);
00229 void lubksb(Mat_I_DP &a, Vec_I_INT &indx, Vec_IO_DP &b);
00230 void ludcmp(Mat_IO_DP &a, Vec_O_INT &indx, DP &d);
00231 void machar(int &ibeta, int &it, int &irnd, int &ngrd, int &machep,
00232         int &negep, int &iexp, int &minexp, int &maxexp, DP &eps, DP &epsneg,
00233         DP &xmin, DP &xmax);
00234 void matadd(Mat_I_DP &a, Mat_I_DP &b, Mat_O_DP &c);
00235 void matsub(Mat_I_DP &a, Mat_I_DP &b, Mat_O_DP &c);
00236 void medfit(Vec_I_DP &x, Vec_I_DP &y, DP &a, DP &b, DP &abdev);
00237 void memcof(Vec_I_DP &data, DP &xms, Vec_O_DP &d);
00238 bool metrop(const DP de, const DP t);
00239 void mgfas(Mat_IO_DP &u, const int maxcyc);
00240 void mglin(Mat_IO_DP &u, const int ncycle);
00241 DP midexp(DP funk(const DP), const DP aa, const DP bb, const int n);
00242 DP midinf(DP funk(const DP), const DP aa, const DP bb, const int n);
00243 DP midpnt(DP func(const DP), const DP a, const DP b, const int n);
00244 DP midsql(DP funk(const DP), const DP aa, const DP bb, const int n);
00245 DP midsqu(DP funk(const DP), const DP aa, const DP bb, const int n);
00246 void miser(DP func(Vec_I_DP &), Vec_I_DP &regn, const int npts,
00247         const DP dith, DP &ave, DP &var);
00248 void mmid(Vec_I_DP &y, Vec_I_DP &dydx, const DP xs, const DP htot,
00249         const int nstep, Vec_O_DP &yout,
00250         void derivs(const DP, Vec_I_DP &, Vec_O_DP &));
00251 void mnbrak(DP &ax, DP &bx, DP &cx, DP &fa, DP &fb, DP &fc,
00252         DP func(const DP));
00253 void mnewt(const int ntrial, Vec_IO_DP &x, const DP tolx, const DP tolf);
00254 void moment(Vec_I_DP &data, DP &ave, DP &adev, DP &sdev, DP &var, DP &skew,
00255         DP &curt);
00256 void mp2dfr(Vec_IO_UCHR &a, string &s);
00257 void mpadd(Vec_O_UCHR &w, Vec_I_UCHR &u, Vec_I_UCHR &v);
00258 void mpdiv(Vec_O_UCHR &q, Vec_O_UCHR &r, Vec_I_UCHR &u, Vec_I_UCHR &v);
00259 void mpinv(Vec_O_UCHR &u, Vec_I_UCHR &v);
00260 void mplsh(Vec_IO_UCHR &u);
00261 void mpmov(Vec_O_UCHR &u, Vec_I_UCHR &v);
00262 void mpmul(Vec_O_UCHR &w, Vec_I_UCHR &u, Vec_I_UCHR &v);
00263 void mpneg(Vec_IO_UCHR &u);
00264 void mppi(const int np);
00265 void mprove(Mat_I_DP &a, Mat_I_DP &alud, Vec_I_INT &indx, Vec_I_DP &b,
00266         Vec_IO_DP &x);
00267 void mpsad(Vec_O_UCHR &w, Vec_I_UCHR &u, const int iv);
00268 void mpsdv(Vec_O_UCHR &w, Vec_I_UCHR &u, const int iv, int &ir);
00269 void mpsmu(Vec_O_UCHR &w, Vec_I_UCHR &u, const int iv);
00270 void mpsqrt(Vec_O_UCHR &w, Vec_O_UCHR &u, Vec_I_UCHR &v);
00271 void mpsub(int &is, Vec_O_UCHR &w, Vec_I_UCHR &u, Vec_I_UCHR &v);
00272 void mrqcof(Vec_I_DP &x, Vec_I_DP &y, Vec_I_DP &sig, Vec_I_DP &a,
00273         Vec_I_BOOL &ia, Mat_O_DP &alpha, Vec_O_DP &beta, DP &chisq,
00274         void funcs(const DP, Vec_I_DP &,DP &, Vec_O_DP &));
00275 void mrqmin(Vec_I_DP &x, Vec_I_DP &y, Vec_I_DP &sig, Vec_IO_DP &a,
00276         Vec_I_BOOL &ia, Mat_O_DP &covar, Mat_O_DP &alpha, DP &chisq,
00277         void funcs(const DP, Vec_I_DP &, DP &, Vec_O_DP &), DP &alamda);
00278 void newt(Vec_IO_DP &x, bool &check, void vecfunc(Vec_I_DP &, Vec_O_DP &));
00279 void odeint(Vec_IO_DP &ystart, const DP x1, const DP x2, const DP eps,
00280         const DP h1, const DP hmin, int &nok, int &nbad,
00281         void derivs(const DP, Vec_I_DP &, Vec_O_DP &),
00282         void rkqs(Vec_IO_DP &, Vec_IO_DP &, DP &, const DP, const DP,
00283         Vec_I_DP &, DP &, DP &, void (*)(const DP, Vec_I_DP &, Vec_O_DP &)));
00284 void orthog(Vec_I_DP &anu, Vec_I_DP &alpha, Vec_I_DP &beta, Vec_O_DP &a,
00285         Vec_O_DP &b);
00286 void pade(Vec_IO_DP &cof, DP &resid);
00287 void pccheb(Vec_I_DP &d, Vec_O_DP &c);
00288 void pcshft(const DP a, const DP b, Vec_IO_DP &d);
00289 void pearsn(Vec_I_DP &x, Vec_I_DP &y, DP &r, DP &prob, DP &z);
00290 void period(Vec_I_DP &x, Vec_I_DP &y, const DP ofac, const DP hifac,
00291         Vec_O_DP &px, Vec_O_DP &py, int &nout, int &jmax, DP &prob);
00292 void piksr2(Vec_IO_DP &arr, Vec_IO_DP &brr);
00293 void piksrt(Vec_IO_DP &arr);
00294 void pinvs(const int ie1, const int ie2, const int je1, const int jsf,
00295         const int jc1, const int k, Mat3D_O_DP &c, Mat_IO_DP &s);
00296 DP plgndr(const int l, const int m, const DP x);
00297 DP poidev(const DP xm, int &idum);
00298 void polcoe(Vec_I_DP &x, Vec_I_DP &y, Vec_O_DP &cof);
00299 void polcof(Vec_I_DP &xa, Vec_I_DP &ya, Vec_O_DP &cof);
00300 void poldiv(Vec_I_DP &u, Vec_I_DP &v, Vec_O_DP &q, Vec_O_DP &r);
00301 void polin2(Vec_I_DP &x1a, Vec_I_DP &x2a, Mat_I_DP &ya, const DP x1,
00302         const DP x2, DP &y, DP &dy);
00303 void polint(Vec_I_DP &xa, Vec_I_DP &ya, const DP x, DP &y, DP &dy);
00304 void powell(Vec_IO_DP &p, Mat_IO_DP &xi, const DP ftol, int &iter,
00305         DP &fret, DP func(Vec_I_DP &));
00306 void predic(Vec_I_DP &data, Vec_I_DP &d, Vec_O_DP &future);
00307 DP probks(const DP alam);
00308 void psdes(unsigned long &lword, unsigned long &irword);
00309 void pwt(Vec_IO_DP &a, const int n, const int isign);
00310 void pwtset(const int n);
00311 DP pythag(const DP a, const DP b);
00312 void pzextr(const int iest, const DP xest, Vec_I_DP &yest, Vec_O_DP &yz,
00313         Vec_O_DP &dy);
00314 DP qgaus(DP func(const DP), const DP a, const DP b);
00315 void qrdcmp(Mat_IO_DP &a, Vec_O_DP &c, Vec_O_DP &d, bool &sing);
00316 DP qromb(DP func(const DP), DP a, DP b);
00317 DP qromo(DP func(const DP), const DP a, const DP b,
00318         DP choose(DP (*)(const DP), const DP, const DP, const int));
00319 void qroot(Vec_I_DP &p, DP &b, DP &c, const DP eps);
00320 void qrsolv(Mat_I_DP &a, Vec_I_DP &c, Vec_I_DP &d, Vec_IO_DP &b);
00321 void qrupdt(Mat_IO_DP &r, Mat_IO_DP &qt, Vec_IO_DP &u, Vec_I_DP &v);
00322 DP qsimp(DP func(const DP), const DP a, const DP b);
00323 DP qtrap(DP func(const DP), const DP a, const DP b);
00324 DP quad3d(DP func(const DP, const DP, const DP), const DP x1, const DP x2);
00325 void quadct(const DP x, const DP y, Vec_I_DP &xx, Vec_I_DP &yy, DP &fa,
00326         DP &fb, DP &fc, DP &fd);
00327 void quadmx(Mat_O_DP &a);
00328 void quadvl(const DP x, const DP y, DP &fa, DP &fb, DP &fc, DP &fd);
00329 DP ran0(int &idum);
00330 DP ran1(int &idum);
00331 DP ran2(int &idum);
00332 DP ran3(int &idum);
00333 DP ran4(int &idum);
00334 void rank(Vec_I_INT &indx, Vec_O_INT &irank);
00335 void ranpt(Vec_O_DP &pt, Vec_I_DP &regn);
00336 void ratint(Vec_I_DP &xa, Vec_I_DP &ya, const DP x, DP &y, DP &dy);
00337 void ratlsq(DP fn(const DP), const DP a, const DP b, const int mm,
00338         const int kk, Vec_O_DP &cof, DP &dev);
00339 DP ratval(const DP x, Vec_I_DP &cof, const int mm, const int kk);
00340 DP rc(const DP x, const DP y);
00341 DP rd(const DP x, const DP y, const DP z);
00342 void realft(Vec_IO_DP &data, const int isign);
00343 void rebin(const DP rc, const int nd, Vec_I_DP &r, Vec_O_DP &xin,
00344         Mat_IO_DP &xi, const int j);
00345 void red(const int iz1, const int iz2, const int jz1, const int jz2,
00346         const int jm1, const int jm2, const int jmf, const int ic1,
00347         const int jc1, const int jcf, const int kc, Mat3D_I_DP &c,
00348         Mat_IO_DP &s);
00349 void relax(Mat_IO_DP &u, Mat_I_DP &rhs);
00350 void relax2(Mat_IO_DP &u, Mat_I_DP &rhs);
00351 void resid(Mat_O_DP &res, Mat_I_DP &u, Mat_I_DP &rhs);
00352 DP revcst(Vec_I_DP &x, Vec_I_DP &y, Vec_I_INT &iorder, Vec_IO_INT &n);
00353 void reverse(Vec_IO_INT &iorder, Vec_I_INT &n);
00354 DP rf(const DP x, const DP y, const DP z);
00355 DP rj(const DP x, const DP y, const DP z, const DP p);
00356 void rk4(Vec_I_DP &y, Vec_I_DP &dydx, const DP x, const DP h,
00357         Vec_O_DP &yout, void derivs(const DP, Vec_I_DP &, Vec_O_DP &));
00358 void rkck(Vec_I_DP &y, Vec_I_DP &dydx, const DP x,
00359         const DP h, Vec_O_DP &yout, Vec_O_DP &yerr,
00360         void derivs(const DP, Vec_I_DP &, Vec_O_DP &));
00361 void rkdumb(Vec_I_DP &vstart, const DP x1, const DP x2,
00362         void derivs(const DP, Vec_I_DP &, Vec_O_DP &));
00363 void rkqs(Vec_IO_DP &y, Vec_IO_DP &dydx, DP &x, const DP htry,
00364         const DP eps, Vec_I_DP &yscal, DP &hdid, DP &hnext,
00365         void derivs(const DP, Vec_I_DP &, Vec_O_DP &));
00366 void rlft3(Mat3D_IO_DP &data, Mat_IO_DP &speq, const int isign);
00367 DP rofunc(const DP b);
00368 void rotate(Mat_IO_DP &r, Mat_IO_DP &qt, const int i, const DP a,
00369         const DP b);
00370 void rsolv(Mat_I_DP &a, Vec_I_DP &d, Vec_IO_DP &b);
00371 void rstrct(Mat_O_DP &uc, Mat_I_DP &uf);
00372 DP rtbis(DP func(const DP), const DP x1, const DP x2, const DP xacc);
00373 DP rtflsp(DP func(const DP), const DP x1, const DP x2, const DP xacc);
00374 DP rtnewt(void funcd(const DP, DP &, DP &), const DP x1, const DP x2,
00375         const DP xacc);
00376 DP rtsafe(void funcd(const DP, DP &, DP &), const DP x1, const DP x2,
00377         const DP xacc);
00378 DP rtsec(DP func(const DP), const DP x1, const DP x2, const DP xacc);
00379 void rzextr(const int iest, const DP xest, Vec_I_DP &yest, Vec_O_DP &yz,
00380         Vec_O_DP &dy);
00381 void savgol(Vec_O_DP &c, const int np, const int nl, const int nr,
00382         const int ld, const int m);
00383 void scrsho(DP fx(const DP));
00384 DP select(const int k, Vec_IO_DP &arr);
00385 DP selip(const int k, Vec_I_DP &arr);
00386 void shell(const int n, Vec_IO_DP &a);
00387 void shoot(Vec_I_DP &v, Vec_O_DP &f);
00388 void shootf(Vec_I_DP &v, Vec_O_DP &f);
00389 void simp1(Mat_I_DP &a, const int mm, Vec_I_INT &ll, const int nll,
00390         const int iabf, int &kp, DP &bmax);
00391 void simp2(Mat_I_DP &a, const int m, const int n, int &ip, const int kp);
00392 void simp3(Mat_IO_DP &a, const int i1, const int k1, const int ip,
00393         const int kp);
00394 void simplx(Mat_IO_DP &a, const int m1, const int m2, const int m3,
00395         int &icase, Vec_O_INT &izrov, Vec_O_INT &iposv);
00396 void simpr(Vec_I_DP &y, Vec_I_DP &dydx, Vec_I_DP &dfdx, Mat_I_DP &dfdy,
00397         const DP xs, const DP htot, const int nstep, Vec_O_DP &yout,
00398         void derivs(const DP, Vec_I_DP &, Vec_O_DP &));
00399 void sinft(Vec_IO_DP &y);
00400 void slvsm2(Mat_O_DP &u, Mat_I_DP &rhs);
00401 void slvsml(Mat_O_DP &u, Mat_I_DP &rhs);
00402 void sncndn(const DP uu, const DP emmc, DP &sn, DP &cn, DP &dn);
00403 DP snrm(Vec_I_DP &sx, const int itol);
00404 void sobseq(const int n, Vec_O_DP &x);
00405 void solvde(const int itmax, const DP conv, const DP slowc,
00406         Vec_I_DP &scalv, Vec_I_INT &indexv, const int nb, Mat_IO_DP &y);
00407 void sor(Mat_I_DP &a, Mat_I_DP &b, Mat_I_DP &c, Mat_I_DP &d, Mat_I_DP &e,
00408         Mat_I_DP &f, Mat_IO_DP &u, const DP rjac);
00409 void sort(Vec_IO_DP &arr);
00410 void sort2(Vec_IO_DP &arr, Vec_IO_DP &brr);
00411 void sort3(Vec_IO_DP &ra, Vec_IO_DP &rb, Vec_IO_DP &rc);
00412 void spctrm(ifstream &fp, Vec_O_DP &p, const int k, const bool ovrlap);
00413 void spear(Vec_I_DP &data1, Vec_I_DP &data2, DP &d, DP &zd, DP &probd,
00414         DP &rs, DP &probrs);
00415 void sphbes(const int n, const DP x, DP &sj, DP &sy, DP &sjp, DP &syp);
00416 void splie2(Vec_I_DP &x1a, Vec_I_DP &x2a, Mat_I_DP &ya, Mat_O_DP &y2a);
00417 void splin2(Vec_I_DP &x1a, Vec_I_DP &x2a, Mat_I_DP &ya, Mat_I_DP &y2a,
00418         const DP x1, const DP x2, DP &y);
00419 void spline(Vec_I_DP &x, Vec_I_DP &y, const DP yp1, const DP ypn,
00420         Vec_O_DP &y2);
00421 void splint(Vec_I_DP &xa, Vec_I_DP &ya, Vec_I_DP &y2a, const DP x, DP &y);
00422 void spread(const DP y, Vec_IO_DP &yy, const DP x, const int m);
00423 void sprsax(Vec_I_DP &sa, Vec_I_INT &ija, Vec_I_DP &x, Vec_O_DP &b);
00424 void sprsin(Mat_I_DP &a, const DP thresh, Vec_O_DP &sa, Vec_O_INT &ija);
00425 void sprspm(Vec_I_DP &sa, Vec_I_INT &ija, Vec_I_DP &sb, Vec_I_INT &ijb,
00426         Vec_O_DP &sc, Vec_I_INT &ijc);
00427 void sprstm(Vec_I_DP &sa, Vec_I_INT &ija, Vec_I_DP &sb, Vec_I_INT &ijb,
00428         const DP thresh, Vec_O_DP &sc, Vec_O_INT &ijc);
00429 void sprstp(Vec_I_DP &sa, Vec_I_INT &ija, Vec_O_DP &sb, Vec_O_INT &ijb);
00430 void sprstx(Vec_I_DP &sa, Vec_I_INT &ija, Vec_I_DP &x, Vec_O_DP &b);
00431 void stifbs(Vec_IO_DP &y, Vec_IO_DP &dydx, DP &xx, const DP htry,
00432         const DP eps, Vec_I_DP &yscal, DP &hdid, DP &hnext,
00433         void derivs(const DP, Vec_I_DP &, Vec_O_DP &));
00434 void stiff(Vec_IO_DP &y, Vec_IO_DP &dydx, DP &x, const DP htry,
00435         const DP eps, Vec_I_DP &yscal, DP &hdid, DP &hnext,
00436         void derivs(const DP, Vec_I_DP &, Vec_O_DP &));
00437 void stoerm(Vec_I_DP &y, Vec_I_DP &d2y, const DP xs,
00438         const DP htot, const int nstep, Vec_O_DP &yout,
00439         void derivs(const DP, Vec_I_DP &, Vec_O_DP &));
00440 void svbksb(Mat_I_DP &u, Vec_I_DP &w, Mat_I_DP &v, Vec_I_DP &b, Vec_O_DP &x);
00441 void svdcmp(Mat_IO_DP &a, Vec_O_DP &w, Mat_O_DP &v);
00442 void svdfit(Vec_I_DP &x, Vec_I_DP &y, Vec_I_DP &sig, Vec_O_DP &a,
00443         Mat_O_DP &u, Mat_O_DP &v, Vec_O_DP &w, DP &chisq,
00444         void funcs(const DP, Vec_O_DP &));
00445 void svdvar(Mat_I_DP &v, Vec_I_DP &w, Mat_O_DP &cvm);
00446 void toeplz(Vec_I_DP &r, Vec_O_DP &x, Vec_I_DP &y);
00447 void tptest(Vec_I_DP &data1, Vec_I_DP &data2, DP &t, DP &prob);
00448 void tqli(Vec_IO_DP &d, Vec_IO_DP &e, Mat_IO_DP &z);
00449 DP trapzd(DP func(const DP), const DP a, const DP b, const int n);
00450 void tred2(Mat_IO_DP &a, Vec_O_DP &d, Vec_O_DP &e);
00451 void tridag(Vec_I_DP &a, Vec_I_DP &b, Vec_I_DP &c, Vec_I_DP &r, Vec_O_DP &u);
00452 DP trncst(Vec_I_DP &x, Vec_I_DP &y, Vec_I_INT &iorder, Vec_IO_INT &n);
00453 void trnspt(Vec_IO_INT &iorder, Vec_I_INT &n);
00454 void ttest(Vec_I_DP &data1, Vec_I_DP &data2, DP &t, DP &prob);
00455 void tutest(Vec_I_DP &data1, Vec_I_DP &data2, DP &t, DP &prob);
00456 void twofft(Vec_I_DP &data1, Vec_I_DP &data2, Vec_O_DP &fft1,
00457         Vec_O_DP &fft2);
00458 void vander(Vec_I_DP &x, Vec_O_DP &w, Vec_I_DP &q);
00459 void vegas(Vec_I_DP &regn, DP fxn(Vec_I_DP &, const DP), const int init,
00460         const int ncall, const int itmx, const int nprn, DP &tgral, DP &sd,
00461         DP &chi2a);
00462 void voltra(const DP t0, const DP h, Vec_O_DP &t, Mat_O_DP &f,
00463         DP g(const int, const DP),
00464         DP ak(const int, const int, const DP, const DP));
00465 void wt1(Vec_IO_DP &a, const int isign,
00466         void wtstep(Vec_IO_DP &, const int, const int));
00467 void wtn(Vec_IO_DP &a, Vec_I_INT &nn, const int isign,
00468         void wtstep(Vec_IO_DP &, const int, const int));
00469 void wwghts(Vec_O_DP &wghts, const DP h,
00470         void kermom(Vec_O_DP &w, const DP y));
00471 bool zbrac(DP func(const DP), DP &x1, DP &x2);
00472 void zbrak(DP fx(const DP), const DP x1, const DP x2, const int n,
00473         Vec_O_DP &xb1, Vec_O_DP &xb2, int &nroot);
00474 DP zbrent(DP func(const DP), const DP x1, const DP x2, const DP tol);
00475 void zrhqr(Vec_I_DP &a, Vec_O_CPLX_DP &rt);
00476 DP zriddr(DP func(const DP), const DP x1, const DP x2, const DP xacc);
00477 void zroots(Vec_I_CPLX_DP &a, Vec_O_CPLX_DP &roots, const bool &polish);
00478 }
00479 #endif /* _NR_H_ */


tensor_field_nav_core
Author(s): Lintao Zheng, Kai Xu
autogenerated on Thu Jun 6 2019 19:50:56