| Copyright | (c) Marcelo Garlet Milani 2026 |
|---|---|
| License | MIT |
| Maintainer | mgmilani@pm.me |
| Stability | unstable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Nauty.Digraph6.Internal
Description
This module contains internal functions used by the Nauty.Digraph6 module. Except for test cases, you should not import this module.
Synopsis
- data AdjacencyMatrix = AdjacencyMatrix {}
- arcExists :: AdjacencyMatrix -> Word64 -> Word64 -> Bool
- encode :: AdjacencyMatrix -> Text
- encodeMatrix :: AdjacencyMatrix -> Text
- fromArcList :: Word64 -> [(Word64, Word64)] -> AdjacencyMatrix
- toArcList :: AdjacencyMatrix -> (Word64, [(Word64, Word64)])
- parse :: Text -> [Either Text AdjacencyMatrix]
- digraph :: Text -> Either Text AdjacencyMatrix
- parseMatrix :: Word64 -> StateT ByteString (Either Text) AdjacencyMatrix
Documentation
data AdjacencyMatrix Source #
A digraph represented as an adjacency matrix.
Constructors
| AdjacencyMatrix | |
Instances
| Show AdjacencyMatrix Source # | |
Defined in Nauty.Digraph6.Internal Methods showsPrec :: Int -> AdjacencyMatrix -> ShowS # show :: AdjacencyMatrix -> String # showList :: [AdjacencyMatrix] -> ShowS # | |
| Eq AdjacencyMatrix Source # | |
Defined in Nauty.Digraph6.Internal Methods (==) :: AdjacencyMatrix -> AdjacencyMatrix -> Bool # (/=) :: AdjacencyMatrix -> AdjacencyMatrix -> Bool # | |
Arguments
| :: AdjacencyMatrix | |
| -> Word64 | Tail |
| -> Word64 | Head |
| -> Bool |
Whether there is an arc from the first vertex to the second.
encode :: AdjacencyMatrix -> Text Source #
Encode a graph in digraph6 format.
encodeMatrix :: AdjacencyMatrix -> Text Source #
Encode the adjacency matrix.
Arguments
| :: Word64 | Number of vertices |
| -> [(Word64, Word64)] | List of arcs |
| -> AdjacencyMatrix |
Create an adjacency matrix from a list of arcs.
Vertices need to be in the range from 0 to n - 1.
toArcList :: AdjacencyMatrix -> (Word64, [(Word64, Word64)]) Source #
The the number of vertices of a digraph together with a list of its arcs.
parse :: Text -> [Either Text AdjacencyMatrix] Source #
Parse all digraphs in the input text. Digraphs are stored one per line.
parseMatrix :: Word64 -> StateT ByteString (Either Text) AdjacencyMatrix Source #
Parse the adjacency matrix of a digraph.