Module

LinearAlgebra.Vector

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

#Vector Source

type Vector = Array

Dense Vector implementation

#diff Source

diff :: Vector Number -> Vector Number -> Maybe (Vector Number)

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

#add Source

add :: forall a. Semiring a => Vector a -> Vector a -> Maybe (Vector a)

Add 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

#sum Source

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

Sum vector elements

#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