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

Maintainernumericprelude@henning-thielemann.de
Stabilityprovisional
Portabilityrequires multi-parameter type classes
Safe HaskellNone
LanguageHaskell98

Algebra.ModuleBasis

Contents

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])

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
C Double Double Source # 
Instance details

Defined in Algebra.ModuleBasis

C Float Float Source # 
Instance details

Defined in Algebra.ModuleBasis

C Int Int Source # 
Instance details

Defined in Algebra.ModuleBasis

Methods

basis :: Int -> [Int] Source #

flatten :: Int -> [Int] Source #

dimension :: Int -> Int -> Int Source #

C Integer Integer Source # 
Instance details

Defined in Algebra.ModuleBasis

(C a v0, C a v1) => C a (v0, v1) Source # 
Instance details

Defined in Algebra.ModuleBasis

Methods

basis :: 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 # 
Instance details

Defined in Algebra.ModuleBasis

Methods

basis :: 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 # 
Instance details

Defined in Algebra.ModuleBasis

Methods

basis :: T a -> [T a] Source #

flatten :: T a -> [T a] Source #

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

Instances for atomic types

Instances for composed types

Properties

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

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