repa-array-4.2.3.1: Bulk array representations and operators.

Safe HaskellNone
LanguageHaskell98

Data.Repa.Array.Material.Boxed

Contents

Synopsis

Documentation

data B Source #

Layout an array as flat vector of boxed elements.

UNSAFE: Indexing into raw material arrays is not bounds checked. You may want to wrap this with a Checked layout as well.

Constructors

Boxed 

Fields

Instances

Eq B Source # 

Methods

(==) :: B -> B -> Bool #

(/=) :: B -> B -> Bool #

Show B Source # 

Methods

showsPrec :: Int -> B -> ShowS #

show :: B -> String #

showList :: [B] -> ShowS #

Layout B Source #

Boxed arrays.

Associated Types

data Name B :: * Source #

type Index B :: * Source #

Bulk B a Source #

Boxed arrays.

Associated Types

data Array B a :: * Source #

Methods

layout :: Array B a -> B Source #

index :: Array B a -> Index B -> a Source #

Windowable B a Source #

Boxed windows.

Methods

window :: Index B -> Index B -> Array B a -> Array B a Source #

Target B a Source #

Boxed buffers.

Eq (Name B) Source # 

Methods

(==) :: Name B -> Name B -> Bool #

(/=) :: Name B -> Name B -> Bool #

Show (Name B) Source # 

Methods

showsPrec :: Int -> Name B -> ShowS #

show :: Name B -> String #

showList :: [Name B] -> ShowS #

Eq a => Eq (Array B a) Source # 

Methods

(==) :: Array B a -> Array B a -> Bool #

(/=) :: Array B a -> Array B a -> Bool #

Show a => Show (Array B a) Source # 

Methods

showsPrec :: Int -> Array B a -> ShowS #

show :: Array B a -> String #

showList :: [Array B a] -> ShowS #

data Name B Source # 
data Name B = B
type Index B Source # 
type Index B = Int
data Array B Source # 
data Array B = BArray !(Vector a)
data Buffer B Source # 
data Buffer B = BBuffer !(IOVector a)

Conversions

fromBoxed :: Vector a -> Array B a Source #

O(1). Wrap a boxed vector as an array.

toBoxed :: Array B a -> Vector a Source #

O(1). Unwrap a boxed vector from an array.

Utils

decimate :: (a -> a -> Bool) -> Array B a -> Array B a Source #

Scan through an array from front to back. For pairs of successive elements, drop the second one when the given predicate returns true.

This function can be used to remove duplicates from a sorted array.

TODO: generalise to other array types.