hgeometry-0.12.0.1: Geometric Algorithms, Data structures, and Data types.
Copyright(C) Frank Staals
Licensesee the LICENSE file
MaintainerFrank Staals
Safe HaskellNone
LanguageHaskell2010

Data.Geometry.Vector.VectorFamilyPeano

Description

 
Synopsis

Documentation

class (ImplicitPeano d, Arity (FromPeano d)) => ImplicitArity d Source #

Instances

Instances details
(ImplicitPeano d, Arity (FromPeano d)) => ImplicitArity d Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

newtype VectorFamily (d :: PeanoNum) (r :: *) Source #

Datatype representing d dimensional vectors. The default implementation is based n VectorFixed. However, for small vectors we automatically select a more efficient representation.

Constructors

VectorFamily (VectorFamilyF d r) 

Instances

Instances details
ImplicitArity d => Functor (VectorFamily d) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

Methods

fmap :: (a -> b) -> VectorFamily d a -> VectorFamily d b #

(<$) :: a -> VectorFamily d b -> VectorFamily d a #

ImplicitArity d => Applicative (VectorFamily d) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

Methods

pure :: a -> VectorFamily d a #

(<*>) :: VectorFamily d (a -> b) -> VectorFamily d a -> VectorFamily d b #

liftA2 :: (a -> b -> c) -> VectorFamily d a -> VectorFamily d b -> VectorFamily d c #

(*>) :: VectorFamily d a -> VectorFamily d b -> VectorFamily d b #

(<*) :: VectorFamily d a -> VectorFamily d b -> VectorFamily d a #

ImplicitArity d => Foldable (VectorFamily d) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

Methods

fold :: Monoid m => VectorFamily d m -> m #

foldMap :: Monoid m => (a -> m) -> VectorFamily d a -> m #

foldMap' :: Monoid m => (a -> m) -> VectorFamily d a -> m #

foldr :: (a -> b -> b) -> b -> VectorFamily d a -> b #

foldr' :: (a -> b -> b) -> b -> VectorFamily d a -> b #

foldl :: (b -> a -> b) -> b -> VectorFamily d a -> b #

foldl' :: (b -> a -> b) -> b -> VectorFamily d a -> b #

foldr1 :: (a -> a -> a) -> VectorFamily d a -> a #

foldl1 :: (a -> a -> a) -> VectorFamily d a -> a #

toList :: VectorFamily d a -> [a] #

null :: VectorFamily d a -> Bool #

length :: VectorFamily d a -> Int #

elem :: Eq a => a -> VectorFamily d a -> Bool #

maximum :: Ord a => VectorFamily d a -> a #

minimum :: Ord a => VectorFamily d a -> a #

sum :: Num a => VectorFamily d a -> a #

product :: Num a => VectorFamily d a -> a #

ImplicitArity d => Traversable (VectorFamily d) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

Methods

traverse :: Applicative f => (a -> f b) -> VectorFamily d a -> f (VectorFamily d b) #

sequenceA :: Applicative f => VectorFamily d (f a) -> f (VectorFamily d a) #

mapM :: Monad m => (a -> m b) -> VectorFamily d a -> m (VectorFamily d b) #

sequence :: Monad m => VectorFamily d (m a) -> m (VectorFamily d a) #

ImplicitArity d => Eq1 (VectorFamily d) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

Methods

liftEq :: (a -> b -> Bool) -> VectorFamily d a -> VectorFamily d b -> Bool #

ImplicitArity d => Affine (VectorFamily d) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

Associated Types

type Diff (VectorFamily d) :: Type -> Type #

Methods

(.-.) :: Num a => VectorFamily d a -> VectorFamily d a -> Diff (VectorFamily d) a #

(.+^) :: Num a => VectorFamily d a -> Diff (VectorFamily d) a -> VectorFamily d a #

(.-^) :: Num a => VectorFamily d a -> Diff (VectorFamily d) a -> VectorFamily d a #

ImplicitArity d => Metric (VectorFamily d) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

Methods

dot :: Num a => VectorFamily d a -> VectorFamily d a -> a #

quadrance :: Num a => VectorFamily d a -> a #

qd :: Num a => VectorFamily d a -> VectorFamily d a -> a #

distance :: Floating a => VectorFamily d a -> VectorFamily d a -> a #

norm :: Floating a => VectorFamily d a -> a #

signorm :: Floating a => VectorFamily d a -> VectorFamily d a #

ImplicitArity d => Additive (VectorFamily d) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

Methods

zero :: Num a => VectorFamily d a #

(^+^) :: Num a => VectorFamily d a -> VectorFamily d a -> VectorFamily d a #

(^-^) :: Num a => VectorFamily d a -> VectorFamily d a -> VectorFamily d a #

lerp :: Num a => a -> VectorFamily d a -> VectorFamily d a -> VectorFamily d a #

liftU2 :: (a -> a -> a) -> VectorFamily d a -> VectorFamily d a -> VectorFamily d a #

liftI2 :: (a -> b -> c) -> VectorFamily d a -> VectorFamily d b -> VectorFamily d c #

ImplicitArity d => Vector (VectorFamily d) r Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

Methods

construct :: Fun (Peano (Dim (VectorFamily d))) r (VectorFamily d r) #

inspect :: VectorFamily d r -> Fun (Peano (Dim (VectorFamily d))) r b -> b #

basicIndex :: VectorFamily d r -> Int -> r #

(Eq r, ImplicitArity d) => Eq (VectorFamily d r) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

Methods

(==) :: VectorFamily d r -> VectorFamily d r -> Bool #

(/=) :: VectorFamily d r -> VectorFamily d r -> Bool #

(Ord r, ImplicitArity d) => Ord (VectorFamily d r) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

(ImplicitArity d, Show r) => Show (VectorFamily d r) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

(ImplicitPeano d, Hashable r) => Hashable (VectorFamily d r) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

Methods

hashWithSalt :: Int -> VectorFamily d r -> Int #

hash :: VectorFamily d r -> Int #

(ToJSON r, ImplicitArity d) => ToJSON (VectorFamily d r) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

(FromJSON r, ImplicitArity d) => FromJSON (VectorFamily d r) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

(NFData r, ImplicitArity d) => NFData (VectorFamily d r) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

Methods

rnf :: VectorFamily d r -> () #

ImplicitArity d => Ixed (VectorFamily d r) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

type Dim (VectorFamily d) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

type Diff (VectorFamily d) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

type Index (VectorFamily d r) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

type Index (VectorFamily d r) = Int
type IxValue (VectorFamily d r) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

type IxValue (VectorFamily d r) = r

type family VectorFamilyF (d :: PeanoNum) :: * -> * where ... Source #

Mapping between the implementation type, and the actual implementation.

Equations

VectorFamilyF Z = Const () 
VectorFamilyF One = Identity 
VectorFamilyF Two = V2 
VectorFamilyF Three = V3 
VectorFamilyF Four = V4 
VectorFamilyF (Many d) = Vector (FromPeano (Many d)) 

type family FromPeano (d :: PeanoNum) :: Nat where ... Source #

Equations

FromPeano Z = 0 
FromPeano (S d) = 1 + FromPeano d 

type Two = S One Source #