lin-alg-0.1.0.3: Low-dimensional matrices and vectors for graphics and physics

Safe HaskellNone
LanguageHaskell98

Numeric.LinearAlgebra.Vector

Synopsis

Documentation

data Vec4 a Source #

Constructors

Vec4 !a !a !a !a 

Instances

Functor Vec4 Source # 

Methods

fmap :: (a -> b) -> Vec4 a -> Vec4 b #

(<$) :: a -> Vec4 b -> Vec4 a #

Vector Vec4 Source # 

Methods

vDim :: Vec4 a -> Int Source #

vElement :: Vec4 a -> Int -> a Source #

vIndexOf :: Ord a => (a -> a -> Bool) -> Vec4 a -> Int Source #

vZip :: (a -> b -> c) -> Vec4 a -> Vec4 b -> Vec4 c Source #

vFold :: (a -> a -> a) -> Vec4 a -> a Source #

Eq a => Eq (Vec4 a) Source # 

Methods

(==) :: Vec4 a -> Vec4 a -> Bool #

(/=) :: Vec4 a -> Vec4 a -> Bool #

Ord a => Ord (Vec4 a) Source # 

Methods

compare :: Vec4 a -> Vec4 a -> Ordering #

(<) :: Vec4 a -> Vec4 a -> Bool #

(<=) :: Vec4 a -> Vec4 a -> Bool #

(>) :: Vec4 a -> Vec4 a -> Bool #

(>=) :: Vec4 a -> Vec4 a -> Bool #

max :: Vec4 a -> Vec4 a -> Vec4 a #

min :: Vec4 a -> Vec4 a -> Vec4 a #

Read a => Read (Vec4 a) Source # 
Show a => Show (Vec4 a) Source # 

Methods

showsPrec :: Int -> Vec4 a -> ShowS #

show :: Vec4 a -> String #

showList :: [Vec4 a] -> ShowS #

data Vec3 a Source #

Constructors

Vec3 !a !a !a 

Instances

Functor Vec3 Source # 

Methods

fmap :: (a -> b) -> Vec3 a -> Vec3 b #

(<$) :: a -> Vec3 b -> Vec3 a #

Vector Vec3 Source # 

Methods

vDim :: Vec3 a -> Int Source #

vElement :: Vec3 a -> Int -> a Source #

vIndexOf :: Ord a => (a -> a -> Bool) -> Vec3 a -> Int Source #

vZip :: (a -> b -> c) -> Vec3 a -> Vec3 b -> Vec3 c Source #

vFold :: (a -> a -> a) -> Vec3 a -> a Source #

(RealFloat a, Unbox a) => Vector Vector (Vec3 a) Source # 

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) (Vec3 a) -> m (Vector (Vec3 a)) #

basicUnsafeThaw :: PrimMonad m => Vector (Vec3 a) -> m (Mutable Vector (PrimState m) (Vec3 a)) #

basicLength :: Vector (Vec3 a) -> Int #

basicUnsafeSlice :: Int -> Int -> Vector (Vec3 a) -> Vector (Vec3 a) #

basicUnsafeIndexM :: Monad m => Vector (Vec3 a) -> Int -> m (Vec3 a) #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) (Vec3 a) -> Vector (Vec3 a) -> m () #

elemseq :: Vector (Vec3 a) -> Vec3 a -> b -> b #

(RealFloat a, Unbox a) => MVector MVector (Vec3 a) Source # 

Methods

basicLength :: MVector s (Vec3 a) -> Int #

basicUnsafeSlice :: Int -> Int -> MVector s (Vec3 a) -> MVector s (Vec3 a) #

basicOverlaps :: MVector s (Vec3 a) -> MVector s (Vec3 a) -> Bool #

basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) (Vec3 a)) #

basicInitialize :: PrimMonad m => MVector (PrimState m) (Vec3 a) -> m () #

basicUnsafeReplicate :: PrimMonad m => Int -> Vec3 a -> m (MVector (PrimState m) (Vec3 a)) #

basicUnsafeRead :: PrimMonad m => MVector (PrimState m) (Vec3 a) -> Int -> m (Vec3 a) #

basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) (Vec3 a) -> Int -> Vec3 a -> m () #

basicClear :: PrimMonad m => MVector (PrimState m) (Vec3 a) -> m () #

basicSet :: PrimMonad m => MVector (PrimState m) (Vec3 a) -> Vec3 a -> m () #

basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) (Vec3 a) -> MVector (PrimState m) (Vec3 a) -> m () #

basicUnsafeMove :: PrimMonad m => MVector (PrimState m) (Vec3 a) -> MVector (PrimState m) (Vec3 a) -> m () #

basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) (Vec3 a) -> Int -> m (MVector (PrimState m) (Vec3 a)) #

Eq a => Eq (Vec3 a) Source # 

Methods

(==) :: Vec3 a -> Vec3 a -> Bool #

(/=) :: Vec3 a -> Vec3 a -> Bool #

Ord a => Ord (Vec3 a) Source # 

Methods

compare :: Vec3 a -> Vec3 a -> Ordering #

(<) :: Vec3 a -> Vec3 a -> Bool #

(<=) :: Vec3 a -> Vec3 a -> Bool #

(>) :: Vec3 a -> Vec3 a -> Bool #

(>=) :: Vec3 a -> Vec3 a -> Bool #

max :: Vec3 a -> Vec3 a -> Vec3 a #

min :: Vec3 a -> Vec3 a -> Vec3 a #

Read a => Read (Vec3 a) Source # 
Show a => Show (Vec3 a) Source # 

Methods

showsPrec :: Int -> Vec3 a -> ShowS #

show :: Vec3 a -> String #

showList :: [Vec3 a] -> ShowS #

(RealFloat a, Unbox a) => Unbox (Vec3 a) Source # 
data MVector s (Vec3 a) Source # 
data MVector s (Vec3 a) = MV_Vec3 (MVector s (a, a, a))
data Vector (Vec3 a) Source # 
data Vector (Vec3 a) = V_Vec3 (Vector (a, a, a))

data Vec2 a Source #

Constructors

Vec2 !a !a 

Instances

Functor Vec2 Source # 

Methods

fmap :: (a -> b) -> Vec2 a -> Vec2 b #

(<$) :: a -> Vec2 b -> Vec2 a #

Vector Vec2 Source # 

Methods

vDim :: Vec2 a -> Int Source #

vElement :: Vec2 a -> Int -> a Source #

vIndexOf :: Ord a => (a -> a -> Bool) -> Vec2 a -> Int Source #

vZip :: (a -> b -> c) -> Vec2 a -> Vec2 b -> Vec2 c Source #

vFold :: (a -> a -> a) -> Vec2 a -> a Source #

Eq a => Eq (Vec2 a) Source # 

Methods

(==) :: Vec2 a -> Vec2 a -> Bool #

(/=) :: Vec2 a -> Vec2 a -> Bool #

Ord a => Ord (Vec2 a) Source # 

Methods

compare :: Vec2 a -> Vec2 a -> Ordering #

(<) :: Vec2 a -> Vec2 a -> Bool #

(<=) :: Vec2 a -> Vec2 a -> Bool #

(>) :: Vec2 a -> Vec2 a -> Bool #

(>=) :: Vec2 a -> Vec2 a -> Bool #

max :: Vec2 a -> Vec2 a -> Vec2 a #

min :: Vec2 a -> Vec2 a -> Vec2 a #

Read a => Read (Vec2 a) Source # 
Show a => Show (Vec2 a) Source # 

Methods

showsPrec :: Int -> Vec2 a -> ShowS #

show :: Vec2 a -> String #

showList :: [Vec2 a] -> ShowS #

class Functor v => Vector v where Source #

Minimal complete definition

vDim, vElement, vIndexOf, vZip, vFold

Methods

vDim :: v a -> Int Source #

vElement :: v a -> Int -> a Source #

vIndexOf :: Ord a => (a -> a -> Bool) -> v a -> Int Source #

vZip :: (a -> b -> c) -> v a -> v b -> v c Source #

vFold :: (a -> a -> a) -> v a -> a Source #

vFold is foldl1'

Instances

Vector Vec2 Source # 

Methods

vDim :: Vec2 a -> Int Source #

vElement :: Vec2 a -> Int -> a Source #

vIndexOf :: Ord a => (a -> a -> Bool) -> Vec2 a -> Int Source #

vZip :: (a -> b -> c) -> Vec2 a -> Vec2 b -> Vec2 c Source #

vFold :: (a -> a -> a) -> Vec2 a -> a Source #

Vector Vec3 Source # 

Methods

vDim :: Vec3 a -> Int Source #

vElement :: Vec3 a -> Int -> a Source #

vIndexOf :: Ord a => (a -> a -> Bool) -> Vec3 a -> Int Source #

vZip :: (a -> b -> c) -> Vec3 a -> Vec3 b -> Vec3 c Source #

vFold :: (a -> a -> a) -> Vec3 a -> a Source #

Vector Vec4 Source # 

Methods

vDim :: Vec4 a -> Int Source #

vElement :: Vec4 a -> Int -> a Source #

vIndexOf :: Ord a => (a -> a -> Bool) -> Vec4 a -> Int Source #

vZip :: (a -> b -> c) -> Vec4 a -> Vec4 b -> Vec4 c Source #

vFold :: (a -> a -> a) -> Vec4 a -> a Source #

vNegate :: (Num a, Vector v) => v a -> v a Source #

(<+>) :: (Num a, Vector v) => v a -> v a -> v a Source #

(<*>) :: (Num a, Vector v) => v a -> v a -> v a Source #

(<->) :: (Num a, Vector v) => v a -> v a -> v a Source #

(</>) :: (Fractional a, Vector v) => v a -> v a -> v a Source #

(<.>) :: (Num a, Vector v) => v a -> v a -> a Source #

(*>) :: (Num a, Vector v) => a -> v a -> v a Source #

(</) :: (Fractional a, Vector v) => v a -> a -> v a Source #

len :: (Floating a, Vector v) => v a -> a Source #

lenSquared :: (Num a, Vector v) => v a -> a Source #

maxVec :: (Ord k, Vector v) => v k -> v k -> v k Source #

minVec :: (Ord k, Vector v) => v k -> v k -> v k Source #

minComponent :: (Ord k, Vector v) => v k -> k Source #

maxComponent :: (Ord k, Vector v) => v k -> k Source #

minAbsComponent :: (Num k, Ord k, Vector v) => v k -> k Source #

maxAbsComponent :: (Num k, Ord k, Vector v) => v k -> k Source #

(<%>) :: Floating a => Vec3 a -> Vec3 a -> Vec3 a Source #

Cross product

unitVector :: (Floating a, Vector v) => v a -> v a Source #

tripleProduct :: Floating a => Vec3 a -> Vec3 a -> Vec3 a -> a Source #