blas-0.5: Bindings to the BLAS librarySource codeContentsIndex
BLAS.Tensor.Mutable
Stabilityexperimental
MaintainerPatrick Perry <patperry@stanford.edu>
Description
Synopsis
class RTensor x i e m => MTensor x i e m where
getMaxSize :: x e -> m Int
setZero :: x e -> m ()
setConstant :: e -> x e -> m ()
canModifyElem :: x e -> i -> m Bool
unsafeWriteElem :: x e -> i -> e -> m ()
unsafeModifyElem :: x e -> i -> (e -> e) -> m ()
modifyWith :: (e -> e) -> x e -> m ()
writeElem :: (MTensor x i e m, Show i) => x e -> i -> e -> m ()
modifyElem :: (MTensor x i e m, Show i) => x e -> i -> (e -> e) -> m ()
Documentation
class RTensor x i e m => MTensor x i e m whereSource
Class for modifiable mutable tensors.
Methods
getMaxSize :: x e -> m IntSource
Get the maximum number of elements that can be stored in the tensor.
setZero :: x e -> m ()Source
Sets all stored elements to zero.
setConstant :: e -> x e -> m ()Source
Sets all stored elements to the given value.
canModifyElem :: x e -> i -> m BoolSource
True if the value at a given index can be changed
unsafeWriteElem :: x e -> i -> e -> m ()Source
Set the value of the element at the given index, without doing any range checking.
unsafeModifyElem :: x e -> i -> (e -> e) -> m ()Source
Modify the value of the element at the given index, without doing any range checking.
modifyWith :: (e -> e) -> x e -> m ()Source
Replace each element by a function applied to it
show/hide Instances
BLAS1 e => MTensor (DVector Mut n) Int e IO
BLAS1 e => MTensor (DVector Mut n) Int e IO
BLAS1 e => MTensor (DVector Mut n) Int e IO
BLAS1 e => MTensor (DMatrix Mut ((,) m n)) ((,) Int Int) e IO
BLAS1 e => MTensor (DMatrix Mut ((,) m n)) ((,) Int Int) e IO
BLAS1 e => MTensor (DMatrix Mut ((,) m n)) ((,) Int Int) e IO
BLAS1 e => MTensor (BMatrix Mut ((,) m n)) ((,) Int Int) e IO
BLAS1 e => MTensor (BMatrix Mut ((,) m n)) ((,) Int Int) e IO
BLAS1 e => MTensor (BMatrix Mut ((,) m n)) ((,) Int Int) e IO
BLAS1 e => MTensor (DiagMatrix Mut ((,) n n)) ((,) Int Int) e IO
BLAS1 e => MTensor (DiagMatrix Mut ((,) n n)) ((,) Int Int) e IO
BLAS1 e => MTensor (DiagMatrix Mut ((,) n n)) ((,) Int Int) e IO
writeElem :: (MTensor x i e m, Show i) => x e -> i -> e -> m ()Source
Set the value of the element at the given index.
modifyElem :: (MTensor x i e m, Show i) => x e -> i -> (e -> e) -> m ()Source
Update the value of the element at the given index.
Produced by Haddock version 2.3.0