Copyright | (c) Stéphane Laurent 2023-2024 |
---|---|
License | GPL-3 |
Maintainer | laurent_step@outlook.fr |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Enumeration of the vertices of a convex polytope given by linear inequalities. See README for an example.
Synopsis
- data Constraint a = Constraint (LinearCombination a) Sense (LinearCombination a)
- type Var a = LinearCombination a
- data Sense
- newtype LinearCombination a = LinearCombination (IntMap a)
- type VarIndex = Int
- newVar :: Num a => VarIndex -> Var a
- (.>=.) :: LinearCombination a -> LinearCombination a -> Constraint a
- (.<=.) :: LinearCombination a -> LinearCombination a -> Constraint a
- (.>=) :: LinearCombination a -> a -> Constraint a
- (.<=) :: LinearCombination a -> a -> Constraint a
- linearCombination :: Num a => [(a, Var a)] -> LinearCombination a
- constant :: a -> LinearCombination a
- cst :: a -> LinearCombination a
- vertexenum :: Real a => [Constraint a] -> Maybe [Double] -> IO [[Double]]
- checkConstraints :: Real a => [Constraint a] -> [Double] -> [(Double, Bool)]
- interiorPoint :: Real a => [Constraint a] -> IO [Double]
Documentation
data Constraint a Source #
Instances
Show a => Show (Constraint a) Source # | |
Defined in Geometry.VertexEnum.Constraint showsPrec :: Int -> Constraint a -> ShowS # show :: Constraint a -> String # showList :: [Constraint a] -> ShowS # |
type Var a = LinearCombination a Source #
newtype LinearCombination a Source #
Instances
(.>=.) :: LinearCombination a -> LinearCombination a -> Constraint a infix 4 Source #
(.<=.) :: LinearCombination a -> LinearCombination a -> Constraint a infix 4 Source #
(.>=) :: LinearCombination a -> a -> Constraint a infix 4 Source #
(.<=) :: LinearCombination a -> a -> Constraint a infix 4 Source #
linearCombination :: Num a => [(a, Var a)] -> LinearCombination a Source #
linear combination from list of terms
constant :: a -> LinearCombination a Source #
constant linear combination
cst :: a -> LinearCombination a Source #
alias for constant
:: Real a | |
=> [Constraint a] | linear inequalities |
-> Maybe [Double] | point satisfying the inequalities, |
-> IO [[Double]] | vertices of the polytope defined by the inequalities |
Vertex enumeration
:: Real a | |
=> [Constraint a] | linear inequalities |
-> [Double] | point to be tested |
-> [(Double, Bool)] | difference and status for each constraint |
Checks whether a point fulfills some inequalities; returns the difference between the upper member and the lower member for each inequality, which is positive in case if the inequality is fulfilled.
:: Real a | |
=> [Constraint a] | linear inequalities |
-> IO [Double] | point fulfilling the inequaities |
Returns a point fulfilling a list of inequalities