Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Ix
-based API over vector
.
Synopsis
- data IxVector i v = IxVector {}
- type IxUVector i a = IxVector i (Vector a)
- type IxBVector i a = IxVector i (Vector a)
- type IxMUVector s i a = IxVector i (MVector s a)
- type IxMBVector s i a = IxVector i (MVector s a)
- (@!) :: (HasCallStack, Ix i, Vector v a) => IxVector i (v a) -> i -> a
- (@!!) :: (Ix i, Vector v a) => IxVector i (v a) -> i -> a
- (@!?) :: (HasCallStack, Ix i, Vector v a) => IxVector i (v a) -> i -> Maybe a
- (@!!?) :: (Ix i, Vector v a) => IxVector i (v a) -> i -> Maybe a
- lengthIV :: Vector v a => IxVector i (v a) -> Int
- findIndexIV :: (Vector v a, Unindex i) => (a -> Bool) -> IxVector i (v a) -> Maybe i
- findIndicesIV :: (Unindex i, Vector v a, Vector v i, Vector v Int) => (a -> Bool) -> IxVector i (v a) -> v i
- mapIV :: (Unbox a, Unbox b) => (a -> b) -> IxVector i (Vector a) -> IxVector i (Vector b)
- imapIV :: (Unindex i, Unbox a, Unbox b) => (i -> a -> b) -> IxVector i (Vector a) -> IxVector i (Vector b)
- filterIV :: Unbox a => (a -> Bool) -> IxVector i (Vector a) -> Vector a
- ifilterIV :: (Unindex i, Unbox a) => (i -> a -> Bool) -> IxVector i (Vector a) -> Vector a
- indexedIV :: (Unindex i, Unbox a) => IxVector i (Vector a) -> Vector (i, a)
- replicateIV :: (Unindex i, Unbox a) => (i, i) -> a -> IxUVector i a
- zipWithIV :: (Unbox a, Unbox b, Unbox c) => (a -> b -> c) -> IxVector i (Vector a) -> IxVector i (Vector b) -> IxVector i (Vector c)
- accumulateIV :: (Ix i, Unbox i, Unbox a, Unbox b) => (a -> b -> a) -> IxVector i (Vector a) -> IxVector i (Vector (i, b)) -> IxVector i (Vector a)
- createIV :: Vector v a => (forall s. ST s (IxVector i (Mutable v s a))) -> IxVector i (v a)
- generateIV :: (Unindex i, Unbox a) => (i, i) -> (i -> a) -> IxUVector i a
- constructIV :: (Unindex i, Unbox a) => (i, i) -> (IxUVector i a -> i -> a) -> IxUVector i a
- constructMIV :: forall i a m. (Unindex i, PrimMonad m, Unbox a) => (i, i) -> (IxUVector i a -> i -> m a) -> m (Vector a)
- thawIV :: (PrimMonad m, Vector v a) => IxVector i (v a) -> m (IxVector i (Mutable v (PrimState m) a))
- unsafeThawIV :: (PrimMonad m, Vector v a) => IxVector i (v a) -> m (IxVector i (Mutable v (PrimState m) a))
- freezeIV :: (PrimMonad m, Vector v a) => IxVector i (Mutable v (PrimState m) a) -> m (IxVector i (v a))
- unsafeFreezeIV :: (PrimMonad m, Vector v a) => IxVector i (Mutable v (PrimState m) a) -> m (IxVector i (v a))
- newIV :: (Ix i, PrimMonad m, Unbox a) => (i, i) -> a -> m (IxMUVector (PrimState m) i a)
- readIV :: (HasCallStack, Ix i, PrimMonad m, MVector v a) => IxVector i (v (PrimState m) a) -> i -> m a
- readMaybeIV :: (HasCallStack, Ix i, PrimMonad m, MVector v a) => IxVector i (v (PrimState m) a) -> i -> m (Maybe a)
- unsafeReadIV :: (Ix i, PrimMonad m, MVector v a) => IxVector i (v (PrimState m) a) -> i -> m a
- writeIV :: (HasCallStack, Ix i, PrimMonad m, MVector v a) => IxVector i (v (PrimState m) a) -> i -> a -> m ()
- unsafeWriteIV :: (Ix i, PrimMonad m, MVector v a) => IxVector i (v (PrimState m) a) -> i -> a -> m ()
- modifyIV :: (HasCallStack, Ix i, PrimMonad m, MVector v a) => IxVector i (v (PrimState m) a) -> (a -> a) -> i -> m ()
- unsafeModifyIV :: (Ix i, PrimMonad m, MVector v a) => IxVector i (v (PrimState m) a) -> (a -> a) -> i -> m ()
- modifyMIV :: (HasCallStack, Ix i, PrimMonad m, MVector v a) => IxVector i (v (PrimState m) a) -> (a -> m a) -> i -> m ()
- unsafeModifyMIV :: (Ix i, PrimMonad m, MVector v a) => IxVector i (v (PrimState m) a) -> (a -> m a) -> i -> m ()
- swapIV :: (HasCallStack, Ix i, PrimMonad m, MVector v a) => IxVector i (v (PrimState m) a) -> i -> i -> m ()
- unsafeSwapIV :: (Ix i, PrimMonad m, MVector v a) => IxVector i (v (PrimState m) a) -> i -> i -> m ()
- exchangeIV :: (HasCallStack, Ix i, PrimMonad m, MVector v a) => IxVector i (v (PrimState m) a) -> i -> a -> m a
- unsafeExchangeIV :: (Ix i, PrimMonad m, MVector v a) => IxVector i (v (PrimState m) a) -> i -> a -> m a
- cloneIV :: (PrimMonad m, MVector v a) => IxVector i (v (PrimState m) a) -> m (IxVector i (v (PrimState m) a))
- csum2D :: (HasCallStack, Num a, Unbox a) => IxUVector (Int, Int) a -> IxUVector (Int, Int) a
- (@+!) :: (HasCallStack, Num a, Unbox a) => IxUVector (Int, Int) a -> ((Int, Int), (Int, Int)) -> a
Documentation
N-dimensional Vector
or MVector
with Ix
.
type IxMUVector s i a = IxVector i (MVector s a) #
Unboxed IxVector
type notation.
type IxMBVector s i a = IxVector i (MVector s a) #
Boxed IxVector
type notation.
(@!?) :: (HasCallStack, Ix i, Vector v a) => IxVector i (v a) -> i -> Maybe a #
\(O(1)\) Total IxVector
accessor
findIndicesIV :: (Unindex i, Vector v a, Vector v i, Vector v Int) => (a -> Bool) -> IxVector i (v a) -> v i #
\(O(f N)\)
mapIV :: (Unbox a, Unbox b) => (a -> b) -> IxVector i (Vector a) -> IxVector i (Vector b) #
\(O(f N)\)
imapIV :: (Unindex i, Unbox a, Unbox b) => (i -> a -> b) -> IxVector i (Vector a) -> IxVector i (Vector b) #
\(O(f N)\)
ifilterIV :: (Unindex i, Unbox a) => (i -> a -> Bool) -> IxVector i (Vector a) -> Vector a #
\(O(f N)\)
replicateIV :: (Unindex i, Unbox a) => (i, i) -> a -> IxUVector i a #
\(O(N)\)
zipWithIV :: (Unbox a, Unbox b, Unbox c) => (a -> b -> c) -> IxVector i (Vector a) -> IxVector i (Vector b) -> IxVector i (Vector c) #
\(O(f N)\)
accumulateIV :: (Ix i, Unbox i, Unbox a, Unbox b) => (a -> b -> a) -> IxVector i (Vector a) -> IxVector i (Vector (i, b)) -> IxVector i (Vector a) #
\(O(f X)\) Altertnative to accumulate
for IxVector
that share the same bounds.
generateIV :: (Unindex i, Unbox a) => (i, i) -> (i -> a) -> IxUVector i a #
\(O(f N)\) constructN
for IxVector
constructIV :: (Unindex i, Unbox a) => (i, i) -> (IxUVector i a -> i -> a) -> IxUVector i a #
\(O(f N)\) constructN
for IxVector
constructMIV :: forall i a m. (Unindex i, PrimMonad m, Unbox a) => (i, i) -> (IxUVector i a -> i -> m a) -> m (Vector a) #
\(O(f N)\)
thawIV :: (PrimMonad m, Vector v a) => IxVector i (v a) -> m (IxVector i (Mutable v (PrimState m) a)) #
\(O(N)\)
unsafeThawIV :: (PrimMonad m, Vector v a) => IxVector i (v a) -> m (IxVector i (Mutable v (PrimState m) a)) #
\(O(1)\)
freezeIV :: (PrimMonad m, Vector v a) => IxVector i (Mutable v (PrimState m) a) -> m (IxVector i (v a)) #
\(O(N)\)
unsafeFreezeIV :: (PrimMonad m, Vector v a) => IxVector i (Mutable v (PrimState m) a) -> m (IxVector i (v a)) #
\(O(1)\)
newIV :: (Ix i, PrimMonad m, Unbox a) => (i, i) -> a -> m (IxMUVector (PrimState m) i a) #
\(O(N)\)
| Creates a new IxVector
with initial value.
readIV :: (HasCallStack, Ix i, PrimMonad m, MVector v a) => IxVector i (v (PrimState m) a) -> i -> m a #
\(O(1)\) Reads a value from IxVector
.
readMaybeIV :: (HasCallStack, Ix i, PrimMonad m, MVector v a) => IxVector i (v (PrimState m) a) -> i -> m (Maybe a) #
\(O(1)\) Reads a value from IxVector
.
unsafeReadIV :: (Ix i, PrimMonad m, MVector v a) => IxVector i (v (PrimState m) a) -> i -> m a #
\(O(1)\)
writeIV :: (HasCallStack, Ix i, PrimMonad m, MVector v a) => IxVector i (v (PrimState m) a) -> i -> a -> m () #
\(O(1)\)
| Writes a value to IxVector
.
unsafeWriteIV :: (Ix i, PrimMonad m, MVector v a) => IxVector i (v (PrimState m) a) -> i -> a -> m () #
\(O(1)\)
modifyIV :: (HasCallStack, Ix i, PrimMonad m, MVector v a) => IxVector i (v (PrimState m) a) -> (a -> a) -> i -> m () #
\(O(1)\)
unsafeModifyIV :: (Ix i, PrimMonad m, MVector v a) => IxVector i (v (PrimState m) a) -> (a -> a) -> i -> m () #
\(O(1)\)
modifyMIV :: (HasCallStack, Ix i, PrimMonad m, MVector v a) => IxVector i (v (PrimState m) a) -> (a -> m a) -> i -> m () #
\(O(1)\)
unsafeModifyMIV :: (Ix i, PrimMonad m, MVector v a) => IxVector i (v (PrimState m) a) -> (a -> m a) -> i -> m () #
\(O(1)\)
swapIV :: (HasCallStack, Ix i, PrimMonad m, MVector v a) => IxVector i (v (PrimState m) a) -> i -> i -> m () #
\(O(1)\)
unsafeSwapIV :: (Ix i, PrimMonad m, MVector v a) => IxVector i (v (PrimState m) a) -> i -> i -> m () #
\(O(1)\)
exchangeIV :: (HasCallStack, Ix i, PrimMonad m, MVector v a) => IxVector i (v (PrimState m) a) -> i -> a -> m a #
\(O(1)\)
unsafeExchangeIV :: (Ix i, PrimMonad m, MVector v a) => IxVector i (v (PrimState m) a) -> i -> a -> m a #
\(O(1)\)
cloneIV :: (PrimMonad m, MVector v a) => IxVector i (v (PrimState m) a) -> m (IxVector i (v (PrimState m) a)) #
\(O(N)\) Cloning
csum2D :: (HasCallStack, Num a, Unbox a) => IxUVector (Int, Int) a -> IxUVector (Int, Int) a #
\(O(HW)\) Calculates two-dimensional cumulative sum.
WARNING: Can you really allocate/run \(O(HW)\) algorithm?
NOTE: Returns a 2D graph with one-based index with a zero row and a column inserted.