module Tetrahedron
where
+import qualified Data.Vector as V (
+ singleton,
+ snoc,
+ sum
+ )
import Numeric.LinearAlgebra hiding (i, scale)
import Prelude hiding (LT)
import Test.QuickCheck (Arbitrary(..), Gen, choose)
polynomial :: Tetrahedron -> (RealFunction Point)
polynomial t =
- sum [ (c t i j k l) `cmult` (beta t i j k l) | i <- [0..3],
- j <- [0..3],
- k <- [0..3],
- l <- [0..3],
- i + j + k + l == 3]
+ V.sum $ V.singleton ((c t 0 0 0 3) `cmult` (beta t 0 0 0 3)) `V.snoc`
+ ((c t 0 0 1 2) `cmult` (beta t 0 0 1 2)) `V.snoc`
+ ((c t 0 0 2 1) `cmult` (beta t 0 0 2 1)) `V.snoc`
+ ((c t 0 0 3 0) `cmult` (beta t 0 0 3 0)) `V.snoc`
+ ((c t 0 1 0 2) `cmult` (beta t 0 1 0 2)) `V.snoc`
+ ((c t 0 1 1 1) `cmult` (beta t 0 1 1 1)) `V.snoc`
+ ((c t 0 1 2 0) `cmult` (beta t 0 1 2 0)) `V.snoc`
+ ((c t 0 2 0 1) `cmult` (beta t 0 2 0 1)) `V.snoc`
+ ((c t 0 2 1 0) `cmult` (beta t 0 2 1 0)) `V.snoc`
+ ((c t 0 3 0 0) `cmult` (beta t 0 3 0 0)) `V.snoc`
+ ((c t 1 0 0 2) `cmult` (beta t 1 0 0 2)) `V.snoc`
+ ((c t 1 0 1 1) `cmult` (beta t 1 0 1 1)) `V.snoc`
+ ((c t 1 0 2 0) `cmult` (beta t 1 0 2 0)) `V.snoc`
+ ((c t 1 1 0 1) `cmult` (beta t 1 1 0 1)) `V.snoc`
+ ((c t 1 1 1 0) `cmult` (beta t 1 1 1 0)) `V.snoc`
+ ((c t 1 2 0 0) `cmult` (beta t 1 2 0 0)) `V.snoc`
+ ((c t 2 0 0 1) `cmult` (beta t 2 0 0 1)) `V.snoc`
+ ((c t 2 0 1 0) `cmult` (beta t 2 0 1 0)) `V.snoc`
+ ((c t 2 1 0 0) `cmult` (beta t 2 1 0 0)) `V.snoc`
+ ((c t 3 0 0 0) `cmult` (beta t 3 0 0 0))
-- | Returns the domain point of t with indices i,j,k,l.