hmatrix-gsl-stats-0.4.1.6: GSL Statistics interface

Copyright(c) A. V. H. McPhail 2010 2016
LicenseBSD3
Maintainerhaskell.vivian.mcphail <at> gmail <dot> com
Stabilityprovisional
Portabilityuses ffi
Safe HaskellNone
LanguageHaskell2010

Numeric.GSL.Permutation

Description

Synopsis

Documentation

data Permutation #

A permutation structure

data CanPerm #

A canonical permutation structure

random_permute #

Arguments

:: Int

seed

-> Int

size

-> Permutation 

generate a random permutation

get :: Permutation -> Int -> Int #

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

swap :: Permutation -> Int -> Int -> Permutation #

swaps the i-th and j-th elements

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

swaps pairs of elements

size :: Permutation -> Int #

get the length of the permutation

valid :: Permutation -> Bool #

checks that the permutation is valid

reverse :: Permutation -> Permutation #

reverse the elements of the permutation

inverse :: Permutation -> Permutation #

computes the inverse of the permutation

next :: Permutation -> IO Bool #

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

prev :: Permutation -> IO Bool #

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

permute :: Permutation -> Vector Double -> Vector Double #

apply the permutation to a vector

inverse_permute :: Permutation -> Vector Double -> Vector Double #

apply the inverse permutation to a vector

mul :: Permutation -> Permutation -> Permutation #

multiply two permutations, P = PA * PB

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

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

freadPermutation :: FilePath -> Int -> IO Permutation #

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

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

saves the permutation with the given format

fscanfPermutation :: FilePath -> Int -> IO Permutation #

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

canonical :: Permutation -> CanPerm #

compute the canonical form

linear :: CanPerm -> Permutation #

convert from canonical to linear

inversions :: Permutation -> Int #

a count of the inversions

cyclesLinear :: Permutation -> Int #

a count of the cycles of a permutation in linear form

cyclesCanonical :: CanPerm -> Int #

a count of the cycles of a permutation in canonical form