PrimitiveArray-0.4.0.0: Efficient multidimensional arrays

Safe HaskellNone

Data.ExtShape

Description

Additional functions on shapes

Synopsis

Documentation

class (Eq sh, Shape sh) => ExtShape sh whereSource

A number of additional operations that are useful together with PrimitiveArrays.

Methods

subDim :: sh -> sh -> shSource

subtract the right coordinates from the left. Does not check if the resulting shape make sense.

rangeList :: sh -> sh -> [sh]Source

Given an index and an extend, return a list of all indices. For rangeList (Z:.3) (Z:.2) this returns [(Z:.3), (Z:.4), (Z:.5)].

Instances

ExtShape Z 
(Eq (:. sh Int), Shape (:. sh Int), ExtShape sh) => ExtShape (:. sh Int)