hmt-diagrams-0.15: Haskell Music Theory Diagrams

Safe HaskellNone
LanguageHaskell98

Music.Theory.Diagram.Render.Hinton

Contents

Description

Functions for Hinton diagrams of matrices.

Synopsis

Arr

type Arr t = [[t]] Source

Regular (unchecked) two dimensional arrays.

a_dimensions :: Arr t -> (Int, Int) Source

Dimensions of Arr, columns are as at row 0.

a_normalise :: (Fractional t, Ord t) => Arr t -> Arr t Source

Normalise Arr such that maxima is 1.

a_normalise [[3,2],[4,5]] == [[0.6,0.4],[0.8,1.0]]

a_scale :: Num t => t -> Arr t -> Arr t Source

Multiply all elements at Arr by k.

a_scale 0.85 (a_normalise [[3,2],[4,5]]) == [[0.51,0.34],[0.68,0.85]]

Drawing

draw_hinton_cell :: (C, C) -> ((R, R), R) -> Render () Source

draw_hinton1 :: (C, C, C) -> (Int, Int) -> Arr R -> Render () Source

hinton_diagrams :: (C, C, C) -> R -> FilePath -> [Arr R] -> IO () Source

Colours are (background,negative,positive). s is a scalar for normalisation of matrix data.