blas-0.6: Bindings to the BLAS librarySource codeContentsIndex
Data.Vector.Dense
Stabilityexperimental
MaintainerPatrick Perry <patperry@stanford.edu>
Contents
The Vector type
Vector shape
Conjugating vectors
Creating new vectors
Reading vector elements
Special vectors
Vector views
Vector properties
Low-level vector properties
Converting between mutable and immutable vectors
Description
Synopsis
coerceVector :: BaseVector x => x n e -> x n' e
module BLAS.Tensor.Base
module BLAS.Conj
vector :: BLAS1 e => Int -> [(Int, e)] -> Vector n e
listVector :: BLAS1 e => Int -> [e] -> Vector n e
unsafeVector :: BLAS1 e => Int -> [(Int, e)] -> Vector n e
module BLAS.Tensor.Immutable
zeroVector :: BLAS1 e => Int -> Vector n e
constantVector :: BLAS1 e => Int -> e -> Vector n e
basisVector :: BLAS1 e => Int -> Int -> Vector n e
subvector :: (BaseVector x, Storable e) => x n e -> Int -> Int -> x n' e
subvectorWithStride :: (BaseVector x, Storable e) => Int -> x n e -> Int -> Int -> x n' e
sumAbs :: BLAS1 e => Vector n e -> Double
norm2 :: BLAS1 e => Vector n e -> Double
whichMaxAbs :: BLAS1 e => Vector n e -> (Int, e)
(<.>) :: BLAS1 e => Vector n e -> Vector n e -> e
The Vector type
Vector shape
coerceVector :: BaseVector x => x n e -> x n' eSource
Cast the shape type of the vector.
module BLAS.Tensor.Base
Conjugating vectors
module BLAS.Conj
Creating new vectors
vector :: BLAS1 e => Int -> [(Int, e)] -> Vector n eSource
Create a vector with the given dimension and elements. The elements given in the association list must all have unique indices, otherwise the result is undefined.
listVector :: BLAS1 e => Int -> [e] -> Vector n eSource
Create a vector of the given dimension with elements initialized to the values from the list. listVector n es is equivalent to vector n (zip [0..(n-1)] es), except that the result is undefined if length es is less than n.
unsafeVector :: BLAS1 e => Int -> [(Int, e)] -> Vector n eSource
Same as vector, but does not range-check the indices.
Reading vector elements
module BLAS.Tensor.Immutable
Special vectors
zeroVector :: BLAS1 e => Int -> Vector n eSource
zeroVector n creates a vector of dimension n with all values set to zero.
constantVector :: BLAS1 e => Int -> e -> Vector n eSource
constantVector n e creates a vector of dimension n with all values set to e.
basisVector :: BLAS1 e => Int -> Int -> Vector n eSource
basisVector n i creates a vector of dimension n with zeros everywhere but position i, where there is a one.
Vector views
subvector :: (BaseVector x, Storable e) => x n e -> Int -> Int -> x n' eSource
subvector x o n creates a subvector view of x starting at index o and having length n.
subvectorWithStride :: (BaseVector x, Storable e) => Int -> x n e -> Int -> Int -> x n' eSource
subvectorWithStride s x o n creates a subvector view of x starting at index o, having length n and stride s.
Vector properties
sumAbs :: BLAS1 e => Vector n e -> DoubleSource
Compute the sum of absolute values of entries in the vector.
norm2 :: BLAS1 e => Vector n e -> DoubleSource
Compute the 2-norm of a vector.
whichMaxAbs :: BLAS1 e => Vector n e -> (Int, e)Source
Get the index and norm of the element with absulte value. Not valid if any of the vector entries are NaN. Raises an exception if the vector has length 0.
(<.>) :: BLAS1 e => Vector n e -> Vector n e -> eSource
Compute the dot product of two vectors.
Low-level vector properties
Converting between mutable and immutable vectors
Produced by Haddock version 2.3.0