From 073f9c09d19e26db5205ac16235a054509ea197b Mon Sep 17 00:00:00 2001 From: jiri Date: Fri, 7 Apr 2006 20:47:38 +0000 Subject: [PATCH] *** empty log message *** --- nonclass.cc | 1 - nonclass.h | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/nonclass.cc b/nonclass.cc index b4242fb..37a7ddd 100644 --- a/nonclass.cc +++ b/nonclass.cc @@ -878,4 +878,3 @@ if(nchange&1)//still adjust to get determinant=1 } } - diff --git a/nonclass.h b/nonclass.h index 93ddd0a..d659244 100644 --- a/nonclass.h +++ b/nonclass.h @@ -182,5 +182,32 @@ T abssqr(const complex &x) return x.real()*x.real()+x.imag()*x.imag(); } +//declaration of template interface to cblas routines with full options available +//just to facilitate easy change between float, double, complex in a user code +//very incomplete, add new ones as needed +template inline void xcopy(int n, const T *x, int incx, T *y, int incy); +template inline void xaxpy(int n, const T &a, const T *x, int incx, T *y, int incy); +template inline T xdot(int n, const T *x, int incx, const T *y, int incy); + +//specialized definitions have to be in the header file to be inlineable, eliminating any runtime overhead + +template<> +inline void xcopy (int n, const double *x, int incx, double *y, int incy) +{ +cblas_dcopy(n, x, incx, y, incy); +} + +template<> +inline void xaxpy(int n, const double &a, const double *x, int incx, double *y, int incy) +{ +cblas_daxpy(n, a, x, incx, y, incy); +} + +template<> +inline double xdot(int n, const double *x, int incx, const double *y, int incy) +{ +return cblas_ddot(n,x,incx,y,incy); +} + #endif