//////////////////////////////////////////////////////////////////////////// //traits classes #ifndef _LA_TRAITS_INCL #define _LA_TRAITS_INCL //default one, good for numbers template struct NRMat_traits { typedef C elementtype; typedef C producttype; static C norm (const C &x) {return abs(x);} static void axpy (C &s, const C &x, const C &c) {s+=x*c;} }; //specializations template<> struct NRMat_traits > { typedef double elementtype; typedef NRMat producttype; static double norm (const NRMat &x) {return x.norm();} static void axpy (NRMat&s, const NRMat &x, const double c) {s.axpy(c,x);} }; template<> struct NRMat_traits > { typedef double elementtype; typedef NRMat producttype; static const double norm (const NRSMat &x) {return x.norm(0.);} static void axpy (NRSMat&s, const NRSMat &x, const double c) {s.axpy(c,x);} }; template<> struct NRMat_traits > > { typedef complex elementtype; typedef NRMat > producttype; static double norm (const NRMat > &x) {return x.norm();} static void axpy (NRMat >&s, const NRMat > &x, const complex c) {s.axpy(c,x);} }; #endif