Copyright | (c) Immanuel Albrecht 2020-202x |
---|---|
License | BSD-3 |
Maintainer | mail@immanuel-albrecht.de |
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
This module provides implementations of common operations on matroids and an abstract matroid data type.
Synopsis
- data AMatroid a = WMatroid {
- w_groundset :: Set a
- w_showName :: Maybe String
- w_rk :: Maybe (Set a -> Int)
- w_indep :: Maybe (Set a -> Bool)
- w_basis :: Maybe (Set a -> Set a)
- w_cl :: Maybe (Set a -> Set a)
- w_abstract :: Maybe (AMatroid a)
- w_dual :: Maybe (AMatroid a)
- w_restriction :: Maybe (Set a -> AMatroid a)
- w_contraction :: Maybe (Set a -> AMatroid a)
- w_loops :: Maybe (Set a)
- w_coRk :: Maybe (Set a -> Int)
- w_coloops :: Maybe (Set a)
- wrappedMatroid :: AMatroid a
- a_restriction :: (Show a, Ord a) => AMatroid a -> Set a -> AMatroid a
- a_namedRestriction :: Ord a => String -> AMatroid a -> Set a -> AMatroid a
- a_contraction :: (Show a, Ord a) => AMatroid a -> Set a -> AMatroid a
- a_namedContraction :: Ord a => String -> AMatroid a -> Set a -> AMatroid a
- a_dual :: (Show a, Ord a) => AMatroid a -> AMatroid a
- a_namedDual :: Ord a => String -> AMatroid a -> AMatroid a
Documentation
abstract matroid data type with elements of a given type
Its purpose is to hide the underlying type from the type system. The records resemble the typeclass Matroid, where everything except for the groundset has been placed inside the Maybe-Monad. A value of Nothing indicates that the default implementation of the typeclass should be used.
WMatroid | |
|
Instances
(Ord a, Show a) => Matroid AMatroid a Source # | This instance contains the default implementations of the members of the Matroid typeclass. |
Defined in Data.Matroid.Typeclass groundset :: AMatroid a -> Set a Source # showName :: AMatroid a -> String Source # rk :: AMatroid a -> Set a -> Int Source # indep :: AMatroid a -> Set a -> Bool Source # basis :: AMatroid a -> Set a -> Set a Source # cl :: AMatroid a -> Set a -> Set a Source # abstract :: AMatroid a -> AMatroid a Source # dual :: AMatroid a -> AMatroid a Source # restriction :: AMatroid a -> Set a -> AMatroid a Source # contraction :: AMatroid a -> Set a -> AMatroid a Source # loops :: AMatroid a -> Set a Source # | |
Show a => Show (AMatroid a) Source # | |
wrappedMatroid :: AMatroid a Source #
defaults for WMatroid
returns the restriction of a given matroid
Note that this routine implements the correct routines provided that the prerequisite members in the input matroid are defined. Routines which have missing prerequisite members in the input matroid will be left to Nothing. Data.Matroid.Typeclass.wrapUp fills all AMatroid record members.
returns the restriction of a given matroid, named
Note that this routine implements the correct routines provided that the prerequisite members in the input matroid are defined. Routines which have missing prerequisite members in the input matroid will be left to Nothing. Data.Matroid.Typeclass.wrapUp fills all AMatroid record members.
:: (Show a, Ord a) | |
=> AMatroid a | input matroid |
-> Set a | contract the ground set onto this set |
-> AMatroid a |
returns the contraction of a given matroid
Note that this routine implements the correct routines provided that the prerequisite members in the input matroid are defined. Routines which have missing prerequisite members in the input matroid will be left to Nothing. Data.Matroid.Typeclass.wrapUp fills all AMatroid record members.
:: Ord a | |
=> String | name |
-> AMatroid a | input matroid |
-> Set a | contract the ground set onto this set |
-> AMatroid a |
returns the contraction of a given matroid, named
Note that this routine implements the correct routines provided that the prerequisite members in the input matroid are defined. Routines which have missing prerequisite members in the input matroid will be left to Nothing. Data.Matroid.Typeclass.wrapUp fills all AMatroid record members.
returns the contraction of a given matroid
Note that this routine implements the correct routines provided that the prerequisite members in the input matroid are defined. Routines which have missing prerequisite members in the input matroid will be left to Nothing. Data.Matroid.Typeclass.wrapUp fills all AMatroid record members.
returns the contraction of a given matroid, named
Note that this routine implements the correct routines provided that the prerequisite members in the input matroid are defined. Routines which have missing prerequisite members in the input matroid will be left to Nothing. Data.Matroid.Typeclass.wrapUp fills all AMatroid record members.