hmatrix-gsl-stats-0.4.1.3: GSL Statistics interface

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

Numeric.GSL.Permutation

Description

Synopsis

Documentation

data Permutation Source

A permutation structure

data CanPerm Source

A canonical permutation structure

random_permute Source

Arguments

:: Int

seed

-> Int

size

-> Permutation 

generate a random permutation

get :: Permutation -> Int -> Int Source

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

swap :: Permutation -> Int -> Int -> Permutation Source

swaps the i-th and j-th elements

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

swaps pairs of elements

size :: Permutation -> Int Source

get the length of the permutation

valid :: Permutation -> Bool Source

checks that the permutation is valid

reverse :: Permutation -> Permutation Source

reverse the elements of the permutation

inverse :: Permutation -> Permutation Source

computes the inverse of the permutation

next :: Permutation -> IO Bool Source

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

prev :: Permutation -> IO Bool Source

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

permute :: Permutation -> Vector Double -> Vector Double Source

apply the permutation to a vector

inverse_permute :: Permutation -> Vector Double -> Vector Double Source

apply the inverse permutation to a vector

mul :: Permutation -> Permutation -> Permutation Source

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 Permutation Source

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 Permutation Source

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

canonical :: Permutation -> CanPerm Source

compute the canonical form

linear :: CanPerm -> Permutation Source

convert from canonical to linear

inversions :: Permutation -> Int Source

a count of the inversions

cyclesLinear :: Permutation -> Int Source

a count of the cycles of a permutation in linear form

cyclesCanonical :: CanPerm -> Int Source

a count of the cycles of a permutation in canonical form