hmt-base-0.20: Haskell Music Theory Base
Safe HaskellSafe-Inferred
LanguageHaskell2010

Music.Theory.Graph.Lgl

Contents

Description

LGL = Large Graph Layout (NCOL, LGL)

http://lgl.sourceforge.net/#FileFormat

Synopsis

Ncol

type Ncol_Ent t = ((t, t), Maybe Double) Source #

(edge,weight)

type Ncol t = [Ncol_Ent t] Source #

ncol-entry

ncol_load :: Read t => FilePath -> IO (Ncol t) Source #

Load Ncol from .ncol file.

ncol_load_int :: FilePath -> IO (Ncol Int) Source #

Type-specialised.

ncol_ent_format :: Show t => Int -> Ncol_Ent t -> String Source #

Format Ncol_Ent.

ncol_ent_format 4 ((0,1),Nothing) == "0 1"
ncol_ent_format 4 ((0,1),Just 2.0) == "0 1 2.0000"

ncol_store :: Show t => Int -> FilePath -> Ncol t -> IO () Source #

Store Ncol of Int to .ncol file

ncol_store_int :: Int -> FilePath -> Ncol Int -> IO () Source #

Type-specialised.

ncol_rewrite_eset :: Ord t => [(t, t)] -> [(t, t)] Source #

Ncol data must be un-directed and have no self-arcs. This function sorts edges (i,j) so that i <= j and deletes edges where i == j.

eset_to_ncol :: Ord t => [(t, t)] -> Ncol t Source #

eset (edge-set) to Ncol (runs ncol_rewrite_eset)

ncol_to_eset :: Ncol t -> [(t, t)] Source #

Inverse of eset_to_ncol, error if Ncol is weighted

ncol_store_eset :: (Ord t, Show t) => FilePath -> [(t, t)] -> IO () Source #

Lgl

type Lgl t = [(t, [(t, Maybe Double)])] Source #

Lgl is an adjaceny set with optional weights.

lgl_format :: Show t => Int -> Lgl t -> String Source #

Format Lgl, k is floating point precision for optional weights.

adj_to_lgl :: Adj t -> Lgl t Source #

adj (adjaceny-set) to Lgl.

lgl_to_adj :: Lgl t -> Adj t Source #

Inverse of adj_to_lgl, error if Lgl is weighted