From db223fb5f9cd4adef54736812f796b48ecc289e6 Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Wed, 31 Oct 2007 13:36:37 +0000 Subject: Field->Element, GenMat->Field --- lib/Numeric/LinearAlgebra/Linear.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/Numeric/LinearAlgebra/Linear.hs') diff --git a/lib/Numeric/LinearAlgebra/Linear.hs b/lib/Numeric/LinearAlgebra/Linear.hs index 94f6958..13d69ab 100644 --- a/lib/Numeric/LinearAlgebra/Linear.hs +++ b/lib/Numeric/LinearAlgebra/Linear.hs @@ -84,7 +84,7 @@ instance Linear Matrix (Complex Double) where -------------------------------------------------- -- | euclidean inner product -dot :: (Field t) => Vector t -> Vector t -> t +dot :: (Element t) => Vector t -> Vector t -> t dot u v = dat (multiply r c) `at` 0 where r = asRow u c = asColumn v @@ -98,7 +98,7 @@ dot u v = dat (multiply r c) `at` 0 , 10.0, 4.0, 6.0 , 15.0, 6.0, 9.0 ]@ -} -outer :: (Field t) => Vector t -> Vector t -> Matrix t +outer :: (Element t) => Vector t -> Vector t -> Matrix t outer u v = asColumn u `multiply` asRow v {- | Kronecker product of two matrices. @@ -123,7 +123,7 @@ m2=(4><3) , 0.0, 0.0, 0.0, -7.0, -8.0, -9.0, 21.0, 24.0, 27.0 , 0.0, 0.0, 0.0, -10.0, -11.0, -12.0, 30.0, 33.0, 36.0 ]@ -} -kronecker :: (Field t) => Matrix t -> Matrix t -> Matrix t +kronecker :: (Element t) => Matrix t -> Matrix t -> Matrix t kronecker a b = fromBlocks . partit (cols a) . map (reshape (cols b)) -- cgit v1.2.3