Module

# LinearAlgebra.Vector

Package
purescript-linalg
Repository
gbagan/purescript-linalg

### #VectorSource

``newtype Vector a``

#### Instances

• `(Eq a) => Eq (Vector a)`
• `Functor Vector`
• `(Show a) => Show (Vector a)`

### #fromArraySource

``fromArray :: forall a. Array a -> Vector a``

### #toArraySource

``toArray :: forall a. Vector a -> Array a``

### #fromFunctionSource

``fromFunction :: forall a. Int -> (Int -> a) -> Vector a``

### #nullSource

``null :: forall a. Eq a => Semiring a => Vector a -> Boolean``

tests if the vector is null i.e. contains only zero values

### #indexSource

``index :: forall a. Semiring a => Vector a -> Int -> a``

returns the element at index i returns zero if the index are not valid

### #index'Source

``index' :: forall a. Vector a -> Int -> Maybe a``

### #mapWithIndexSource

``mapWithIndex :: forall a b. (Int -> a -> b) -> Vector a -> Vector b``

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

### #diffSource

``diff :: forall a. Ring a => Vector a -> Vector a -> Vector a``

### #dotSource

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

dot product between two vectors. https://en.wikipedia.org/wiki/Dot_product

### #scaleSource

``scale :: forall a. Semiring a => a -> Vector a -> Vector a``

scalar multiplication

### #oppositeSource

``opposite :: forall a. Ring a => Vector a -> Vector a``

### #colinearSource

``colinear :: forall a. Eq a => Field a => Vector a -> Vector a -> Boolean``

returns true if v1 and v2 are colinear i.e. there exists a scalar n such that v1 = n v2 https://en.wikipedia.org/wiki/Collinearity