#include #include "nr.h" using namespace std; void NR::gaulag(Vec_O_DP &x, Vec_O_DP &w, const DP alf) { const int MAXIT=10; const DP EPS=1.0e-14; int i,its,j; DP ai,p1,p2,p3,pp,z,z1; int n=x.size(); for (i=0;i= MAXIT) nrerror("too many iterations in gaulag"); x[i]=z; w[i] = -exp(gammln(alf+n)-gammln(DP(n)))/(pp*n*p2); } }