numerical-0.0.0.0: core package for Numerical Haskell project

Safe HaskellNone
LanguageHaskell2010

Numerical.Array.Pure

Documentation

data family ImmArray world rep lay (view :: Locality) (rank :: Nat) el Source #

Instances
(Buffer rep el, Layout (Format lay locality rank rep) rank) => PureArray (ImmArray Native rep lay locality rank) rank el Source # 
Instance details

Defined in Numerical.Array.Pure

Associated Types

type PureArrayAddress (ImmArray Native rep lay locality rank) :: Type Source #

Methods

basicShape :: ImmArray Native rep lay locality rank el -> Index rank Source #

basicSparseIndexToAddress :: address ~ PureArrayAddress (ImmArray Native rep lay locality rank) => ImmArray Native rep lay locality rank el -> Index rank -> Maybe address Source #

basicAddressToIndex :: address ~ PureArrayAddress (ImmArray Native rep lay locality rank) => ImmArray Native rep lay locality rank el -> address -> Index rank Source #

basicAddressRange :: address ~ PureArrayAddress (ImmArray Native rep lay locality rank) => ImmArray Native rep lay locality rank el -> Maybe (Range address) Source #

basicNextAddress :: address ~ PureArrayAddress (ImmArray Native rep lay locality rank) => ImmArray Native rep lay locality rank el -> address -> Maybe address Source #

basicNextIndex :: address ~ PureArrayAddress (ImmArray Native rep lay locality rank) => ImmArray Native rep lay locality rank el -> Index rank -> Maybe address -> Maybe (Index rank, address) Source #

basicUnsafeAddressRead :: (Monad m, address ~ PureArrayAddress (ImmArray Native rep lay locality rank)) => ImmArray Native rep lay locality rank el -> address -> m el Source #

basicUnsafeSparseRead :: Monad m => ImmArray Native rep lay locality rank el -> Index rank -> m (Maybe el) Source #

data ImmArray Native rep lay locality rank el Source # 
Instance details

Defined in Numerical.Array.Pure

data ImmArray Native rep lay locality rank el = ImMutableNativeArray {}
type PureArrayAddress (ImmArray Native rep lay locality rank) Source # 
Instance details

Defined in Numerical.Array.Pure

type PureArrayAddress (ImmArray Native rep lay locality rank) = LayoutAddress (Format lay locality rank rep)

class PureArray arr (rank :: Nat) a | arr -> rank where Source #

Associated Types

type PureArrayAddress (arr :: * -> *) :: * Source #

Methods

basicShape :: arr a -> Index rank Source #

gives the shape, a rank length list of the dimensions

basicSparseIndexToAddress :: address ~ PureArrayAddress arr => arr a -> Index rank -> Maybe address Source #

basicAddressToIndex :: address ~ PureArrayAddress arr => arr a -> address -> Index rank Source #

 

basicAddressRange :: address ~ PureArrayAddress arr => arr a -> Maybe (Range address) Source #

return the Range of valid logical addresses

basicNextAddress :: address ~ PureArrayAddress arr => arr a -> address -> Maybe address Source #

gives the next valid logical address undefined on invalid addresses and the greatest valid address. Note that for invalid addresses in between minAddress and maxAddress, will return the next valid address

basicNextIndex :: address ~ PureArrayAddress arr => arr a -> Index rank -> Maybe address -> Maybe (Index rank, address) Source #

gives the next valid array index undefined on invalid indices and the greatest valid index

basicUnsafeAddressRead :: (Monad m, address ~ PureArrayAddress arr) => arr a -> address -> m a Source #

for a given valid address, basicAddressRegion addr will return an AddressInterval that contains addr. This will be a singleton when the "maximal uniform stride interval" containing addr has strictly less than 3 elements. Otherwise will return an Address range covering the maximal interval that will have cardinality at least 3.

basicUnsafeSparseRead :: Monad m => arr a -> Index rank -> m (Maybe a) Source #

Yield the element at the given position. This method should not be called directly, use unsafeSparseRead instead.

Instances
(Buffer rep el, Layout (Format lay locality rank rep) rank) => PureArray (ImmArray Native rep lay locality rank) rank el Source # 
Instance details

Defined in Numerical.Array.Pure

Associated Types

type PureArrayAddress (ImmArray Native rep lay locality rank) :: Type Source #

Methods

basicShape :: ImmArray Native rep lay locality rank el -> Index rank Source #

basicSparseIndexToAddress :: address ~ PureArrayAddress (ImmArray Native rep lay locality rank) => ImmArray Native rep lay locality rank el -> Index rank -> Maybe address Source #

basicAddressToIndex :: address ~ PureArrayAddress (ImmArray Native rep lay locality rank) => ImmArray Native rep lay locality rank el -> address -> Index rank Source #

basicAddressRange :: address ~ PureArrayAddress (ImmArray Native rep lay locality rank) => ImmArray Native rep lay locality rank el -> Maybe (Range address) Source #

basicNextAddress :: address ~ PureArrayAddress (ImmArray Native rep lay locality rank) => ImmArray Native rep lay locality rank el -> address -> Maybe address Source #

basicNextIndex :: address ~ PureArrayAddress (ImmArray Native rep lay locality rank) => ImmArray Native rep lay locality rank el -> Index rank -> Maybe address -> Maybe (Index rank, address) Source #

basicUnsafeAddressRead :: (Monad m, address ~ PureArrayAddress (ImmArray Native rep lay locality rank)) => ImmArray Native rep lay locality rank el -> address -> m el Source #

basicUnsafeSparseRead :: Monad m => ImmArray Native rep lay locality rank el -> Index rank -> m (Maybe el) Source #

class PureArray arr rank a => PureDenseArray arr rank a where Source #

Methods

basicIndexInBounds :: arr a -> Index rank -> Bool Source #

basicIndexInBounds is an O(1) bounds check.

basicUnsafeAddressDenseRead :: (address ~ PureArrayAddress arr, Monad m) => arr a -> address -> m a Source #

 

basicUnsafeDenseReadM :: Monad m => arr a -> Index rank -> m a Source #

Yield the element at the given position. This method should not be called directly, use unsafeRead instead.