From b69fa7ed53d52e812afd27547f4f63e74cfe5527 Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Fri, 14 Nov 2008 12:24:15 +0000 Subject: conj using mapVector --- lib/Data/Packed/Internal/Matrix.hs | 7 +------ lib/Data/Packed/Internal/auxi.c | 12 ------------ lib/Data/Packed/Internal/auxi.h | 2 -- 3 files changed, 1 insertion(+), 20 deletions(-) (limited to 'lib/Data/Packed/Internal') diff --git a/lib/Data/Packed/Internal/Matrix.hs b/lib/Data/Packed/Internal/Matrix.hs index 09f081a..44204a1 100644 --- a/lib/Data/Packed/Internal/Matrix.hs +++ b/lib/Data/Packed/Internal/Matrix.hs @@ -297,12 +297,7 @@ subMatrix = subMatrixD -- | obtains the complex conjugate of a complex vector conj :: Vector (Complex Double) -> Vector (Complex Double) -conj v = unsafePerformIO $ do - r <- createVector (dim v) - app2 cconjugate vec v vec r "cconjugate" - return r -foreign import ccall "auxi.h conjugate" cconjugate :: TCVCV - +conj = mapVector conjugate -- | creates a complex vector from vectors with real and imaginary parts toComplex :: (Vector Double, Vector Double) -> Vector (Complex Double) diff --git a/lib/Data/Packed/Internal/auxi.c b/lib/Data/Packed/Internal/auxi.c index 562c804..5c06cb6 100644 --- a/lib/Data/Packed/Internal/auxi.c +++ b/lib/Data/Packed/Internal/auxi.c @@ -64,18 +64,6 @@ int submatrixR(int r1, int r2, int c1, int c2, KRMAT(x),RMAT(r)) { OK } - -int conjugate(KCVEC(x),CVEC(t)) { - REQUIRES(xn==tn,BAD_SIZE); - DEBUGMSG("conjugate"); - int k; - for (k=0; k