newmana/chroma-elm/18.0.5

NOTE: the latest version is 18.2.1

Chroma.Limits.CkMeans

A log linear implementation of CkMeans. It uses a divide-and-conquer algorithm to compute a row in the dynamic programming matrix in O(n log n) time. The Simple Statistic's implementation was used to validate this implementation.

There is a better one (not implemented) using the SMAWK optimisation.

The limit function produces class breaks like the other implementations and binned puts all data values into their bins.

Definition

binned : Int -> Scale -> Nonempty (Array Float)

Return the values in Scale into the given number of bins.

Analyze.analyze (Nonempty.Nonempty 3 [1,3,4,3])
|> binned 3
-->  Nonempty.Nonempty [1] [[3,3,3], [4]]
limit : Int -> Scale -> Nonempty Float

Create up to bins number of results using the given scale.

Analyze.analyze (Nonempty.Nonempty 3 [1,3,4,3])
|> limit 3
-->  Nonempty.Nonempty 1 [3,4]

Helpers

converge : Int -> Int -> Int -> Float -> CkRest -> ( Float, Int )

TBD

defaultResult : Int -> Int -> CkResult

TBD

fillRestOfMatrix : Int -> Scale -> CkRest -> CkResult

TBD

firstLine : Int -> Scale -> CkRest

TBD

getMatrixIndexes : Int -> List Int

TBD

getValues : Int -> Int -> List ( Int, Int )

TBD