Safe Haskell | None |
---|---|
Language | Haskell2010 |
ProductMixAuction.LinearAlgebra
Contents
- type Dimension = Int
- class ComponentWise f where
- isZero :: (Foldable f, Eq a, Num a) => f a -> Bool
- zero :: (Num (Item (f a)), IsList (f a)) => Dimension -> f a
- ones :: (Num (Item (f a)), IsList (f a)) => Dimension -> f a
- vplus :: (Num a, ComponentWise f) => f a -> f a -> f a
- (<+>) :: (Num a, ComponentWise f) => f a -> f a -> f a
- vminus :: (Num a, ComponentWise f) => f a -> f a -> f a
- (<->) :: (Num a, ComponentWise f) => f a -> f a -> f a
- (<.>) :: (Num a, ComponentWise f) => f a -> f a -> f a
- vmax :: (Ord a, ComponentWise f) => f a -> f a -> f a
- vmin :: (Ord a, ComponentWise f) => f a -> f a -> f a
- vscale :: (Functor f, Num a) => a -> f a -> f a
- vlte :: (Ord a, Functor f, ComponentWise f, Foldable f) => f a -> f a -> Bool
- dot :: (Num a, Functor f, ComponentWise f, Foldable f) => f a -> f a -> a
- dotBy :: (Num c, Functor f, ComponentWise f, Foldable f) => (a -> b -> c) -> f a -> f b -> c
- dot1 :: Num a => Vector a -> a
Types
class ComponentWise f where Source #
Minimal complete definition
Methods
componentWise :: (a -> b -> c) -> f a -> f b -> f c Source #
Instances
ComponentWise [] Source # | |
ComponentWise Vector Source # | |
Linear algebra
isZero :: (Foldable f, Eq a, Num a) => f a -> Bool Source #
Check whether a vector is a zero vector (all components are exactly 0)
ones :: (Num (Item (f a)), IsList (f a)) => Dimension -> f a Source #
A vector where all elements are 1
vplus :: (Num a, ComponentWise f) => f a -> f a -> f a Source #
Addition of vectors, pointwise.
(<+>) :: (Num a, ComponentWise f) => f a -> f a -> f a Source #
Addition of vectors, pointwise (operator alias for vplus
)
vminus :: (Num a, ComponentWise f) => f a -> f a -> f a Source #
Subtraction of vectors, pointwise.
(<->) :: (Num a, ComponentWise f) => f a -> f a -> f a Source #
Subtraction of vectors, pointwise (operator alias for vminus
)
(<.>) :: (Num a, ComponentWise f) => f a -> f a -> f a Source #
Multiplication of vectors, pointwise.
vmax :: (Ord a, ComponentWise f) => f a -> f a -> f a Source #
Component-wise max
vmin :: (Ord a, ComponentWise f) => f a -> f a -> f a Source #
Component-wise min
vlte :: (Ord a, Functor f, ComponentWise f, Foldable f) => f a -> f a -> Bool Source #
Vector-less-than-or-equal: <= operator for vectors under Euclidean order as described in the paper "Valid Combinations of Bids" (Baldwin, Goldberg & Klemperer, validBids.pdf), section 1.1
Note that this is a partial ordering, so a
does not imply vlte
bnot (a
, nor does vlte
b)a
imply vlte
b && b vlte
aa == b
.