diff --git a/matexp.h b/matexp.h index 03d3099..bb1ac8d 100644 --- a/matexp.h +++ b/matexp.h @@ -176,7 +176,7 @@ return int(ceil(log(n)/log2-log(.75))); template -NRVec exp_aux(const T &x, int &power,int maxpower= -1, int maxtaylor= -1, C prescale=1.) +NRVec exp_aux(const T &x, int &power,int maxpower= -1, int maxtaylor= -1, typename LA_traits::elementtype prescale=1.) { //should better be computed by mathematica to have accurate last digits, chebyshev instead, see exp in glibc static double exptaylor[]={ @@ -209,7 +209,7 @@ double scale=exp(-log(2.)*power); //find how long taylor expansion will be necessary -const double precision=1e-14; //decreasing brings nothing +const double precision=1e-14; //further decreasing brings nothing double s,t; s=mnorm*scale; int n=0; @@ -230,6 +230,8 @@ for(i=0,t=1.;i<=n;i++) taylor2[i]=exptaylor[i]*t; t*=scale; } +//cout <<"TEST power, scale "<::elementtype> taylor2=exp_aux::elementtype>(x,power,maxpower,maxtaylor); +NRVec::normtype> taylor2=exp_aux::normtype>(x,power,maxpower,maxtaylor); T r= horner?polynom0(x,taylor2):polynom(x,taylor2); @@ -267,7 +269,7 @@ if(mat.nrows()!=mat.ncols()||(unsigned int) mat.nrows() != (unsigned int)rhs.siz int power; //prepare the polynom of and effectively scale the matrix -NRVec::elementtype> taylor2=exp_aux::elementtype>(mat,power,maxpower,maxtaylor,scale); +NRVec::normtype> taylor2=exp_aux::normtype>(mat,power,maxpower,maxtaylor,scale); V tmp;