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 -> DoubleSource

Sum of elements in a vector, divided by an Int.

toVector :: Matrix Double -> Vector DoubleSource

Generate a vector equal to the first column of a matrix.

replaceInVector :: DVector -> Int -> Double -> DVectorSource

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 -> DMatrixSource

Efficiently pre multiply by a diagonal matrix (passed as a vector)

postMultiply :: DMatrix -> DVector -> DMatrixSource

Efficiently post multiply by a diagonal matrix (passed as a vector)

xAxDiag :: DVector -> DVector -> DoubleSource

Compute x^T A x when A is diagonal. The second argument is the diagonal of A.

abDiagOnly :: DMatrix -> DMatrix -> DVectorSource

Compute the diagonal only of the product of two square matrices

abaDiagDiag :: DVector -> DMatrix -> DMatrixSource

Compute ABA where A is diagonal. The first argument is the diagonal of A.