summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2008-11-14 12:24:15 +0000
committerAlberto Ruiz <aruiz@um.es>2008-11-14 12:24:15 +0000
commitb69fa7ed53d52e812afd27547f4f63e74cfe5527 (patch)
treefbac193293d425361e491760d0cfe8d2839d5533 /lib
parente1b4cc06a5f98e576524b37ad0d9132f0678d722 (diff)
conj using mapVector
Diffstat (limited to 'lib')
-rw-r--r--lib/Data/Packed/Internal/Matrix.hs7
-rw-r--r--lib/Data/Packed/Internal/auxi.c12
-rw-r--r--lib/Data/Packed/Internal/auxi.h2
3 files changed, 1 insertions, 20 deletions
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
297 297
298-- | obtains the complex conjugate of a complex vector 298-- | obtains the complex conjugate of a complex vector
299conj :: Vector (Complex Double) -> Vector (Complex Double) 299conj :: Vector (Complex Double) -> Vector (Complex Double)
300conj v = unsafePerformIO $ do 300conj = mapVector conjugate
301 r <- createVector (dim v)
302 app2 cconjugate vec v vec r "cconjugate"
303 return r
304foreign import ccall "auxi.h conjugate" cconjugate :: TCVCV
305
306 301
307-- | creates a complex vector from vectors with real and imaginary parts 302-- | creates a complex vector from vectors with real and imaginary parts
308toComplex :: (Vector Double, Vector Double) -> Vector (Complex Double) 303toComplex :: (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)) {
64 OK 64 OK
65} 65}
66 66
67
68int conjugate(KCVEC(x),CVEC(t)) {
69 REQUIRES(xn==tn,BAD_SIZE);
70 DEBUGMSG("conjugate");
71 int k;
72 for (k=0; k<xn; k++) {
73 tp[k].dat[0] = xp[k].dat[0];
74 tp[k].dat[1] = - xp[k].dat[1];
75 }
76 OK
77}
78
79//--------------------------------------- 67//---------------------------------------
80void asm_finit() { 68void asm_finit() {
81 asm("finit"); 69 asm("finit");
diff --git a/lib/Data/Packed/Internal/auxi.h b/lib/Data/Packed/Internal/auxi.h
index e5370b4..c234ef5 100644
--- a/lib/Data/Packed/Internal/auxi.h
+++ b/lib/Data/Packed/Internal/auxi.h
@@ -16,6 +16,4 @@ const char * gsl_strerror (const int gsl_errno);
16 16
17int matrix_fscanf(char*filename, RMAT(a)); 17int matrix_fscanf(char*filename, RMAT(a));
18 18
19int conjugate(KCVEC(x),CVEC(t));
20
21void asm_finit(); 19void asm_finit();