From f2cf177e93d4578b404909c68b24625a76466ee5 Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Sat, 9 Jun 2007 16:29:46 +0000 Subject: eigC --- lib/LAPACK/Internal.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/LAPACK/Internal.hs') diff --git a/lib/LAPACK/Internal.hs b/lib/LAPACK/Internal.hs index e39dd10..e3c9927 100644 --- a/lib/LAPACK/Internal.hs +++ b/lib/LAPACK/Internal.hs @@ -76,7 +76,9 @@ foreign import ccall "lapack-aux.h eig_l_C" -- The eigenvectors are the columns of v. -- The eigenvalues are not sorted. eigC :: Matrix (Complex Double) -> (Vector (Complex Double), Matrix (Complex Double)) -eigC (m@M {rows = r}) = unsafePerformIO $ do +eigC (m@M {rows = r}) + | r == 1 = (fromList [cdat m `at` 0], singleton 1) + | otherwise = unsafePerformIO $ do l <- createVector r v <- createMatrix ColumnMajor r r dummy <- createMatrix ColumnMajor 1 1 -- cgit v1.2.3