HasGP.Support.Linear
Description
HasGP Gaussian Process Library. This module contains assorted functions that support GP calculations and are specifically related to linear algebra.
Copyright (C) 2011 Sean Holden. sbh11@cl.cam.ac.uk.
- sumVector :: DVector -> Double
- sumVectorDiv :: Int -> DVector -> Double
- lengthV :: Normed a b => a b -> RealOf b
- toVector :: Matrix Double -> Vector Double
- replaceInVector :: DVector -> Int -> Double -> DVector
- preMultiply :: DVector -> DMatrix -> DMatrix
- postMultiply :: DMatrix -> DVector -> DMatrix
- xAxDiag :: DVector -> DVector -> Double
- abDiagOnly :: DMatrix -> DMatrix -> DVector
- abaDiagDiag :: DVector -> DMatrix -> DMatrix
- abaVV :: DVector -> DMatrix -> Double
Documentation
sumVectorDiv :: Int -> DVector -> Double
Sum of elements in a vector, divided by an Int.
replaceInVector :: DVector -> Int -> Double -> DVector
Replace the element at a specified position in a vector. NOTE: hmatrix numbers from 0, which is odd. This numbers from 1. The result is returned by overwriting v. This is implemented via runSTVector because the increase in efficiency is HUGE.
preMultiply :: DVector -> DMatrix -> DMatrix
Efficiently pre multiply by a diagonal matrix (passed as a vector)
postMultiply :: DMatrix -> DVector -> DMatrix
Efficiently post multiply by a diagonal matrix (passed as a vector)
xAxDiag :: DVector -> DVector -> Double
Compute x^T A x when A is diagonal. The second argument is the diagonal of A.
abDiagOnly :: DMatrix -> DMatrix -> DVector
Compute the diagonal only of the product of two square matrices
abaDiagDiag :: DVector -> DMatrix -> DMatrix
Compute ABA where A is diagonal. The first argument is the diagonal of A.