diff options
author | Gael Guennebaud <g.gael@free.fr> | 2010-11-19 17:22:43 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2010-11-19 17:22:43 +0100 |
commit | 8ad1f64e0a1f2ff8ee440fa16e321e33b0e89e29 (patch) | |
tree | 88f00250d8fb9907c0c06c6ff221a1d1c4e8c388 /blas/common.h | |
parent | 94f59a92cbab3fc3c59d2352a4e127961bad5aaa (diff) |
some cleaning in blas level 2
Diffstat (limited to 'blas/common.h')
-rw-r--r-- | blas/common.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/blas/common.h b/blas/common.h index 9eaca2c2f..290ae112a 100644 --- a/blas/common.h +++ b/blas/common.h @@ -140,6 +140,17 @@ T* get_compact_vector(T* x, int n, int incx) return ret; } +template<typename T> +T* copy_back(T* x_cpy, T* x, int n, int incx) +{ + if(x_cpy==x) + return 0; + + if(incx<0) vector(x,n,-incx).reverse() = vector(x_cpy,n); + else vector(x,n, incx) = vector(x_cpy,n); + return x_cpy; +} + #define EIGEN_BLAS_FUNC(X) EIGEN_CAT(SCALAR_SUFFIX,X##_) #endif // EIGEN_BLAS_COMMON_H |