From d925bada507562250a75587c409bdb35bbbc6ed8 Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Mon, 1 Oct 2007 18:52:46 +0000 Subject: misc examples --- examples/usaStatic.hs | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 examples/usaStatic.hs (limited to 'examples/usaStatic.hs') 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 @@ +{-# OPTIONS -fno-monomorphism-restriction #-} + +import Static +import Numeric.LinearAlgebra + + +x = $(vec [1,2]) + +y = $(vec [5,7]) + +z a = vec [a,a] + +w = $(vec [1,2,3]) + +cx = $(covec [1,2,3]) + + +t3 = $(tdim 3) + +crm33 = createml t3 t3 3 3 + +rot a = crm33 [a,0,0,0,a,0,0,0,1] + +--q = x |+| y |+| $(z 5) + +m = $(mat 2 3 [1..6]) + +n = $(mat 3 5 [1..15]) + +infixl 7 <*> +(<*>) = prod + +r1 = m <*> n +r2 = strans (strans n <*> strans m) + +--r' = prod n m -- cgit v1.2.3