| dph-prim-seq-0.3: Sequential Primitives for Data-Parallel Haskell. | Source code | Contents | Index

Data.Array.Parallel.Unlifted.Sequential

Contents

Array classes
Array types
Basic operations
Subarrays
Permutations
Higher-order operations
Segmented Subarrays
Searching
Logical operations
Arithmetic operations
Arrays of pairs
Enumerations
Searching
Conversions to/from lists
Unlifted.Sequential arrays
I/O
Segmentation
Basic operations (segmented)
Basic operations lifted
Zipping (segmented)
Permutations (segmented)
Higher-order operations (segmented)
Logical operations (segmented)
Arithmetic operations (segmented)
Enumerations (segmented)
Conversions to/from lists (segmented)
Segment descriptors
Mutable arrays
Library id

Description
(c) [2006..2007] Manuel M T Chakravarty & Roman Leshchinskiy License : see librariesndpLICENSE Maintainer : Roman Leshchinskiy rl@cse.unsw.edu.au Stability : experimental Portability : portable Description --------------------------------------------------------------- External interface to unlifted arrays. Todo ----------------------------------------------------------------------
Synopsis

class HS e => UA e where

data UArr e
data MUArr e :: * -> *
lengthU :: UArr e -> Int
sliceU :: UArr e -> Int -> Int -> UArr e
newMU :: Int -> ST s (MUArr e s)
hasAtomicWriteMU :: e -> Bool
copyMU :: MUArr e s -> Int -> UArr e -> ST s ()

data USegd
data SUArr e
nullU :: UA e => UArr e -> Bool
emptyU :: UA e => UArr e
singletonU :: UA e => e -> UArr e
consU :: UA e => e -> UArr e -> UArr e
unitsU :: Int -> UArr ()
replicateU :: UA e => Int -> e -> UArr e
replicateEachU :: UA e => Int -> UArr Int -> UArr e -> UArr e
(!:) :: UA e => UArr e -> Int -> e
(+:+) :: UA e => UArr e -> UArr e -> UArr e
indexedU :: UA e => UArr e -> UArr (Int :*: e)
repeatU :: UA e => Int -> UArr e -> UArr e
extractU :: UA a => UArr a -> Int -> Int -> UArr a
tailU :: UA e => UArr e -> UArr e
takeU :: UA e => Int -> UArr e -> UArr e
dropU :: UA e => Int -> UArr e -> UArr e
splitAtU :: UA e => Int -> UArr e -> (UArr e, UArr e)
permuteU :: UA e => UArr e -> UArr Int -> UArr e
bpermuteU :: UA e => UArr e -> UArr Int -> UArr e
bpermuteDftU :: UA e => Int -> (Int -> e) -> UArr (Int :*: e) -> UArr e
reverseU :: UA e => UArr e -> UArr e
updateU :: UA e => UArr e -> UArr (Int :*: e) -> UArr e
mapU :: (UA e, UA e') => (e -> e') -> UArr e -> UArr e'
zipWithU :: (UA a, UA b, UA c) => (a -> b -> c) -> UArr a -> UArr b -> UArr c
zipWith3U :: (UA a, UA b, UA c, UA d) => (a -> b -> c -> d) -> UArr a -> UArr b -> UArr c -> UArr d
filterU :: UA e => (e -> Bool) -> UArr e -> UArr e
packU :: UA e => UArr e -> UArr Bool -> UArr e
foldlU :: UA a => (b -> a -> b) -> b -> UArr a -> b
foldl1U :: UA a => (a -> a -> a) -> UArr a -> a
foldl1MaybeU :: UA a => (a -> a -> a) -> UArr a -> MaybeS a
foldU :: UA a => (a -> a -> a) -> a -> UArr a -> a
fold1U :: UA a => (a -> a -> a) -> UArr a -> a
fold1MaybeU :: UA a => (a -> a -> a) -> UArr a -> MaybeS a
scanlU :: (UA a, UA b) => (b -> a -> b) -> b -> UArr a -> UArr b
scanl1U :: UA a => (a -> a -> a) -> UArr a -> UArr a
scanU :: UA a => (a -> a -> a) -> a -> UArr a -> UArr a
scan1U :: UA a => (a -> a -> a) -> UArr a -> UArr a
scanResU :: UA a => (a -> a -> a) -> a -> UArr a -> UArr a :*: a
mapAccumLU :: (UA a, UA b) => (c -> a -> c :*: b) -> c -> UArr a -> UArr b
filterSU :: UA e => (e -> Bool) -> SUArr e -> SUArr e
packCU :: UA e => UArr Bool -> SUArr e -> SUArr e
combineU :: UA a => UArr Bool -> UArr a -> UArr a -> UArr a
combineSU :: UA a => UArr Bool -> SUArr a -> SUArr a -> UArr a
combineCU :: UA e => UArr Bool -> SUArr e -> SUArr e -> SUArr e
sliceSU :: UA e => SUArr e -> Int -> Int -> SUArr e
extractSU :: UA e => SUArr e -> Int -> Int -> SUArr e
takeCU :: UA e => Int -> SUArr e -> SUArr e
dropCU :: UA e => Int -> SUArr e -> SUArr e
elemU :: (Eq e, UA e) => e -> UArr e -> Bool
notElemU :: (Eq e, UA e) => e -> UArr e -> Bool
andU :: UArr Bool -> Bool
orU :: UArr Bool -> Bool
anyU :: UA e => (e -> Bool) -> UArr e -> Bool
allU :: UA e => (e -> Bool) -> UArr e -> Bool
sumU :: (Num e, UA e) => UArr e -> e
productU :: (Num e, UA e) => UArr e -> e
maximumU :: (Ord e, UA e) => UArr e -> e
minimumU :: (Ord e, UA e) => UArr e -> e
maximumByU :: UA e => (e -> e -> Ordering) -> UArr e -> e
minimumByU :: UA e => (e -> e -> Ordering) -> UArr e -> e
maximumIndexU :: (Ord e, UA e) => UArr e -> Int
minimumIndexU :: (Ord e, UA e) => UArr e -> Int
maximumIndexByU :: UA e => (e -> e -> Ordering) -> UArr e -> Int
minimumIndexByU :: UA e => (e -> e -> Ordering) -> UArr e -> Int
zipU :: (UA a, UA b) => UArr a -> UArr b -> UArr (a :*: b)
zip3U :: (UA e1, UA e2, UA e3) => UArr e1 -> UArr e2 -> UArr e3 -> UArr ((e1 :*: e2) :*: e3)
unzipU :: (UA a, UA b) => UArr (a :*: b) -> UArr a :*: UArr b
unzip3U :: (UA e1, UA e2, UA e3) => UArr ((e1 :*: e2) :*: e3) -> (UArr e1 :*: UArr e2) :*: UArr e3
fstU :: (UA a, UA b) => UArr (a :*: b) -> UArr a
sndU :: (UA a, UA b) => UArr (a :*: b) -> UArr b
enumFromToU :: Int -> Int -> UArr Int
enumFromThenToU :: Int -> Int -> Int -> UArr Int
enumFromStepLenU :: Int -> Int -> Int -> UArr Int
enumFromToEachU :: Int -> UArr (Int :*: Int) -> UArr Int
findU :: UA a => (a -> Bool) -> UArr a -> Maybe a
findIndexU :: UA a => (a -> Bool) -> UArr a -> Maybe Int
toU :: UA e => [e] -> UArr e
fromU :: UA e => UArr e -> [e]
randomU :: (UA a, Random a, RandomGen g) => Int -> g -> UArr a
randomRU :: (UA a, Random a, RandomGen g) => Int -> (a, a) -> g -> UArr a
class UA a => UIO a where

hPutU :: Handle -> UArr a -> IO ()
hGetU :: Handle -> IO (UArr a)

concatSU :: UA e => SUArr e -> UArr e
flattenSU :: UA e => SUArr e -> UArr e
(>:) :: UA a => USegd -> UArr a -> SUArr a
segmentU :: (UA e', UA e) => SUArr e' -> UArr e -> SUArr e
segmentArrU :: UA e => UArr Int -> UArr e -> SUArr e
segdSU :: UA e => SUArr e -> USegd
lengthSU :: UA e => SUArr e -> Int
singletonSU :: UA e => UArr e -> SUArr e
replicateSU :: UA e => UArr Int -> UArr e -> SUArr e
replicateCU :: UA e => Int -> UArr e -> SUArr e
(+:+^) :: UA e => SUArr e -> SUArr e -> SUArr e
indexedSU :: UA e => SUArr e -> SUArr (Int :*: e)
(^+:+^) :: UA a => SUArr a -> SUArr a -> SUArr a
(!:^) :: UA e => SUArr e -> UArr Int -> UArr e
lengthsSU :: UA e => SUArr e -> UArr Int
indicesSU :: UA e => SUArr e -> UArr Int
fstSU :: (UA a, UA b) => SUArr (a :*: b) -> SUArr a
sndSU :: (UA a, UA b) => SUArr (a :*: b) -> SUArr b
zipSU :: (UA a, UA b) => SUArr a -> SUArr b -> SUArr (a :*: b)
bpermuteSU :: UA e => SUArr e -> SUArr Int -> SUArr e
bpermuteSU' :: UA e => UArr e -> SUArr Int -> SUArr e
mapSU :: (UA a, UA b) => (a -> b) -> SUArr a -> SUArr b
zipWithSU :: (UA a, UA b, UA c) => (a -> b -> c) -> SUArr a -> SUArr b -> SUArr c
foldlSU :: (UA a, UA b) => (b -> a -> b) -> b -> SUArr a -> UArr b
foldSU :: UA a => (a -> a -> a) -> a -> SUArr a -> UArr a
fold1SU :: UA a => (a -> a -> a) -> SUArr a -> UArr a
andSU :: SUArr Bool -> UArr Bool
orSU :: SUArr Bool -> UArr Bool
sumSU :: (Num e, UA e) => SUArr e -> UArr e
productSU :: (Num e, UA e) => SUArr e -> UArr e
maximumSU :: (Ord e, UA e) => SUArr e -> UArr e
minimumSU :: (Ord e, UA e) => SUArr e -> UArr e
enumFromToSU :: (Enum e, UA e) => UArr e -> UArr e -> SUArr e
enumFromThenToSU :: (Enum e, UA e) => UArr e -> UArr e -> UArr e -> SUArr e
toSU :: UA e => [[e]] -> SUArr e
fromSU :: UA e => SUArr e -> [[e]]
lengthsUSegd :: USegd -> UArr Int
lengthsToUSegd :: UArr Int -> USegd
toUSegd :: UArr (Int :*: Int) -> USegd
fromUSegd :: USegd -> UArr (Int :*: Int)
newU :: UA e => Int -> (forall s. MUArr e s -> ST s ()) -> UArr e
permuteMU :: UA e => MUArr e s -> UArr e -> UArr Int -> ST s ()
atomicUpdateMU :: UA e => MUArr e s -> UArr (Int :*: e) -> ST s ()
unsafeFreezeAllMU :: UA e => MUArr e s -> ST s (UArr e)
idstr
name
versnum
date
version
copyright
disclaimer
lengthU' :: UA e => UArr e -> Int

Array classes

class HS e => UA e where | Source

Basic operations on representation types ----------------------------------------- This type class determines the types that can be elements immutable unboxed arrays. The representation type of these arrays is defined by way of an associated type. All representation-dependent functions are methods of this class.
Associated Types

data UArr e | Source

data MUArr e :: * -> * | Source

Methods

lengthU :: UArr e -> Int | Source

Yield the length of an unboxed array

sliceU :: UArr e -> Int -> Int -> UArr e | Source

Restrict access to a subrange of the original array (no copying)

newMU :: Int -> ST s (MUArr e s) | Source

Allocate a mutable unboxed array

hasAtomicWriteMU :: e -> Bool | Source

Indicate whether the type supports atomic updates

copyMU :: MUArr e s -> Int -> UArr e -> ST s () | Source

Copy the contents of an immutable unboxed array into a mutable one from the specified position on

Instances

UA Bool
UA Char
UA Double
UA Float
UA Int
UA Word8
UA ()
(UA a, UA b) => UA (a :*: b)

Array types

data USegd | Source

Segment descriptors represent the structure of nested arrays. For each segment, it stores the length and the starting index in the flat data array.
Instances

Read USegd
Show USegd

data SUArr e | Source

Segmented arrays ----------------- Segmented arrays (only one level of segmentation)
Instances

(Eq e, UA e) => Eq (SUArr e)
(Read e, UA e) => Read (SUArr e)
(Show e, UA e) => Show (SUArr e)

Basic operations

nullU :: UA e => UArr e -> Bool | Source

Test whether the given array is empty

emptyU :: UA e => UArr e | Source

Yield an empty array

singletonU :: UA e => e -> UArr e | Source

Yield a singleton array

consU :: UA e => e -> UArr e -> UArr e | Source

Prepend an element to an array

unitsU :: Int -> UArr () | Source

Basic operations on unboxed arrays ----------------------------------- Yield an array of units

replicateU :: UA e => Int -> e -> UArr e | Source

Yield an array where all elements contain the same value

replicateEachU :: UA e => Int -> UArr Int -> UArr e -> UArr e | Source

(!:) :: UA e => UArr e -> Int -> e | Source

Array indexing

(+:+) :: UA e => UArr e -> UArr e -> UArr e | Source

Concatenate two arrays

indexedU :: UA e => UArr e -> UArr (Int :*: e) | Source

Indexing --------- Associate each element of the array with its index

repeatU :: UA e => Int -> UArr e -> UArr e | Source

Repeat an array `n` times
Subarrays

extractU :: UA a => UArr a -> Int -> Int -> UArr a | Source

tailU :: UA e => UArr e -> UArr e | Source

Yield the tail of an array

takeU :: UA e => Int -> UArr e -> UArr e | Source

Extract a prefix of an array

dropU :: UA e => Int -> UArr e -> UArr e | Source

Extract a suffix of an array

splitAtU :: UA e => Int -> UArr e -> (UArr e, UArr e) | Source

Split an array into two halves at the given index
Permutations

permuteU :: UA e => UArr e -> UArr Int -> UArr e | Source

Standard permutation

bpermuteU :: UA e => UArr e -> UArr Int -> UArr e | Source

Back permutation operation (ie, the permutation vector determines for each position in the result array its origin in the input array)

bpermuteDftU | Source

:: UA e |
=> Int | length of result array
-> Int -> e | initialiser function
-> UArr (Int :*: e) | index-value pairs
-> UArr e |

Default back permute

- The values of the index-value pairs are written into the position in the result array that is indicated by the corresponding index.
- All positions not covered by the index-value pairs will have the value determined by the initialiser function for that index position.

reverseU :: UA e => UArr e -> UArr e | Source

Reverse the order of elements in an array

updateU :: UA e => UArr e -> UArr (Int :*: e) -> UArr e | Source

Yield an array constructed by updating the first array by the associations from the second array (which contains index/value pairs).
Higher-order operations

mapU :: (UA e, UA e') => (e -> e') -> UArr e -> UArr e' | Source

Map a function over an array

zipWithU :: (UA a, UA b, UA c) => (a -> b -> c) -> UArr a -> UArr b -> UArr c | Source

zipWith3U :: (UA a, UA b, UA c, UA d) => (a -> b -> c -> d) -> UArr a -> UArr b -> UArr c -> UArr d | Source

filterU :: UA e => (e -> Bool) -> UArr e -> UArr e | Source

Extract all elements from an array that meet the given predicate

packU :: UA e => UArr e -> UArr Bool -> UArr e | Source

Extract all elements from an array according to a given flag array

foldlU :: UA a => (b -> a -> b) -> b -> UArr a -> b | Source

Array reduction proceeding from the left

foldl1U :: UA a => (a -> a -> a) -> UArr a -> a | Source

Array reduction proceeding from the left for non-empty arrays FIXME: Rewrite for `Stream`s.

foldl1MaybeU :: UA a => (a -> a -> a) -> UArr a -> MaybeS a | Source

foldU :: UA a => (a -> a -> a) -> a -> UArr a -> a | Source

Array reduction that requires an associative combination function with its unit

fold1U :: UA a => (a -> a -> a) -> UArr a -> a | Source

Reduction of a non-empty array which requires an associative combination function

fold1MaybeU :: UA a => (a -> a -> a) -> UArr a -> MaybeS a | Source

scanlU :: (UA a, UA b) => (b -> a -> b) -> b -> UArr a -> UArr b | Source

Prefix scan proceedings from left to right

scanl1U :: UA a => (a -> a -> a) -> UArr a -> UArr a | Source

Prefix scan of a non-empty array proceeding from left to right

scanU :: UA a => (a -> a -> a) -> a -> UArr a -> UArr a | Source

Prefix scan proceeding from left to right that needs an associative combination function with its unit

scan1U :: UA a => (a -> a -> a) -> UArr a -> UArr a | Source

Prefix scan of a non-empty array proceeding from left to right that needs an associative combination function

scanResU :: UA a => (a -> a -> a) -> a -> UArr a -> UArr a :*: a | Source

mapAccumLU :: (UA a, UA b) => (c -> a -> c :*: b) -> c -> UArr a -> UArr b | Source

Accumulating map from left to right. Does not return the accumulator. FIXME: Naming inconsistent with lists.

filterSU :: UA e => (e -> Bool) -> SUArr e -> SUArr e | Source

Filter segmented array

packCU :: UA e => UArr Bool -> SUArr e -> SUArr e | Source

combineU :: UA a => UArr Bool -> UArr a -> UArr a -> UArr a | Source

combineSU :: UA a => UArr Bool -> SUArr a -> SUArr a -> UArr a | Source

Merge two segmented arrays according to flag array

combineCU :: UA e => UArr Bool -> SUArr e -> SUArr e -> SUArr e | Source

Segmented Subarrays

sliceSU :: UA e => SUArr e -> Int -> Int -> SUArr e | Source

Extract a subrange of the segmented array without copying the elements.

extractSU :: UA e => SUArr e -> Int -> Int -> SUArr e | Source

Extract a subrange of the segmented array (elements are copied).

takeCU :: UA e => Int -> SUArr e -> SUArr e | Source

dropCU :: UA e => Int -> SUArr e -> SUArr e | Source

Searching

elemU :: (Eq e, UA e) => e -> UArr e -> Bool | Source

Determine whether the given element is in an array

notElemU :: (Eq e, UA e) => e -> UArr e -> Bool | Source

Negation of `elemU`
Logical operations

andU :: UArr Bool -> Bool | Source

orU :: UArr Bool -> Bool | Source

anyU :: UA e => (e -> Bool) -> UArr e -> Bool | Source

allU :: UA e => (e -> Bool) -> UArr e -> Bool | Source

Arithmetic operations

sumU :: (Num e, UA e) => UArr e -> e | Source

Compute the sum of an array of numerals

productU :: (Num e, UA e) => UArr e -> e | Source

Compute the product of an array of numerals

maximumU :: (Ord e, UA e) => UArr e -> e | Source

Determine the maximum element in an array

minimumU :: (Ord e, UA e) => UArr e -> e | Source

Determine the minimum element in an array

maximumByU :: UA e => (e -> e -> Ordering) -> UArr e -> e | Source

Determine the maximum element in an array under the given ordering

minimumByU :: UA e => (e -> e -> Ordering) -> UArr e -> e | Source

Determine the minimum element in an array under the given ordering

maximumIndexU :: (Ord e, UA e) => UArr e -> Int | Source

Determine the index of the maximum element in an array

minimumIndexU :: (Ord e, UA e) => UArr e -> Int | Source

Determine the index of the minimum element in an array

maximumIndexByU :: UA e => (e -> e -> Ordering) -> UArr e -> Int | Source

Determine the index of the maximum element in an array under the given ordering

minimumIndexByU :: UA e => (e -> e -> Ordering) -> UArr e -> Int | Source

Determine the index of the minimum element in an array under the given ordering
Arrays of pairs

zipU :: (UA a, UA b) => UArr a -> UArr b -> UArr (a :*: b) | Source

Elementwise pairing of array elements.

zip3U :: (UA e1, UA e2, UA e3) => UArr e1 -> UArr e2 -> UArr e3 -> UArr ((e1 :*: e2) :*: e3) | Source

unzipU :: (UA a, UA b) => UArr (a :*: b) -> UArr a :*: UArr b | Source

Elementwise unpairing of array elements.

unzip3U :: (UA e1, UA e2, UA e3) => UArr ((e1 :*: e2) :*: e3) -> (UArr e1 :*: UArr e2) :*: UArr e3 | Source

fstU :: (UA a, UA b) => UArr (a :*: b) -> UArr a | Source

Yield the first components of an array of pairs.

sndU :: (UA a, UA b) => UArr (a :*: b) -> UArr b | Source

Yield the second components of an array of pairs.
Enumerations

enumFromToU :: Int -> Int -> UArr Int | Source

Yield an enumerated array FIXME: See comments about enumFromThenToS

enumFromThenToU :: Int -> Int -> Int -> UArr Int | Source

Yield an enumerated array using a specific step FIXME: See comments about enumFromThenToS

enumFromStepLenU :: Int -> Int -> Int -> UArr Int | Source

enumFromToEachU :: Int -> UArr (Int :*: Int) -> UArr Int | Source

Searching

findU :: UA a => (a -> Bool) -> UArr a -> Maybe a | Source

findIndexU :: UA a => (a -> Bool) -> UArr a -> Maybe Int | Source

Conversions to/from lists

toU :: UA e => [e] -> UArr e | Source

Conversion ----------- Turn a list into a parallel array

fromU :: UA e => UArr e -> [e] | Source

Collect the elements of a parallel array in a list
Unlifted.Sequential arrays

randomU :: (UA a, Random a, RandomGen g) => Int -> g -> UArr a | Source

randomRU :: (UA a, Random a, RandomGen g) => Int -> (a, a) -> g -> UArr a | Source

I/O

class UA a => UIO a where | Source

Methods

hPutU :: Handle -> UArr a -> IO () | Source

hGetU :: Handle -> IO (UArr a) | Source

Instances

UIO Double
UIO Int
(UIO a, UIO b) => UIO (a :*: b)

Segmentation

concatSU :: UA e => SUArr e -> UArr e | Source

Concatenate the subarrays of an array of arrays

flattenSU :: UA e => SUArr e -> UArr e | Source

Yield the flat data array

(>:) :: UA a => USegd -> UArr a -> SUArr a | Source

Compose a nested array.

segmentU :: (UA e', UA e) => SUArr e' -> UArr e -> SUArr e | Source

Segment an array according to the segmentation of the first argument

segmentArrU :: UA e => UArr Int -> UArr e -> SUArr e | Source

Segment an array according to the segmentation of the first argument

segdSU :: UA e => SUArr e -> USegd | Source

Operations on segmented arrays ------------------------------- Yield the segment descriptor
Basic operations (segmented)

lengthSU :: UA e => SUArr e -> Int | Source

Yield the number of segments.

singletonSU :: UA e => UArr e -> SUArr e | Source

Segmentation -------------

replicateSU :: UA e => UArr Int -> UArr e -> SUArr e | Source

replicateCU :: UA e => Int -> UArr e -> SUArr e | Source

Yield a segmented array, where each element contains the same array value

(+:+^) :: UA e => SUArr e -> SUArr e -> SUArr e | Source

Concatenate two arrays FIXME: rename

indexedSU :: UA e => SUArr e -> SUArr (Int :*: e) | Source

Associate each data element with its index

(^+:+^) :: UA a => SUArr a -> SUArr a -> SUArr a | Source

Concatenation --------------

(!:^) :: UA e => SUArr e -> UArr Int -> UArr e | Source

Array indexing
Basic operations lifted

lengthsSU :: UA e => SUArr e -> UArr Int | Source

Yield the lengths of the segments.

indicesSU :: UA e => SUArr e -> UArr Int | Source

Yield the starting indices of the segments.
Zipping (segmented)

fstSU :: (UA a, UA b) => SUArr (a :*: b) -> SUArr a | Source

Zipping --------

sndSU :: (UA a, UA b) => SUArr (a :*: b) -> SUArr b | Source

zipSU :: (UA a, UA b) => SUArr a -> SUArr b -> SUArr (a :*: b) | Source

Permutations (segmented)

bpermuteSU :: UA e => SUArr e -> SUArr Int -> SUArr e | Source

Segmented back permute

bpermuteSU' :: UA e => UArr e -> SUArr Int -> SUArr e | Source

Higher-order operations (segmented)

mapSU :: (UA a, UA b) => (a -> b) -> SUArr a -> SUArr b | Source

zipWithSU :: (UA a, UA b, UA c) => (a -> b -> c) -> SUArr a -> SUArr b -> SUArr c | Source

foldlSU :: (UA a, UA b) => (b -> a -> b) -> b -> SUArr a -> UArr b | Source

Segmented array reduction proceeding from the left

foldSU :: UA a => (a -> a -> a) -> a -> SUArr a -> UArr a | Source

Segmented array reduction that requires an associative combination function with its unit

fold1SU :: UA a => (a -> a -> a) -> SUArr a -> UArr a | Source

Segmented array reduction with non-empty subarrays and an associative combination function
Logical operations (segmented)

andSU :: SUArr Bool -> UArr Bool | Source

orSU :: SUArr Bool -> UArr Bool | Source

Arithmetic operations (segmented)

sumSU :: (Num e, UA e) => SUArr e -> UArr e | Source

Compute the segmented sum of an array of numerals

productSU :: (Num e, UA e) => SUArr e -> UArr e | Source

Compute the segmented product of an array of numerals

maximumSU :: (Ord e, UA e) => SUArr e -> UArr e | Source

Determine the maximum element in each subarray

minimumSU :: (Ord e, UA e) => SUArr e -> UArr e | Source

Determine the minimum element in each subarray
Enumerations (segmented)

enumFromToSU :: (Enum e, UA e) => UArr e -> UArr e -> SUArr e | Source

Enumeration functions ---------------------- Yield a segmented enumerated array

enumFromThenToSU :: (Enum e, UA e) => UArr e -> UArr e -> UArr e -> SUArr e | Source

Yield a segmented enumerated array using a specific step
Conversions to/from lists (segmented)

toSU :: UA e => [[e]] -> SUArr e | Source

Conversion ----------- Turn a nested list into a segmented parallel array

fromSU :: UA e => SUArr e -> [[e]] | Source

Turn a segmented array into a nested list
Segment descriptors

lengthsUSegd :: USegd -> UArr Int | Source

Yield the segment lengths of a segment descriptor

lengthsToUSegd :: UArr Int -> USegd | Source

Convert a length array into a segment descriptor.

toUSegd :: UArr (Int :*: Int) -> USegd | Source

Convert an array of length/index pairs to a segment descriptor.

fromUSegd :: USegd -> UArr (Int :*: Int) | Source

Convert a segment descriptor to an array of length/index pairs.
Mutable arrays

newU :: UA e => Int -> (forall s. MUArr e s -> ST s ()) -> UArr e | Source

Creating unboxed arrays ------------------------

permuteMU :: UA e => MUArr e s -> UArr e -> UArr Int -> ST s () | Source

Permutations -------------

atomicUpdateMU :: UA e => MUArr e s -> UArr (Int :*: e) -> ST s () | Source

unsafeFreezeAllMU :: UA e => MUArr e s -> ST s (UArr e) | Source

Library id
idstr
name
versnum
date
version
copyright
disclaimer

lengthU' :: UA e => UArr e -> Int | Source

FIXME: A fuseable version of lengthU, should go away
Produced by Haddock version 2.4.2