product-mix-auction-0.1.0.0: A single-round sealed-bid auction for multiple goods

Safe HaskellNone
LanguageHaskell2010

ProductMixAuction.BudgetConstraints.Intersect

Description

Exhaustive auction rates search through hyperplane intersections

Synopsis

Documentation

allCandidateRates :: Eq b => AuctionKind -> [Bid b] -> Set PriceVector Source #

Return all the candidate auction rates for the given bids.

allIntersections :: Eq b => AuctionKind -> Int -> [GoodPrice b] -> [Vector Double] Source #

Given all the (i, p_i) pairs of good number and price, compute the resulting hyperplanes (both hods and flanges) and find all the intersections of all choices of n of them.

allHyperplanes :: Eq b => [GoodPrice b] -> [HyperplaneType b] Source #

Return all the hyperplanes generated by the given list of (i, p_i) pairs, both hods and flanges.

The resulting list will then be used to pick dim hyperplanes at a time and consider their intersection by solving the corresponding linear system.

allIntersectionSystems :: AuctionKind -> Int -> [HyperplaneType b] -> [(Matrix Double, Vector Double)] Source #

Generate all the linear systems resulting from the intersection of the given number of hyperplanes taken from the given list.

solveSystems :: [(Matrix Double, Vector Double)] -> [Vector Double] Source #

map '(<>)' over the given systems to get solutions

roundPoints :: AuctionKind -> [Vector Double] -> [Vector Double] Source #

For standard auctions, all intersections should be non-negative integers, so round the points appropriately and remove any that are negative.

For budget-constrained auctions, remove points that are too close to each other, and round extremely small values to zero.

approxZeros :: [Vector Double] -> [Vector Double] Source #

Replace any extremely small value with a genuine zero.

removeSimilarPoints :: [Vector Double] -> [Vector Double] Source #

Rounding error may result in multiple points that are very close together, so we remove all but one point in each case.

select :: Int -> [a] -> [[a]] Source #

select n xs returns all the possible combinations of n elements of xs, modulo permutations (it doesn't return [1,2] and [2, 1] but rather just one of them, as in our case we don't care in which order we put the hyperplane in the matrix, the system is equivalent whatever the "order of the equations" is).

data Hyperplane Source #

H as b corresponds to the hyperplane with equation a_0*x_0 + ... + a_(n-1)*x_(n-1) = b.

Constructors

H (Vector Double) Double 

hyperplanesSystem :: [Hyperplane] -> (Matrix Double, Vector Double) Source #

Return (A, b) where Ax = b is the linear system corresponding to the intersection of all the given hyperplanes.

data GoodPrice b Source #

(i, p_i) pair

Constructors

P !Int !Double b 

Instances

Eq b => Eq (GoodPrice b) Source # 

Methods

(==) :: GoodPrice b -> GoodPrice b -> Bool #

(/=) :: GoodPrice b -> GoodPrice b -> Bool #

Show b => Show (GoodPrice b) Source # 

data HyperplaneType b Source #

Hod i p corresponds to the hyperplane with equation x_i = p.

Flange i p_i j p_j corresponds to the hyperplane with equation x_ip_i = x_jp_j (for budget-constrained auctions), or x_i-p_i = x_j-p_j (for standard auctions).

Constructors

Hod !(GoodPrice b) 
Flange !(GoodPrice b) !(GoodPrice b) 

toHyperplane :: AuctionKind -> Int -> HyperplaneType b -> Hyperplane Source #

Build a Hyperplane of the given type in a space of the given dimension.

epsilon :: RealFloat a => a Source #

A very small floating point. < epsilon will be used instead of == 0.