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

Copyright(c) Dylan Thurston Henning Thielemann 2004-2005
Maintainernumericprelude@henning-thielemann.de
Stabilityprovisional
Portabilityrequires multi-parameter type classes
Safe HaskellNone
LanguageHaskell98

Algebra.Module

Contents

Description

Abstraction of modules

Synopsis

Documentation

class (C a, C v) => C a v where Source #

A Module over a ring satisfies:

  a *> (b + c) === a *> b + a *> c
  (a * b) *> c === a *> (b *> c)
  (a + b) *> c === a *> c + b *> c

Minimal complete definition

(*>)

Methods

(*>) :: a -> v -> v infixr 7 Source #

scale a vector by a scalar

Instances

C Double Double Source # 

Methods

(*>) :: Double -> Double -> Double Source #

C Float Float Source # 

Methods

(*>) :: Float -> Float -> Float Source #

C Int Int Source # 

Methods

(*>) :: Int -> Int -> Int Source #

C Int8 Int8 Source # 

Methods

(*>) :: Int8 -> Int8 -> Int8 Source #

C Int16 Int16 Source # 

Methods

(*>) :: Int16 -> Int16 -> Int16 Source #

C Int32 Int32 Source # 

Methods

(*>) :: Int32 -> Int32 -> Int32 Source #

C Int64 Int64 Source # 

Methods

(*>) :: Int64 -> Int64 -> Int64 Source #

C Integer Integer Source # 
C T T Source # 

Methods

(*>) :: T -> T -> T Source #

C a => C Integer (T a) Source # 

Methods

(*>) :: Integer -> T a -> T a Source #

(C a b, RealFloat b) => C a (Complex b) Source # 

Methods

(*>) :: a -> Complex b -> Complex b Source #

C a v => C a [v] Source # 

Methods

(*>) :: a -> [v] -> [v] Source #

C a b => C a (T b) Source # 

Methods

(*>) :: a -> T b -> T b Source #

C a b => C a (T b) Source # 

Methods

(*>) :: a -> T b -> T b Source #

(C a v, C v) => C a (T v) Source # 

Methods

(*>) :: a -> T v -> T v Source #

C a b => C a (T b) Source # 

Methods

(*>) :: a -> T b -> T b Source #

C a b => C a (T b) Source #

The '(*>)' method can't replace scale because it requires the Algebra.Module constraint

Methods

(*>) :: a -> T b -> T b Source #

C a b => C a (T b) Source #

The '(*>)' method can't replace scale because it requires the Algebra.Module constraint

Methods

(*>) :: a -> T b -> T b Source #

C a b => C a (T b) Source # 

Methods

(*>) :: a -> T b -> T b Source #

C a v => C a (c -> v) Source # 

Methods

(*>) :: a -> (c -> v) -> c -> v Source #

(C a b0, C a b1) => C a (b0, b1) Source # 

Methods

(*>) :: a -> (b0, b1) -> (b0, b1) Source #

(C u, C a b) => C a (T u b) Source # 

Methods

(*>) :: a -> T u b -> T u b Source #

(Ord i, C a v) => C a (T i v) Source # 

Methods

(*>) :: a -> T i v -> T i v Source #

C a v => C a (T b v) Source # 

Methods

(*>) :: a -> T b v -> T b v Source #

(C a b0, C a b1, C a b2) => C a (b0, b1, b2) Source # 

Methods

(*>) :: a -> (b0, b1, b2) -> (b0, b1, b2) Source #

C a => C (T a) (T a) Source # 

Methods

(*>) :: T a -> T a -> T a Source #

C a v => C (T a) (T v) Source # 

Methods

(*>) :: T a -> T v -> T v Source #

(<*>.*>) :: C a x => T (a, v) (x -> c) -> (v -> x) -> T (a, v) c Source #

Instances for atomic types

Instances for composed types

Related functions

linearComb :: C a v => [a] -> [v] -> v Source #

Compute the linear combination of a list of vectors.

ToDo: Should it use zipWith ?

integerMultiply :: (C a, C v) => a -> v -> v Source #

This function can be used to define any C as a module over Integer.

Better move to Algebra.Additive?

Properties

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

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

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