summaryrefslogtreecommitdiff
path: root/examples/experiments/useStatic.hs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/experiments/useStatic.hs')
-rw-r--r--examples/experiments/useStatic.hs36
1 files changed, 36 insertions, 0 deletions
diff --git a/examples/experiments/useStatic.hs b/examples/experiments/useStatic.hs
new file mode 100644
index 0000000..619af8f
--- /dev/null
+++ b/examples/experiments/useStatic.hs
@@ -0,0 +1,36 @@
1{-# OPTIONS -fno-monomorphism-restriction #-}
2
3import Static
4import Numeric.LinearAlgebra
5
6
7x = $(vec [1,2])
8
9y = $(vec [5,7])
10
11z a = vec [a,a]
12
13w = $(vec [1,2,3])
14
15cx = $(covec [1,2,3])
16
17
18t3 = $(tdim 3)
19
20crm33 = createml t3 t3 3 3
21
22rot a = crm33 [a,0,0,0,a,0,0,0,1]
23
24--q = x |+| y |+| $(z 5)
25
26m = $(mat 2 3 [1..6])
27
28n = $(mat 3 5 [1..15])
29
30infixl 7 <*>
31(<*>) = prod
32
33r1 = m <*> n
34r2 = strans (strans n <*> strans m)
35
36--r' = prod n m