blas-0.4.1: Bindings to the BLAS librarySource codeContentsIndex
Data.Vector.Dense.Operations
Stabilityexperimental
MaintainerPatrick Perry <patperry@stanford.edu>
Contents
Copy and swap
Vector norms and inner products
Pure
Vector arithmetic
Pure
Impure
In-place arithmetic
Unsafe operations
BLAS calls
Description
Synopsis
copyVector :: BLAS1 e => IOVector n e -> DVector t n e -> IO ()
swapVectors :: BLAS1 e => IOVector n e -> IOVector n e -> IO ()
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
getSumAbs :: BLAS1 e => DVector t n e -> IO Double
getNorm2 :: BLAS1 e => DVector t n e -> IO Double
getWhichMaxAbs :: BLAS1 e => DVector t n e -> IO (Int, e)
getDot :: BLAS1 e => DVector s n e -> DVector t n e -> IO e
shift :: BLAS1 e => e -> Vector n e -> Vector n e
scale :: BLAS1 e => e -> Vector n e -> Vector n e
invScale :: BLAS1 e => e -> Vector n e -> Vector n e
add :: BLAS1 e => e -> Vector n e -> e -> Vector n e -> Vector n e
plus :: BLAS1 e => Vector n e -> Vector n e -> Vector n e
minus :: BLAS1 e => Vector n e -> Vector n e -> Vector n e
times :: BLAS2 e => Vector n e -> Vector n e -> Vector n e
divide :: BLAS2 e => Vector n e -> Vector n e -> Vector n e
getShifted :: BLAS1 e => e -> DVector t n e -> IO (DVector r n e)
getScaled :: BLAS1 e => e -> DVector t n e -> IO (DVector r n e)
getInvScaled :: BLAS1 e => e -> DVector t n e -> IO (DVector r n e)
getSum :: BLAS1 e => e -> DVector s n e -> e -> DVector t n e -> IO (DVector r n e)
getDiff :: BLAS1 e => DVector s n e -> DVector t n e -> IO (DVector r n e)
getProduct :: BLAS2 e => DVector s n e -> DVector t n e -> IO (DVector r n e)
getRatio :: BLAS2 e => DVector s n e -> DVector t n e -> IO (DVector r n e)
doConj :: BLAS1 e => IOVector n e -> IO ()
scaleBy :: BLAS1 e => e -> IOVector n e -> IO ()
shiftBy :: BLAS1 e => e -> IOVector n e -> IO ()
invScaleBy :: BLAS1 e => e -> IOVector n e -> IO ()
(+=) :: BLAS1 e => IOVector n e -> DVector t n e -> IO ()
(-=) :: BLAS1 e => IOVector n e -> DVector t n e -> IO ()
(*=) :: BLAS2 e => IOVector n e -> DVector t n e -> IO ()
(//=) :: BLAS2 e => IOVector n e -> DVector t n e -> IO ()
unsafeCopyVector :: BLAS1 e => IOVector n e -> DVector t n e -> IO ()
unsafeSwapVectors :: BLAS1 e => IOVector n e -> IOVector n e -> IO ()
axpy :: BLAS1 e => e -> DVector t n e -> IOVector n e -> IO ()
Copy and swap
copyVector :: BLAS1 e => IOVector n e -> DVector t n e -> IO ()Source
copyVector dst src replaces the elements in dst with the values from src. This may result in a loss of precision.
swapVectors :: BLAS1 e => IOVector n e -> IOVector n e -> IO ()Source
swapVectors x y replaces the elements in x with the values from y, and replaces the elements in y with the values from x. This may result in a loss of precision.
Vector norms and inner products
Pure
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.
getSumAbs :: BLAS1 e => DVector t n e -> IO DoubleSource
Gets the sum of the absolute values of the vector entries.
getNorm2 :: BLAS1 e => DVector t n e -> IO DoubleSource
Gets the 2-norm of a vector.
getWhichMaxAbs :: BLAS1 e => DVector t n e -> IO (Int, e)Source
Gets the index and norm of the element with maximum magnitude. This is undefined if any of the elements are NaN. It will throw an exception if the dimension of the vector is 0.
getDot :: BLAS1 e => DVector s n e -> DVector t n e -> IO eSource
Computes the dot product of two vectors.
Vector arithmetic
Pure
shift :: BLAS1 e => e -> Vector n e -> Vector n eSource
Add a value to every element in a vector.
scale :: BLAS1 e => e -> Vector n e -> Vector n eSource
Scale every element by the given value.
invScale :: BLAS1 e => e -> Vector n e -> Vector n eSource
Divide every element by a value.
add :: BLAS1 e => e -> Vector n e -> e -> Vector n e -> Vector n eSource
plus :: BLAS1 e => Vector n e -> Vector n e -> Vector n eSource
Sum of two vectors.
minus :: BLAS1 e => Vector n e -> Vector n e -> Vector n eSource
Difference of vectors.
times :: BLAS2 e => Vector n e -> Vector n e -> Vector n eSource
Elementwise vector product.
divide :: BLAS2 e => Vector n e -> Vector n e -> Vector n eSource
Elementwise vector ratio.
Impure
getShifted :: BLAS1 e => e -> DVector t n e -> IO (DVector r n e)Source
Create a new vector by adding a value to every element in a vector.
getScaled :: BLAS1 e => e -> DVector t n e -> IO (DVector r n e)Source
Create a new vector by scaling every element by a value. scale'k x is equal to newCopy' (scale k x).
getInvScaled :: BLAS1 e => e -> DVector t n e -> IO (DVector r n e)Source
Create a new vector by dividing every element by a value.
getSum :: BLAS1 e => e -> DVector s n e -> e -> DVector t n e -> IO (DVector r n e)Source
Computes the sum of two vectors.
getDiff :: BLAS1 e => DVector s n e -> DVector t n e -> IO (DVector r n e)Source
Computes the difference of two vectors.
getProduct :: BLAS2 e => DVector s n e -> DVector t n e -> IO (DVector r n e)Source
Computes the elementwise product of two vectors.
getRatio :: BLAS2 e => DVector s n e -> DVector t n e -> IO (DVector r n e)Source
Computes the elementwise ratio of two vectors.
In-place arithmetic
doConj :: BLAS1 e => IOVector n e -> IO ()Source
Replace every element with its complex conjugate. See also conj.
scaleBy :: BLAS1 e => e -> IOVector n e -> IO ()Source
Scale every element in the vector by the given value, and return a view to the scaled vector. See also scale.
shiftBy :: BLAS1 e => e -> IOVector n e -> IO ()Source
Add a value to every element in a vector.
invScaleBy :: BLAS1 e => e -> IOVector n e -> IO ()Source
Divide every element by a value.
(+=) :: BLAS1 e => IOVector n e -> DVector t n e -> IO ()Source
y += x replaces y by y + x.
(-=) :: BLAS1 e => IOVector n e -> DVector t n e -> IO ()Source
y -= x replaces y by y - x.
(*=) :: BLAS2 e => IOVector n e -> DVector t n e -> IO ()Source
y *= x replaces y by x * y, the elementwise product.
(//=) :: BLAS2 e => IOVector n e -> DVector t n e -> IO ()Source
y = x replaces y by y / x, the elementwise ratio.
Unsafe operations
unsafeCopyVector :: BLAS1 e => IOVector n e -> DVector t n e -> IO ()Source
Same as copyVector but does not check the dimensions of the arguments.
unsafeSwapVectors :: BLAS1 e => IOVector n e -> IOVector n e -> IO ()Source
Same as swap but does not check the dimensions of the arguments.
BLAS calls
axpy :: BLAS1 e => e -> DVector t n e -> IOVector n e -> IO ()Source
Produced by Haddock version 2.3.0