blas-0.6: Bindings to the BLAS librarySource codeContentsIndex
BLAS.Tensor.Read
Stabilityexperimental
MaintainerPatrick Perry <patperry@stanford.edu>
Description
Synopsis
class (BaseTensor x i, Monad m) => ReadTensor x i m | x -> i where
getSize :: x n e -> m Int
unsafeReadElem :: Elem e => x n e -> i -> m e
getIndices :: x n e -> m [i]
getIndices' :: x n e -> m [i]
getElems :: Elem e => x n e -> m [e]
getElems' :: Elem e => x n e -> m [e]
getAssocs :: Elem e => x n e -> m [(i, e)]
getAssocs' :: Elem e => x n e -> m [(i, e)]
readElem :: (ReadTensor x i m, Elem e) => x n e -> i -> m e
Documentation
class (BaseTensor x i, Monad m) => ReadTensor x i m | x -> i whereSource
Class for mutable read-only tensors.
Methods
getSize :: x n e -> m IntSource
Get the number of elements stored in the tensor.
unsafeReadElem :: Elem e => x n e -> i -> m eSource
Get the value at the specified index, without doing any range-checking.
getIndices :: x n e -> m [i]Source
Returns a lazy list of the indices in the tensor. Because of the laziness, this function should be used with care. See also getIndices'.
getIndices' :: x n e -> m [i]Source
Returns a list of the indices in the tensor. See also getIndices.
getElems :: Elem e => x n e -> m [e]Source
Returns a lazy list of the elements in the tensor. Because of the laziness, this function should be used with care. See also getElems'.
getElems' :: Elem e => x n e -> m [e]Source
Returns a list of the elements in the tensor. See also getElems.
getAssocs :: Elem e => x n e -> m [(i, e)]Source
Returns a lazy list of the elements-index pairs in the tensor. Because of the laziness, this function should be used with care. See also getAssocs'.
getAssocs' :: Elem e => x n e -> m [(i, e)]Source
Returns a list of the index-elements pairs in the tensor. See also getAssocs.
show/hide Instances
readElem :: (ReadTensor x i m, Elem e) => x n e -> i -> m eSource
Gets the value at the specified index after checking that the argument is in bounds.
Produced by Haddock version 2.3.0