summaryrefslogtreecommitdiff
path: root/packages/base/src/Numeric/Complex.hs
diff options
context:
space:
mode:
Diffstat (limited to 'packages/base/src/Numeric/Complex.hs')
-rw-r--r--packages/base/src/Numeric/Complex.hs72
1 files changed, 0 insertions, 72 deletions
diff --git a/packages/base/src/Numeric/Complex.hs b/packages/base/src/Numeric/Complex.hs
deleted file mode 100644
index d194af3..0000000
--- a/packages/base/src/Numeric/Complex.hs
+++ /dev/null
@@ -1,72 +0,0 @@
1{-# LANGUAGE DataKinds #-}
2{-# LANGUAGE KindSignatures #-}
3{-# LANGUAGE GeneralizedNewtypeDeriving #-}
4{-# LANGUAGE MultiParamTypeClasses #-}
5{-# LANGUAGE FunctionalDependencies #-}
6{-# LANGUAGE FlexibleContexts #-}
7{-# LANGUAGE ScopedTypeVariables #-}
8{-# LANGUAGE EmptyDataDecls #-}
9{-# LANGUAGE Rank2Types #-}
10{-# LANGUAGE FlexibleInstances #-}
11{-# LANGUAGE TypeOperators #-}
12{-# LANGUAGE ViewPatterns #-}
13{-# LANGUAGE GADTs #-}
14
15
16{- |
17Module : Numeric.HMatrix.Static.Complex
18Copyright : (c) Alberto Ruiz 2006-14
19License : BSD3
20Stability : experimental
21
22-}
23
24module Numeric.Complex(
25 C, M,
26 vec2, vec3, vec4, (&), (#),
27 vect,
28 Her, her, 𝑖,
29) where
30
31import GHC.TypeLits
32import Numeric.LinearAlgebra.Util(ℂ,iC)
33import qualified Numeric.LinearAlgebra.HMatrix as LA
34import Numeric.LinearAlgebra.Static
35
36
37𝑖 :: Sized ℂ s c => s
38𝑖 = konst iC
39
40newtype Her n = Her (M n n)
41
42her :: KnownNat n => M n n -> Her n
43her m = Her $ (m + LA.tr m)/2
44
45
46
47
48infixl 4 &
49(&) :: forall n . KnownNat n
50 => C n -> ℂ -> C (n+1)
51u & x = u # (mkC (LA.scalar x) :: C 1)
52
53infixl 4 #
54(#) :: forall n m . (KnownNat n, KnownNat m)
55 => C n -> C m -> C (n+m)
56(C u) # (C v) = C (vconcat u v)
57
58
59
60vec2 :: ℂ -> ℂ -> C 2
61vec2 a b = C (gvec2 a b)
62
63vec3 :: ℂ -> ℂ -> ℂ -> C 3
64vec3 a b c = C (gvec3 a b c)
65
66
67vec4 :: ℂ -> ℂ -> ℂ -> ℂ -> C 4
68vec4 a b c d = C (gvec4 a b c d)
69
70vect :: forall n . KnownNat n => [ℂ] -> C n
71vect xs = C (gvect "C" xs)
72