#include #include "nr.h" using namespace std; void usrfun(Vec_I_DP &x, Vec_O_DP &fvec, Mat_O_DP &fjac); void NR::mnewt(const int ntrial, Vec_IO_DP &x, const DP tolx, const DP tolf) { int k,i; DP errx,errf,d; int n=x.size(); Vec_INT indx(n); Vec_DP p(n),fvec(n); Mat_DP fjac(n,n); for (k=0;k