Safe Haskell | Safe-Infered |
---|
Scattered Segment Descriptors.
See Data.Array.Parallel.Unlifted for how this works.
- data USSegd = USSegd {}
- valid :: USSegd -> Bool
- mkUSSegd :: Vector Int -> Vector Int -> USegd -> USSegd
- empty :: USSegd
- singleton :: Int -> USSegd
- fromUSegd :: USegd -> USSegd
- isContiguous :: USSegd -> Bool
- length :: USSegd -> Int
- takeUSegd :: USSegd -> USegd
- takeLengths :: USSegd -> Vector Int
- takeIndices :: USSegd -> Vector Int
- takeElements :: USSegd -> Int
- takeSources :: USSegd -> Vector Int
- takeStarts :: USSegd -> Vector Int
- getSeg :: USSegd -> Int -> (Int, Int, Int, Int)
- appendWith :: USSegd -> Int -> USSegd -> Int -> USSegd
- cullOnVSegids :: Vector Int -> USSegd -> (Vector Int, USSegd)
Types
Scattered Segment Descriptor.
USSegd | |
|
Show USSegd | |
PprPhysical USSegd | Pretty print the physical representation of a |
O(1). Check the internal consistency of a scattered segment descriptor.
Constructors
:: Vector Int | Starting index of each segment in its flat array. |
-> Vector Int | Which array to take each segment from. |
-> USegd | Contiguous segment descriptor. |
-> USSegd |
O(1). Construct a new scattered segment descriptor. All the provided arrays must have the same lengths.
singleton :: Int -> USSegdSource
O(1). Construct a singleton segment descriptor. The single segment covers the given number of elements in a flat array with sourceid 0.
Predicates
isContiguous :: USSegd -> BoolSource
O(1). True when the starts are identical to the usegd indices field and the sources are all 0's.
In this case all the data elements are in one contiguous flat array, and consumers can avoid looking at the real starts and sources fields.
Projections
takeElements :: USSegd -> IntSource
O(1). Yield the total number of elements covered by a USSegd
.
getSeg :: USSegd -> Int -> (Int, Int, Int, Int)Source
O(1). Get the length, segment index, starting index, and source id of a segment.
Operators
:: USSegd | Segment descriptor of first nested array. |
-> Int | Number of flat data arrays used to represent first nested array. |
-> USSegd | Segment descriptor of second nested array. |
-> Int | Number of flat data arrays used to represent second nested array. |
-> USSegd |
O(n). Produce a segment descriptor that describes the result of appending two arrays.