#include #include "nr.h" using namespace std; void NR::gaujac(Vec_O_DP &x, Vec_O_DP &w, const DP alf, const DP bet) { const int MAXIT=10; const DP EPS=1.0e-14; int i,its,j; DP alfbet,an,bn,r1,r2,r3; DP a,b,c,p1,p2,p3,pp,temp,z,z1; int n=x.size(); for (i=0;i MAXIT) nrerror("too many iterations in gaujac"); x[i]=z; w[i]=exp(gammln(alf+n)+gammln(bet+n)-gammln(n+1.0)- gammln(n+alfbet+1.0))*temp*pow(2.0,alfbet)/(pp*p2); } }