blas-0.6: Bindings to the BLAS librarySource codeContentsIndex
BLAS.Tensor.Immutable
Stabilityexperimental
MaintainerPatrick Perry <patperry@stanford.edu>
Description
Synopsis
class BaseTensor x i => ITensor x i where
size :: x n e -> Int
(//) :: BLAS1 e => x n e -> [(i, e)] -> x n e
unsafeAt :: Elem e => x n e -> i -> e
unsafeReplace :: BLAS1 e => x n e -> [(i, e)] -> x n e
indices :: x n e -> [i]
elems :: Elem e => x n e -> [e]
assocs :: Elem e => x n e -> [(i, e)]
tmap :: BLAS1 e => (e -> e) -> x n e -> x n e
(*>) :: BLAS1 e => e -> x n e -> x n e
shift :: BLAS1 e => e -> x n e -> x n e
(!) :: (ITensor x i, Elem e) => x n e -> i -> e
Documentation
class BaseTensor x i => ITensor x i whereSource
A class for immutable tensors.
Methods
size :: x n e -> IntSource
Get the numer of elements stored in the tensor.
(//) :: BLAS1 e => x n e -> [(i, e)] -> x n eSource
Get a new tensor by replacing the elements at the given indices.
unsafeAt :: Elem e => x n e -> i -> eSource
Get the value at the given index, without doing any bounds-checking.
unsafeReplace :: BLAS1 e => x n e -> [(i, e)] -> x n eSource
Same as '()' but doesn't do any bounds-checking.
indices :: x n e -> [i]Source
Get the indices of the elements stored in the tensor.
elems :: Elem e => x n e -> [e]Source
Get the elements stored in the tensor.
assocs :: Elem e => x n e -> [(i, e)]Source
Get the list of (index, element) pairs stored in the tensor.
tmap :: BLAS1 e => (e -> e) -> x n e -> x n eSource
Apply a function elementwise to a tensor.
(*>) :: BLAS1 e => e -> x n e -> x n eSource
Scale every element by the given value.
shift :: BLAS1 e => e -> x n e -> x n eSource
Add a constant to every element.
show/hide Instances
(!) :: (ITensor x i, Elem e) => x n e -> i -> eSource
Get the value at the given index. Range-checks the argument.
Produced by Haddock version 2.3.0