numeric-prelude-0.4.3: An experimental alternative hierarchy of numeric type classes

Maintainer numericprelude@henning-thielemann.de provisional requires multi-parameter type classes None Haskell98

Algebra.ModuleBasis

Description

Abstraction of bases of finite dimensional modules

Synopsis

# Documentation

class C a v => C a v where Source #

It must hold:

  Module.linearComb (flatten v asTypeOf [a]) (basis a) == v
dimension a v == length (flatten v asTypeOf [a])

Minimal complete definition

Methods

basis :: a -> [v] Source #

basis of the module with respect to the scalar type, the result must be independent of argument, undefined should suffice.

flatten :: v -> [a] Source #

scale a vector by a scalar

dimension :: a -> v -> Int Source #

the size of the basis, should also work for undefined argument, the result must be independent of argument, undefined should suffice.

Instances

 Source # Methodsbasis :: Double -> [Double] Source #flatten :: Double -> [Double] Source # Source # Methodsbasis :: Float -> [Float] Source #flatten :: Float -> [Float] Source # Source # Methodsbasis :: Int -> [Int] Source #flatten :: Int -> [Int] Source # Source # Methodsbasis :: Integer -> [Integer] Source #flatten :: Integer -> [Integer] Source # (C a v0, C a v1) => C a (v0, v1) Source # Methodsbasis :: a -> [(v0, v1)] Source #flatten :: (v0, v1) -> [a] Source #dimension :: a -> (v0, v1) -> Int Source # (C a v0, C a v1, C a v2) => C a (v0, v1, v2) Source # Methodsbasis :: a -> [(v0, v1, v2)] Source #flatten :: (v0, v1, v2) -> [a] Source #dimension :: a -> (v0, v1, v2) -> Int Source # C a => C (T a) (T a) Source # Methodsbasis :: T a -> [T a] Source #flatten :: T a -> [T a] Source #dimension :: T a -> T a -> Int Source #

# Properties

propFlatten :: (Eq v, C a v) => a -> v -> Bool Source #

propDimension :: C a v => a -> v -> Bool Source #