easytensor-0.3.1.0: Pure, type-indexed haskell vector, matrix, and tensor library.

Numeric.Vector

Contents

Description

Synopsis

Type aliases

type Vector t n = DataFrame t '[n] Source #

Common operations

(.*.) :: (Num t, Num (Vector t n), ElementWise (Idx '[n]) t (Vector t n)) => Vector t n -> Vector t n -> Vector t n infixl 7 Source #

Scalar product -- sum of Vecs' components products, propagated into whole Vec

dot :: (Num t, Num (Vector t n), ElementWise (Idx '[n]) t (Vector t n)) => Vector t n -> Vector t n -> Scalar t Source #

Scalar product -- sum of Vecs' components products -- a scalar

· :: (Num t, Num (Vector t n), ElementWise (Idx '[n]) t (Vector t n)) => Vector t n -> Vector t n -> Scalar t infixl 7 Source #

Dot product of two vectors

normL1 :: (Num t, ElementWise (Idx '[n]) t (Vector t n)) => Vector t n -> Scalar t Source #

Sum of absolute values

normL2 :: (Floating t, ElementWise (Idx '[n]) t (Vector t n)) => Vector t n -> Scalar t Source #

hypot function (square root of squares)

normLPInf :: (Ord t, Num t, ElementWise (Idx '[n]) t (Vector t n)) => Vector t n -> Scalar t Source #

Maximum of absolute values

normLNInf :: (Ord t, Num t, ElementWise (Idx '[n]) t (Vector t n)) => Vector t n -> Scalar t Source #

Minimum of absolute values

normLP :: (Floating t, ElementWise (Idx '[n]) t (Vector t n)) => Int -> Vector t n -> Scalar t Source #

Norm in Lp space

normalized :: (Floating t, Fractional (Vector t n), ElementWise (Idx '[n]) t (Vector t n)) => Vector t n -> Vector t n Source #

Normalize vector w.r.t. Euclidean metric (L2).

vec2 :: ElementWise (Idx '[2]) t (Vector t 2) => t -> t -> Vector t 2 Source #

Compose a 2D vector

vec3 :: ElementWise (Idx '[3]) t (Vector t 3) => t -> t -> t -> Vector t 3 Source #

Compose a 3D vector

vec4 :: ElementWise (Idx '[4]) t (Vector t 4) => t -> t -> t -> t -> Vector t 4 Source #

Compose a 3D vector

det2 :: (ElementWise (Idx '[2]) t (Vector t 2), Num t) => Vector t 2 -> Vector t 2 -> Scalar t Source #

Take a determinant of a matrix composed from two 2D vectors. Like a cross product in 2D.

cross :: (ElementWise (Idx '[3]) t (Vector t 3), Num t) => Vector t 3 -> Vector t 3 -> Vector t 3 Source #

Cross product

(×) :: (ElementWise (Idx '[3]) t (Vector t 3), Num t) => Vector t 3 -> Vector t 3 -> Vector t 3 infixl 7 Source #

Cross product for two vectors in 3D

unpackV2 :: ElementWise (Idx '[2]) t (Vector t 2) => Vector t 2 -> (t, t) Source #

unpackV3 :: ElementWise (Idx '[3]) t (Vector t 3) => Vector t 3 -> (t, t, t) Source #

unpackV4 :: ElementWise (Idx '[4]) t (Vector t 4) => Vector t 4 -> (t, t, t, t) Source #