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