hstatistics-0.1.0.4: Statistics

Portabilityuses ffi
Stabilityprovisional
Maintainerhaskell.vivian.mcphail <at> gmail <dot> com

Numeric.GSL.Permutation

Description

GSL permutation functions

Synopsis

Documentation

data Permutation Source

A permutation structure

data CanPerm Source

A canonical permutation structure

random_permuteSource

Arguments

:: Int

seed

-> Int

size

-> Permutation 

generate a random permutation

get :: Permutation -> Int -> IntSource

returns the value of the i-th element of the permutation

swap :: Permutation -> Int -> Int -> PermutationSource

swaps the i-th and j-th elements

swapList :: Permutation -> [(Int, Int)] -> PermutationSource

swaps pairs of elements

size :: Permutation -> IntSource

get the length of the permutation

valid :: Permutation -> BoolSource

checks that the permutation is valid

reverse :: Permutation -> PermutationSource

reverse the elements of the permutation

inverse :: Permutation -> PermutationSource

computes the inverse of the permutation

next :: Permutation -> IO BoolSource

advances the permutation to the next in lexicographic order, if there is one

prev :: Permutation -> IO BoolSource

steps the permutation back to the previous in lexicographic order, if there is one

permute :: Permutation -> Vector Double -> Vector DoubleSource

apply the permutation to a vector

inverse_permute :: Permutation -> Vector Double -> Vector DoubleSource

apply the inverse permutation to a vector

mul :: Permutation -> Permutation -> PermutationSource

multiply two permutations, P = PA * PB

fwritePermutation :: FilePath -> Permutation -> IO ()Source

write a permutation in the native binary format (may not be portable)

freadPermutation :: FilePath -> Int -> IO PermutationSource

read a permutation in the native binary format, length must be known

fprintfPermutation :: FilePath -> String -> Permutation -> IO ()Source

saves the permutation with the given format

fscanfPermutation :: FilePath -> Int -> IO PermutationSource

reads formatted data as written by fprintf, the number of bins must be known in advance

canonical :: Permutation -> CanPermSource

compute the canonical form

linear :: CanPerm -> PermutationSource

convert from canonical to linear

inversions :: Permutation -> IntSource

a count of the inversions

cyclesLinear :: Permutation -> IntSource

a count of the cycles of a permutation in linear form

cyclesCanonical :: CanPerm -> IntSource

a count of the cycles of a permutation in canonical form