Copyright | (c) OleksandrZhabenko 2020-2023 |
---|---|
License | MIT |
Maintainer | oleksandr.zhabenko@yahoo.com |
Stability | Experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Extensions |
|
Provides several the most important variants of constraints for the
permutations. All the Array
here must consists of unique Int
starting from 0 to n and the Int
arguments must be in the range [0..n] though these inner constraints are
not checked. It is up to user to check them.
Uses arrays instead of vectors.
Synopsis
- unsafeOrderIJ :: Int -> Int -> Array Int Int -> Bool
- filterOrderIJ :: (InsertLeft t (Array Int Int), Monoid (t (Array Int Int))) => Int -> Int -> t (Array Int Int) -> t (Array Int Int)
- unsafeTriples :: (InsertLeft t (Array Int Int), Monoid (t (Array Int Int))) => Int -> Int -> Int -> t (Array Int Int) -> t (Array Int Int)
- unsafeQuadruples :: (InsertLeft t (Array Int Int), Monoid (t (Array Int Int))) => Int -> Int -> Int -> Int -> t (Array Int Int) -> t (Array Int Int)
- unsafeSeveralA :: (InsertLeft t (Array Int Int), Monoid (t (Array Int Int))) => Int -> Array Int Int -> t (Array Int Int) -> t (Array Int Int)
- unsafeSeveralB :: (InsertLeft t (Array Int Int), Monoid (t (Array Int Int))) => Int -> Array Int Int -> t (Array Int Int) -> t (Array Int Int)
- fixedPointsG :: (InsertLeft t (Array Int Int), Monoid (t (Array Int Int))) => Array Int (Int, Int) -> t (Array Int Int) -> t (Array Int Int)
- fixedPointsS :: (InsertLeft t (Array Int Int), Monoid (t (Array Int Int))) => Array Int Int -> t (Array Int Int) -> t (Array Int Int)
- unsafeSignDistanceIJ :: Int -> Int -> Int -> Array Int Int -> Bool
- unsafeUnsignDistanceIJ :: Int -> Int -> Int -> Array Int Int -> Bool
- filterSignDistanceIJ :: (InsertLeft t (Array Int Int), Monoid (t (Array Int Int))) => Int -> Int -> Int -> t (Array Int Int) -> t (Array Int Int)
- filterUnsignDistanceIJ :: (InsertLeft t (Array Int Int), Monoid (t (Array Int Int))) => Int -> Int -> Int -> t (Array Int Int) -> t (Array Int Int)
- filterSignDistanceIJK3 :: (InsertLeft t (Array Int Int), Monoid (t (Array Int Int))) => Int -> Int -> Int -> Int -> Int -> t (Array Int Int) -> t (Array Int Int)
- filterUnsignDistanceIJK3 :: (InsertLeft t (Array Int Int), Monoid (t (Array Int Int))) => Int -> Int -> Int -> Int -> Int -> t (Array Int Int) -> t (Array Int Int)
Basic predicate
unsafeOrderIJ :: Int -> Int -> Array Int Int -> Bool Source #
Being given the data satisfying the constraints in the module header checks whether in the Array
the first argument stands before the second one.
Functions to work with permutations with basic constraints (Array
-based)
filterOrderIJ :: (InsertLeft t (Array Int Int), Monoid (t (Array Int Int))) => Int -> Int -> t (Array Int Int) -> t (Array Int Int) Source #
Being given the data satisfying the constraints in the module header returns the elements that satisfy unsafeOrderIJ
as a predicate.
unsafeTriples :: (InsertLeft t (Array Int Int), Monoid (t (Array Int Int))) => Int -> Int -> Int -> t (Array Int Int) -> t (Array Int Int) Source #
Being given the data satisfying the constraints in the module header reduces the number of further computations in the foldable structure of
the permutations each one being represented as Array
Int
Int
where the elements are all the numbers in the range [0..n] without duplication if the
arguments are the indeces of the duplicated words or their concatenated combinations in the corresponding line.
The first three arguments
are the indices of the the triple duplicated elements (words or their concatenated combinations in the phonetic-languages
series of packages).
unsafeQuadruples :: (InsertLeft t (Array Int Int), Monoid (t (Array Int Int))) => Int -> Int -> Int -> Int -> t (Array Int Int) -> t (Array Int Int) Source #
Being given the data satisfying the constraints in the module header reduces the number of further computations in the foldable structure of
the permutations each one being represented as Array
Int
Int
where the elements are all the numbers in the range [0..n] without duplication if the
arguments are the indeces of the duplicated words or their concatenated combinations in the corresponding line.
The first four arguments
are the indices of the the quadruple duplicated elements (words or their concatenated combinations in the phonetic-languages
series of packages).
With multiple elements specified
unsafeSeveralA :: (InsertLeft t (Array Int Int), Monoid (t (Array Int Int))) => Int -> Array Int Int -> t (Array Int Int) -> t (Array Int Int) Source #
Being given the data satisfying the constraints in the module header reduces the number of further computations in the foldable structure of
the permutations each one being represented as Array
Int
Int
where the elements are all the numbers in the range [0..n] without duplication.
The first argument
is the index of the the element (a word or their concatenated combination in the phonetic-languages
series of packages), the second argument
is Array
Int
of indices that are in the range [0..n]. Filters (and reduces further complex computations) the permutations so that only the
variants with the indices in the second argument all stand AFTER the element with the index equal to the first argument.
unsafeSeveralB :: (InsertLeft t (Array Int Int), Monoid (t (Array Int Int))) => Int -> Array Int Int -> t (Array Int Int) -> t (Array Int Int) Source #
Being given the data satisfying the constraints in the module header reduces the number of further computations in the foldable structure of
the permutations each one being represented as Array
Int
Int
where the elements are all the numbers in the range [0..n] without duplication.
The first argument
is the index of the the element (a word or their concatenated combination in the phonetic-languages
series of packages), the second argument
is Array
of indices that are in the range [0..n]. Filters (and reduces further complex computations) the permutations so that only the
variants with the indices in the second argument all stand BEFORE the element with the index equal to the first argument.
With fixed points
fixedPointsG :: (InsertLeft t (Array Int Int), Monoid (t (Array Int Int))) => Array Int (Int, Int) -> t (Array Int Int) -> t (Array Int Int) Source #
Reduces the number of permutations using filtering leaving just those ones permutations where elements on the
first elements in the tuples in the first argument Array
places are moved to the places indexed with the second
elements in the tuples respectively.
fixedPointsS :: (InsertLeft t (Array Int Int), Monoid (t (Array Int Int))) => Array Int Int -> t (Array Int Int) -> t (Array Int Int) Source #
A simplified variant of the fixedPointsG
function where the specified elements stay on their place and that is
why are 'fixed points' in the permutation specified.
Distances between elements
:: Int | |
-> Int | |
-> Int | Can be of both signs, but not equal to 0. The positive value gives |
-> Array Int Int | |
-> Bool |
filterSignDistanceIJ :: (InsertLeft t (Array Int Int), Monoid (t (Array Int Int))) => Int -> Int -> Int -> t (Array Int Int) -> t (Array Int Int) Source #
filterUnsignDistanceIJ :: (InsertLeft t (Array Int Int), Monoid (t (Array Int Int))) => Int -> Int -> Int -> t (Array Int Int) -> t (Array Int Int) Source #