blas-0.4: Bindings to the BLAS librarySource codeContentsIndex
BLAS.Tensor.Immutable
Stabilityexperimental
MaintainerPatrick Perry <patperry@stanford.edu>
Description
Synopsis
class (BLAS1 e, Tensor x i e) => ITensor x i e where
size :: x e -> Int
(//) :: x e -> [(i, e)] -> x e
unsafeAt :: x e -> i -> e
unsafeReplace :: x e -> [(i, e)] -> x e
indices :: x e -> [i]
elems :: x e -> [e]
assocs :: x e -> [(i, e)]
amap :: ITensor x i e' => (e -> e') -> x e -> x e'
azipWith :: (ITensor x i f, ITensor x i g) => (e -> f -> g) -> x e -> x f -> x g
(!) :: (ITensor x i e, Show i) => x e -> i -> e
Documentation
class (BLAS1 e, Tensor x i e) => ITensor x i e whereSource
A class for immutable tensors.
Methods
size :: x e -> IntSource
Get the numer of elements stored in the tensor.
(//) :: x e -> [(i, e)] -> x eSource
Get a new tensor by replacing the elements at the given indices.
unsafeAt :: x e -> i -> eSource
Get the value at the given index, without doing any bounds-checking.
unsafeReplace :: x e -> [(i, e)] -> x eSource
Same as '()' but doesn't do any bounds-checking.
indices :: x e -> [i]Source
Get the indices of the elements stored in the tensor.
elems :: x e -> [e]Source
Get the elements stored in the tensor.
assocs :: x e -> [(i, e)]Source
Get the list of (index, element) pairs stored in the tensor.
amap :: ITensor x i e' => (e -> e') -> x e -> x e'Source
Apply a function elementwise to a tensor.
azipWith :: (ITensor x i f, ITensor x i g) => (e -> f -> g) -> x e -> x f -> x gSource
Apply a function to pairs of elements of tensors that are the same shape.
show/hide Instances
BLAS1 e => ITensor (DVector Imm n) Int e
BLAS1 e => ITensor (DVector Imm n) Int e
BLAS1 e => ITensor (DMatrix Imm ((,) m n)) ((,) Int Int) e
BLAS1 e => ITensor (DMatrix Imm ((,) m n)) ((,) Int Int) e
(!) :: (ITensor x i e, Show i) => x e -> i -> eSource
Get the value at the given index. Range-checks the argument.
Produced by Haddock version 2.3.0