#include "seqspace.hh" #include "multop.hh" #include "cgnealg.hh" #include "terminator.hh" using namespace RVL; using namespace RVLAlg; using namespace RVLUmin; int main() { cout <<"Polynomial Division in l2 - computing least squares\n"; cout <<"polynomial approximation to 1/(1+ax) via CG.\n"; double a; cout <<"Enter coeff a of x: "; cin >> a; list alist; alist.push_back(1.0); alist.push_back(a); // cerr<<"op of multiplication by 1+x"< x(op.getDomain()); // cerr<<"vector in range"< b(op.getRange()); // cerr<<"assign to b the coeff list of the const poly 1"< blist; blist.push_back(1.0); AssignList initb(blist); b.eval(initb); // cerr<<"zero out x"<> nsteps; cout<<"Enter tolerance for norm of residual: "; cin >> tol; if (nsteps < 1) nsteps = 50; if (tol < 100*numeric_limits::epsilon()) tol = 100*numeric_limits::epsilon(); // cerr<<"create CG step"< cg(x,op,b,rnorm,nrnorm,tol,tol,nsteps); // cerr<<"run"<