Module

LinearAlgebra.Vector

Package
purescript-linear-algebra
Repository
klangner/purescript-linear-algebra

#Vector Source

type Vector = Array

Dense Vector implementation

#add Source

add :: forall a. Semiring a => Vector a -> Vector a -> Vector a

Add 2 vectors. Vector have to have the same size

#argmax Source

argmax :: Vector Number -> Int

Return index of the first maximum value This function will return 0 index for empty vector

#argmin Source

argmin :: Vector Number -> Int

Return index of the first minimum value This function will return 0 index for empty vector

#diff Source

diff :: Vector Number -> Vector Number -> Vector Number

Difference between 2 vectors. Vector have to have the same size

#dot Source

dot :: forall a. Semiring a => Vector a -> Vector a -> Maybe a

Dot product between 2 vectors https://en.wikipedia.org/wiki/Dot_product

#mulScalar Source

mulScalar :: Number -> Vector Number -> Vector Number

Multiply vector by scalar

#sum Source

sum :: forall a. Semiring a => Vector a -> a

Sum vector elements