blas-0.6: Bindings to the BLAS librarySource codeContentsIndex
BLAS.Tensor.Write
Stabilityexperimental
MaintainerPatrick Perry <patperry@stanford.edu>
Description
Synopsis
class ReadTensor x i m => WriteTensor x i m | x -> m where
getMaxSize :: x n e -> m Int
setZero :: Elem e => x n e -> m ()
setConstant :: Elem e => e -> x n e -> m ()
canModifyElem :: x n e -> i -> m Bool
unsafeWriteElem :: Elem e => x n e -> i -> e -> m ()
unsafeModifyElem :: Elem e => x n e -> i -> (e -> e) -> m ()
modifyWith :: Elem e => (e -> e) -> x n e -> m ()
unsafeSwapElems :: Elem e => x n e -> i -> i -> m ()
doConj :: BLAS1 e => x n e -> m ()
scaleBy :: BLAS1 e => e -> x n e -> m ()
shiftBy :: BLAS1 e => e -> x n e -> m ()
writeElem :: (WriteTensor x i m, Elem e) => x n e -> i -> e -> m ()
modifyElem :: (WriteTensor x i m, Elem e) => x n e -> i -> (e -> e) -> m ()
swapElems :: (WriteTensor x i m, Elem e) => x n e -> i -> i -> m ()
Documentation
class ReadTensor x i m => WriteTensor x i m | x -> m whereSource
Class for modifiable mutable tensors.
Methods
getMaxSize :: x n e -> m IntSource
Get the maximum number of elements that can be stored in the tensor.
setZero :: Elem e => x n e -> m ()Source
Sets all stored elements to zero.
setConstant :: Elem e => e -> x n e -> m ()Source
Sets all stored elements to the given value.
canModifyElem :: x n e -> i -> m BoolSource
True if the value at a given index can be changed
unsafeWriteElem :: Elem e => x n e -> i -> e -> m ()Source
Set the value of the element at the given index, without doing any range checking.
unsafeModifyElem :: Elem e => x n e -> i -> (e -> e) -> m ()Source
Modify the value of the element at the given index, without doing any range checking.
modifyWith :: Elem e => (e -> e) -> x n e -> m ()Source
Replace each element by a function applied to it
unsafeSwapElems :: Elem e => x n e -> i -> i -> m ()Source
Same as swapElem but arguments are not range-checked.
doConj :: BLAS1 e => x n e -> m ()Source
Replace every element with its complex conjugate.
scaleBy :: BLAS1 e => e -> x n e -> m ()Source
Scale every element in the vector by the given value.
shiftBy :: BLAS1 e => e -> x n e -> m ()Source
Add a value to every element in a vector.
show/hide Instances
writeElem :: (WriteTensor x i m, Elem e) => x n e -> i -> e -> m ()Source
Set the value of the element at the given index.
modifyElem :: (WriteTensor x i m, Elem e) => x n e -> i -> (e -> e) -> m ()Source
Update the value of the element at the given index.
swapElems :: (WriteTensor x i m, Elem e) => x n e -> i -> i -> m ()Source
Swap the values stored at two positions in the tensor.
Produced by Haddock version 2.3.0