linearmap-category-0.6.0.1: Native, complete-ish, matrix-free linear algebra.
Copyright(c) Justus Sagemüller 2021
LicenseGPL v3
Maintainer(@) jsag $ hvl.no
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Math.LinearMap.Category.Instances.Deriving

Description

 
Synopsis

Documentation

makeLinearSpaceFromBasis :: Q Type -> DecsQ Source #

Given a type V that is already a VectorSpace and HasBasis, generate the other class instances that are needed to use the type with this library.

Prerequisites: (these can often be derived automatically, using either the newtype / via strategy or generics / anyclass)

instance AdditiveGroup V

instance VectorSpace V where
  type Scalar V = -- a simple number type, usually Double

instance HasBasis V where
  type Basis V = -- a type with an instance of HasTrie

Note that the Basis does not need to be orthonormal – in fact it is not necessary to have a scalar product (i.e. an InnerSpace instance) at all.

The macro, invoked like makeLinearSpaceFromBasis [t| V |]

will then generate V-instances for the classes Semimanifold, PseudoAffine, AffineSpace, TensorSpace and LinearSpace.

It also works on parameterised types, in that case you need to use universal-quantification syntax, e.g.

makeLinearSpaceFromBasis [t| ∀ n . (KnownNat n) => V n |]

copyNewtypeInstances :: Q Type -> [Name] -> DecsQ Source #

More powerful version of deriving newtype, specialised to the classes from this package (and of manifolds-core). The DualVector space will be a separate type, even if the type you abstract over is self-dual.

pattern AbstractDualVector :: AbstractLinearSpace v => DualVector (VectorSpaceImplementation v) -> DualVector v Source #

The instantiated classes

class AdditiveGroup (Diff p) => AffineSpace p where #

Minimal complete definition

Nothing

Associated Types

type Diff p #

Associated vector space

type Diff p = GenericDiff p

Methods

(.-.) :: p -> p -> Diff p infix 6 #

Subtract points

(.+^) :: p -> Diff p -> p infixl 6 #

Point plus vector

Instances

Instances details
AffineSpace CDouble 
Instance details

Defined in Data.AffineSpace

Associated Types

type Diff CDouble #

AffineSpace CFloat 
Instance details

Defined in Data.AffineSpace

Associated Types

type Diff CFloat #

AffineSpace CInt 
Instance details

Defined in Data.AffineSpace

Associated Types

type Diff CInt #

Methods

(.-.) :: CInt -> CInt -> Diff CInt #

(.+^) :: CInt -> Diff CInt -> CInt #

AffineSpace CIntMax 
Instance details

Defined in Data.AffineSpace

Associated Types

type Diff CIntMax #

AffineSpace CLLong 
Instance details

Defined in Data.AffineSpace

Associated Types

type Diff CLLong #

AffineSpace CLong 
Instance details

Defined in Data.AffineSpace

Associated Types

type Diff CLong #

Methods

(.-.) :: CLong -> CLong -> Diff CLong #

(.+^) :: CLong -> Diff CLong -> CLong #

AffineSpace CSChar 
Instance details

Defined in Data.AffineSpace

Associated Types

type Diff CSChar #

AffineSpace CShort 
Instance details

Defined in Data.AffineSpace

Associated Types

type Diff CShort #

AffineSpace Integer 
Instance details

Defined in Data.AffineSpace

Associated Types

type Diff Integer #

AffineSpace Double 
Instance details

Defined in Data.AffineSpace

Associated Types

type Diff Double #

AffineSpace Float 
Instance details

Defined in Data.AffineSpace

Associated Types

type Diff Float #

Methods

(.-.) :: Float -> Float -> Diff Float #

(.+^) :: Float -> Diff Float -> Float #

AffineSpace Int 
Instance details

Defined in Data.AffineSpace

Associated Types

type Diff Int #

Methods

(.-.) :: Int -> Int -> Diff Int #

(.+^) :: Int -> Diff Int -> Int #

Integral a => AffineSpace (Ratio a) 
Instance details

Defined in Data.AffineSpace

Associated Types

type Diff (Ratio a) #

Methods

(.-.) :: Ratio a -> Ratio a -> Diff (Ratio a) #

(.+^) :: Ratio a -> Diff (Ratio a) -> Ratio a #

(Num n, Unbox n) => AffineSpace (FinSuppSeq n) 
Instance details

Defined in Data.VectorSpace.Free.FiniteSupportedSequence

Associated Types

type Diff (FinSuppSeq n) #

(Num n, Unbox n) => AffineSpace (SemisparseSuppSeq n) 
Instance details

Defined in Data.VectorSpace.Free.FiniteSupportedSequence

Associated Types

type Diff (SemisparseSuppSeq n) #

(Num n, Unbox n) => AffineSpace (SparseSuppSeq n) 
Instance details

Defined in Data.VectorSpace.Free.FiniteSupportedSequence

Associated Types

type Diff (SparseSuppSeq n) #

(Num n, Unbox n) => AffineSpace (Sequence n) 
Instance details

Defined in Data.VectorSpace.Free.Sequence

Associated Types

type Diff (Sequence n) #

Methods

(.-.) :: Sequence n -> Sequence n -> Diff (Sequence n) #

(.+^) :: Sequence n -> Diff (Sequence n) -> Sequence n #

AdditiveGroup (Needle (VRep x)) => AffineSpace (GenericNeedle x) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Associated Types

type Diff (GenericNeedle x) #

AffineSpace (ZeroDim s) 
Instance details

Defined in Math.Manifold.VectorSpace.ZeroDimensional

Associated Types

type Diff (ZeroDim s) #

Methods

(.-.) :: ZeroDim s -> ZeroDim s -> Diff (ZeroDim s) #

(.+^) :: ZeroDim s -> Diff (ZeroDim s) -> ZeroDim s #

(TensorSpace v, Scalar v ~ s) => AffineSpace (SymmetricTensor s v) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type Diff (SymmetricTensor s v) #

AffineSpace p => AffineSpace (a -> p) 
Instance details

Defined in Data.AffineSpace

Associated Types

type Diff (a -> p) #

Methods

(.-.) :: (a -> p) -> (a -> p) -> Diff (a -> p) #

(.+^) :: (a -> p) -> Diff (a -> p) -> a -> p #

(AffineSpace p, AffineSpace q) => AffineSpace (p, q) 
Instance details

Defined in Data.AffineSpace

Associated Types

type Diff (p, q) #

Methods

(.-.) :: (p, q) -> (p, q) -> Diff (p, q) #

(.+^) :: (p, q) -> Diff (p, q) -> (p, q) #

AffineSpace a => AffineSpace (Rec0 a s) 
Instance details

Defined in Data.AffineSpace

Associated Types

type Diff (Rec0 a s) #

Methods

(.-.) :: Rec0 a s -> Rec0 a s -> Diff (Rec0 a s) #

(.+^) :: Rec0 a s -> Diff (Rec0 a s) -> Rec0 a s #

(TensorSpace u, TensorSpace v, s ~ Scalar u, s ~ Scalar v) => AffineSpace (LinearFunction s u v) Source # 
Instance details

Defined in Math.LinearMap.Category.Class

Associated Types

type Diff (LinearFunction s u v) #

Methods

(.-.) :: LinearFunction s u v -> LinearFunction s u v -> Diff (LinearFunction s u v) #

(.+^) :: LinearFunction s u v -> Diff (LinearFunction s u v) -> LinearFunction s u v #

(LinearSpace u, TensorSpace v, s ~ Scalar u, s ~ Scalar v) => AffineSpace (LinearMap s u v) Source # 
Instance details

Defined in Math.LinearMap.Category.Class

Associated Types

type Diff (LinearMap s u v) #

Methods

(.-.) :: LinearMap s u v -> LinearMap s u v -> Diff (LinearMap s u v) #

(.+^) :: LinearMap s u v -> Diff (LinearMap s u v) -> LinearMap s u v #

(TensorSpace u, TensorSpace v, s ~ Scalar u, s ~ Scalar v) => AffineSpace (Tensor s u v) Source # 
Instance details

Defined in Math.LinearMap.Category.Class

Associated Types

type Diff (Tensor s u v) #

Methods

(.-.) :: Tensor s u v -> Tensor s u v -> Diff (Tensor s u v) #

(.+^) :: Tensor s u v -> Diff (Tensor s u v) -> Tensor s u v #

(Semimanifold (f p), Semimanifold (g p)) => AffineSpace (NeedleProductSpace f g p) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Associated Types

type Diff (NeedleProductSpace f g p) #

(AffineSpace (f p), AffineSpace (g p)) => AffineSpace (AffineDiffProductSpace f g p) 
Instance details

Defined in Data.AffineSpace

Associated Types

type Diff (AffineDiffProductSpace f g p) #

Methods

(.-.) :: AffineDiffProductSpace f g p -> AffineDiffProductSpace f g p -> Diff (AffineDiffProductSpace f g p) #

(.+^) :: AffineDiffProductSpace f g p -> Diff (AffineDiffProductSpace f g p) -> AffineDiffProductSpace f g p #

(AffineSpace p, AffineSpace q, AffineSpace r) => AffineSpace (p, q, r) 
Instance details

Defined in Data.AffineSpace

Associated Types

type Diff (p, q, r) #

Methods

(.-.) :: (p, q, r) -> (p, q, r) -> Diff (p, q, r) #

(.+^) :: (p, q, r) -> Diff (p, q, r) -> (p, q, r) #

(AffineSpace (f p), AffineSpace (g p)) => AffineSpace ((f :*: g) p) 
Instance details

Defined in Data.AffineSpace

Associated Types

type Diff ((f :*: g) p) #

Methods

(.-.) :: (f :*: g) p -> (f :*: g) p -> Diff ((f :*: g) p) #

(.+^) :: (f :*: g) p -> Diff ((f :*: g) p) -> (f :*: g) p #

AffineSpace (f p) => AffineSpace (M1 i c f p) 
Instance details

Defined in Data.AffineSpace

Associated Types

type Diff (M1 i c f p) #

Methods

(.-.) :: M1 i c f p -> M1 i c f p -> Diff (M1 i c f p) #

(.+^) :: M1 i c f p -> Diff (M1 i c f p) -> M1 i c f p #

class AdditiveGroup (Needle x) => Semimanifold x where #

Minimal complete definition

Nothing

Associated Types

type Needle x #

The space of “ways” starting from some reference point and going to some particular target point. Hence, the name: like a compass needle, but also with an actual length. For affine spaces, Needle is simply the space of line segments (aka vectors) between two points, i.e. the same as Diff. The AffineManifold constraint makes that requirement explicit.

This space should be isomorphic to the tangent space (and in fact serves an in many ways similar role), however whereas the tangent space of a manifold is really infinitesimally small, needles actually allow macroscopic displacements.

Methods

(.+~^) :: x -> Needle x -> x infixl 6 #

Generalisation of the translation operation .+^ to possibly non-flat manifolds, instead of affine spaces.

(.-~^) :: x -> Needle x -> x infixl 6 #

Shorthand for \p v -> p .+~^ negateV v, which should obey the asymptotic law

p .-~^ v .+~^ v ≅ p

Meaning: if v is scaled down with sufficiently small factors η, then the difference (p.-~^v.+~^v) .-~. p should eventually scale down even faster: as O (η²). For large vectors, it may however behave differently, except in flat spaces (where all this should be equivalent to the AffineSpace instance).

semimanifoldWitness :: SemimanifoldWitness x #

Instances

Instances details
Semimanifold Rational 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Associated Types

type Needle Rational #

Semimanifold Double 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Associated Types

type Needle Double #

Semimanifold Float 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Associated Types

type Needle Float #

(Num' n, Unbox n) => Semimanifold (FinSuppSeq n) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type Needle (FinSuppSeq n) #

(Num' n, Unbox n) => Semimanifold (Sequence n) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type Needle (Sequence n) #

Num s => Semimanifold (V0 s) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type Needle (V0 s) #

Methods

(.+~^) :: V0 s -> Needle (V0 s) -> V0 s #

(.-~^) :: V0 s -> Needle (V0 s) -> V0 s #

semimanifoldWitness :: SemimanifoldWitness (V0 s) #

Num s => Semimanifold (V1 s) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type Needle (V1 s) #

Methods

(.+~^) :: V1 s -> Needle (V1 s) -> V1 s #

(.-~^) :: V1 s -> Needle (V1 s) -> V1 s #

semimanifoldWitness :: SemimanifoldWitness (V1 s) #

Num s => Semimanifold (V2 s) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type Needle (V2 s) #

Methods

(.+~^) :: V2 s -> Needle (V2 s) -> V2 s #

(.-~^) :: V2 s -> Needle (V2 s) -> V2 s #

semimanifoldWitness :: SemimanifoldWitness (V2 s) #

Num s => Semimanifold (V3 s) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type Needle (V3 s) #

Methods

(.+~^) :: V3 s -> Needle (V3 s) -> V3 s #

(.-~^) :: V3 s -> Needle (V3 s) -> V3 s #

semimanifoldWitness :: SemimanifoldWitness (V3 s) #

Num s => Semimanifold (V4 s) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type Needle (V4 s) #

Methods

(.+~^) :: V4 s -> Needle (V4 s) -> V4 s #

(.-~^) :: V4 s -> Needle (V4 s) -> V4 s #

semimanifoldWitness :: SemimanifoldWitness (V4 s) #

AdditiveGroup (Needle (VRep x)) => Semimanifold (GenericNeedle x) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Associated Types

type Needle (GenericNeedle x) #

LinearSpace v => Semimanifold (EmptyMfd v) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type Needle (EmptyMfd v) #

ℝeal r => Semimanifold (ℝP¹_ r) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Associated Types

type Needle (ℝP¹_ r) #

Semimanifold (ℝP⁰_ r) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Associated Types

type Needle (ℝP⁰_ r) #

Semimanifold (ZeroDim k) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Associated Types

type Needle (ZeroDim k) #

(TensorSpace v, Scalar v ~ s) => Semimanifold (SymmetricTensor s v) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type Needle (SymmetricTensor s v) #

(Semimanifold a, Semimanifold b) => Semimanifold (a, b) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Associated Types

type Needle (a, b) #

Methods

(.+~^) :: (a, b) -> Needle (a, b) -> (a, b) #

(.-~^) :: (a, b) -> Needle (a, b) -> (a, b) #

semimanifoldWitness :: SemimanifoldWitness (a, b) #

Semimanifold a => Semimanifold (Rec0 a s) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Associated Types

type Needle (Rec0 a s) #

Methods

(.+~^) :: Rec0 a s -> Needle (Rec0 a s) -> Rec0 a s #

(.-~^) :: Rec0 a s -> Needle (Rec0 a s) -> Rec0 a s #

semimanifoldWitness :: SemimanifoldWitness (Rec0 a s) #

VectorSpace w => Semimanifold (LinearFunction s v w) Source # 
Instance details

Defined in Math.LinearMap.Asserted

Associated Types

type Needle (LinearFunction s v w) #

(LinearSpace v, TensorSpace w, Scalar v ~ s, Scalar w ~ s) => Semimanifold (LinearMap s v w) Source # 
Instance details

Defined in Math.LinearMap.Category.Class

Associated Types

type Needle (LinearMap s v w) #

Methods

(.+~^) :: LinearMap s v w -> Needle (LinearMap s v w) -> LinearMap s v w #

(.-~^) :: LinearMap s v w -> Needle (LinearMap s v w) -> LinearMap s v w #

semimanifoldWitness :: SemimanifoldWitness (LinearMap s v w) #

(TensorSpace v, TensorSpace w, Scalar v ~ s, Scalar w ~ s) => Semimanifold (Tensor s v w) Source # 
Instance details

Defined in Math.LinearMap.Category.Class

Associated Types

type Needle (Tensor s v w) #

Methods

(.+~^) :: Tensor s v w -> Needle (Tensor s v w) -> Tensor s v w #

(.-~^) :: Tensor s v w -> Needle (Tensor s v w) -> Tensor s v w #

semimanifoldWitness :: SemimanifoldWitness (Tensor s v w) #

(Semimanifold (f p), Semimanifold (g p)) => Semimanifold (NeedleProductSpace f g p) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Associated Types

type Needle (NeedleProductSpace f g p) #

(Semimanifold a, Semimanifold b, Semimanifold c) => Semimanifold (a, b, c) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Associated Types

type Needle (a, b, c) #

Methods

(.+~^) :: (a, b, c) -> Needle (a, b, c) -> (a, b, c) #

(.-~^) :: (a, b, c) -> Needle (a, b, c) -> (a, b, c) #

semimanifoldWitness :: SemimanifoldWitness (a, b, c) #

(Semimanifold (f p), Semimanifold (g p)) => Semimanifold ((f :*: g) p) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Associated Types

type Needle ((f :*: g) p) #

Methods

(.+~^) :: (f :*: g) p -> Needle ((f :*: g) p) -> (f :*: g) p #

(.-~^) :: (f :*: g) p -> Needle ((f :*: g) p) -> (f :*: g) p #

semimanifoldWitness :: SemimanifoldWitness ((f :*: g) p) #

Semimanifold (f p) => Semimanifold (M1 i c f p) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Associated Types

type Needle (M1 i c f p) #

Methods

(.+~^) :: M1 i c f p -> Needle (M1 i c f p) -> M1 i c f p #

(.-~^) :: M1 i c f p -> Needle (M1 i c f p) -> M1 i c f p #

semimanifoldWitness :: SemimanifoldWitness (M1 i c f p) #

class Semimanifold x => PseudoAffine x where #

This is the class underlying what we understand as manifolds.

The interface is almost identical to the better-known AffineSpace class, but we don't require associativity of .+~^ with ^+^ – except in an asymptotic sense for small vectors.

That innocent-looking change makes the class applicable to vastly more general types: while an affine space is basically nothing but a vector space without particularly designated origin, a pseudo-affine space can have nontrivial topology on the global scale, and yet be used in practically the same way as an affine space. At least the usual spheres and tori make good instances, perhaps the class is in fact equivalent to manifolds in their usual maths definition (with an atlas of charts: a family of overlapping regions of the topological space, each homeomorphic to the Needle vector space or some simply-connected subset thereof).

The Semimanifold and PseudoAffine classes can be anyclass-derived or empty-instantiated based on Generic for product types (including newtypes) of existing PseudoAffine instances. For example, the definition

data Cylinder = CylinderPolar { zCyl :: !D¹, φCyl :: !S¹ }
  deriving (Generic, Semimanifold, PseudoAffine)

is equivalent to

data Cylinder = CylinderPolar { zCyl :: !D¹, φCyl :: !S¹ }

data CylinderNeedle = CylinderPolarNeedle { δzCyl :: !(Needle D¹), δφCyl :: !(Needle S¹) }

instance Semimanifold Cylinder where
  type Needle Cylinder = CylinderNeedle
  CylinderPolar z φ .+~^ CylinderPolarNeedle δz δφ
       = CylinderPolar (z.+~^δz) (φ.+~^δφ)

instance PseudoAffine Cylinder where
  CylinderPolar z₁ φ₁ .-~. CylinderPolar z₀ φ₀
       = CylinderPolarNeedle $ z₁.-~.z₀ * φ₁.-~.φ₀
  CylinderPolar z₁ φ₁ .-~! CylinderPolar z₀ φ₀
       = CylinderPolarNeedle (z₁.-~!z₀) (φ₁.-~.φ₀)

Minimal complete definition

Nothing

Methods

(.-~.) :: x -> x -> Maybe (Needle x) infix 6 #

The path reaching from one point to another. Should only yield Nothing if the points are on disjoint segments of a non–path-connected space.

For a connected manifold, you may define this method as

  p.-~.q = pure (p.-~!q)

(.-~!) :: x -> x -> Needle x infix 6 #

Unsafe version of .-~.. If the two points lie in disjoint regions, the behaviour is undefined.

Whenever p and q lie in a connected region, the identity

p .+~^ (q.-~.p) ≡ q

should hold (up to possible floating point rounding etc.). Meanwhile, you will in general have

(p.+~^v).-~^v ≠ p

(though in many instances this is at least for sufficiently small v approximately equal).

pseudoAffineWitness :: PseudoAffineWitness x #

Instances

Instances details
PseudoAffine Rational 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

PseudoAffine Double 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

PseudoAffine Float 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

(Num' n, Unbox n) => PseudoAffine (FinSuppSeq n) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

(Num' n, Unbox n) => PseudoAffine (Sequence n) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Num s => PseudoAffine (V0 s) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Methods

(.-~.) :: V0 s -> V0 s -> Maybe (Needle (V0 s)) #

(.-~!) :: V0 s -> V0 s -> Needle (V0 s) #

pseudoAffineWitness :: PseudoAffineWitness (V0 s) #

Num s => PseudoAffine (V1 s) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Methods

(.-~.) :: V1 s -> V1 s -> Maybe (Needle (V1 s)) #

(.-~!) :: V1 s -> V1 s -> Needle (V1 s) #

pseudoAffineWitness :: PseudoAffineWitness (V1 s) #

Num s => PseudoAffine (V2 s) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Methods

(.-~.) :: V2 s -> V2 s -> Maybe (Needle (V2 s)) #

(.-~!) :: V2 s -> V2 s -> Needle (V2 s) #

pseudoAffineWitness :: PseudoAffineWitness (V2 s) #

Num s => PseudoAffine (V3 s) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Methods

(.-~.) :: V3 s -> V3 s -> Maybe (Needle (V3 s)) #

(.-~!) :: V3 s -> V3 s -> Needle (V3 s) #

pseudoAffineWitness :: PseudoAffineWitness (V3 s) #

Num s => PseudoAffine (V4 s) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Methods

(.-~.) :: V4 s -> V4 s -> Maybe (Needle (V4 s)) #

(.-~!) :: V4 s -> V4 s -> Needle (V4 s) #

pseudoAffineWitness :: PseudoAffineWitness (V4 s) #

AdditiveGroup (Needle (VRep x)) => PseudoAffine (GenericNeedle x) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

LinearSpace v => PseudoAffine (EmptyMfd v) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

ℝeal r => PseudoAffine (ℝP¹_ r) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

PseudoAffine (ℝP⁰_ r) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

PseudoAffine (ZeroDim k) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

(TensorSpace v, Scalar v ~ s) => PseudoAffine (SymmetricTensor s v) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

(PseudoAffine a, PseudoAffine b) => PseudoAffine (a, b) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Methods

(.-~.) :: (a, b) -> (a, b) -> Maybe (Needle (a, b)) #

(.-~!) :: (a, b) -> (a, b) -> Needle (a, b) #

pseudoAffineWitness :: PseudoAffineWitness (a, b) #

PseudoAffine a => PseudoAffine (Rec0 a s) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Methods

(.-~.) :: Rec0 a s -> Rec0 a s -> Maybe (Needle (Rec0 a s)) #

(.-~!) :: Rec0 a s -> Rec0 a s -> Needle (Rec0 a s) #

pseudoAffineWitness :: PseudoAffineWitness (Rec0 a s) #

VectorSpace w => PseudoAffine (LinearFunction s v w) Source # 
Instance details

Defined in Math.LinearMap.Asserted

(LinearSpace v, TensorSpace w, Scalar v ~ s, Scalar w ~ s) => PseudoAffine (LinearMap s v w) Source # 
Instance details

Defined in Math.LinearMap.Category.Class

Methods

(.-~.) :: LinearMap s v w -> LinearMap s v w -> Maybe (Needle (LinearMap s v w)) #

(.-~!) :: LinearMap s v w -> LinearMap s v w -> Needle (LinearMap s v w) #

pseudoAffineWitness :: PseudoAffineWitness (LinearMap s v w) #

(TensorSpace v, TensorSpace w, Scalar v ~ s, Scalar w ~ s) => PseudoAffine (Tensor s v w) Source # 
Instance details

Defined in Math.LinearMap.Category.Class

Methods

(.-~.) :: Tensor s v w -> Tensor s v w -> Maybe (Needle (Tensor s v w)) #

(.-~!) :: Tensor s v w -> Tensor s v w -> Needle (Tensor s v w) #

pseudoAffineWitness :: PseudoAffineWitness (Tensor s v w) #

(PseudoAffine (f p), PseudoAffine (g p)) => PseudoAffine (NeedleProductSpace f g p) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

(PseudoAffine a, PseudoAffine b, PseudoAffine c) => PseudoAffine (a, b, c) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Methods

(.-~.) :: (a, b, c) -> (a, b, c) -> Maybe (Needle (a, b, c)) #

(.-~!) :: (a, b, c) -> (a, b, c) -> Needle (a, b, c) #

pseudoAffineWitness :: PseudoAffineWitness (a, b, c) #

(PseudoAffine (f p), PseudoAffine (g p)) => PseudoAffine ((f :*: g) p) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Methods

(.-~.) :: (f :*: g) p -> (f :*: g) p -> Maybe (Needle ((f :*: g) p)) #

(.-~!) :: (f :*: g) p -> (f :*: g) p -> Needle ((f :*: g) p) #

pseudoAffineWitness :: PseudoAffineWitness ((f :*: g) p) #

PseudoAffine (f p) => PseudoAffine (M1 i c f p) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Methods

(.-~.) :: M1 i c f p -> M1 i c f p -> Maybe (Needle (M1 i c f p)) #

(.-~!) :: M1 i c f p -> M1 i c f p -> Needle (M1 i c f p) #

pseudoAffineWitness :: PseudoAffineWitness (M1 i c f p) #

class (DimensionAware v, PseudoAffine v) => TensorSpace v where Source #

Associated Types

type TensorProduct v w :: Type Source #

The internal representation of a Tensor product.

For Euclidean spaces, this is generally constructed by replacing each s scalar field in the v vector with an entire w vector. I.e., you have then a “nested vector” or, if v is a DualVector / “row vector”, a matrix.

Methods

scalarSpaceWitness :: ScalarSpaceWitness v Source #

linearManifoldWitness :: LinearManifoldWitness v Source #

zeroTensor :: (TensorSpace w, Scalar w ~ Scalar v) => v w Source #

toFlatTensor :: v -+> (v Scalar v) Source #

fromFlatTensor :: (v Scalar v) -+> v Source #

addTensors :: (TensorSpace w, Scalar w ~ Scalar v) => (v w) -> (v w) -> v w Source #

default addTensors :: AdditiveGroup (TensorProduct v w) => (v w) -> (v w) -> v w Source #

subtractTensors :: (TensorSpace v, TensorSpace w, Scalar w ~ Scalar v) => (v w) -> (v w) -> v w Source #

default subtractTensors :: AdditiveGroup (TensorProduct v w) => (v w) -> (v w) -> v w Source #

scaleTensor :: (TensorSpace w, Scalar w ~ Scalar v) => Bilinear (Scalar v) (v w) (v w) Source #

default scaleTensor :: (VectorSpace (TensorProduct v w), Scalar (TensorProduct v w) ~ Scalar v) => Bilinear (Scalar v) (v w) (v w) Source #

negateTensor :: (TensorSpace w, Scalar w ~ Scalar v) => (v w) -+> (v w) Source #

default negateTensor :: AdditiveGroup (TensorProduct v w) => (v w) -+> (v w) Source #

tensorProduct :: (TensorSpace w, Scalar w ~ Scalar v) => Bilinear v w (v w) Source #

tensorProducts :: (TensorSpace w, Scalar w ~ Scalar v) => [(v, w)] -> v w Source #

transposeTensor :: (TensorSpace w, Scalar w ~ Scalar v) => (v w) -+> (w v) Source #

fmapTensor :: (TensorSpace w, TensorSpace x, Scalar w ~ Scalar v, Scalar x ~ Scalar v) => Bilinear (w -+> x) (v w) (v x) Source #

fzipTensorWith :: (TensorSpace u, TensorSpace w, TensorSpace x, Scalar u ~ Scalar v, Scalar w ~ Scalar v, Scalar x ~ Scalar v) => Bilinear ((w, x) -+> u) (v w, v x) (v u) Source #

tensorUnsafeFromArrayWithOffset :: forall w α n m. (n `Dimensional` v, TensorSpace w, m `Dimensional` w, Scalar w ~ Scalar v, Vector α (Scalar v)) => Int -> α (Scalar v) -> v w Source #

tensorUnsafeWriteArrayWithOffset :: forall w α σ n m. (n `Dimensional` v, TensorSpace w, m `Dimensional` w, Scalar w ~ Scalar v, Vector α (Scalar v)) => Mutable α σ (Scalar v) -> Int -> (v w) -> ST σ () Source #

coerceFmapTensorProduct :: (Functor p, TensorSpace a, Scalar a ~ Scalar v, TensorSpace b, Scalar b ~ Scalar v) => p v -> VSCCoercion (Scalar v) a b -> Coercion (TensorProduct v a) (TensorProduct v b) Source #

wellDefinedVector :: v -> Maybe v Source #

“Sanity-check” a vector. This typically amounts to detecting any NaN components, which should trigger a Nothing result. Otherwise, the result should be Just the input, but may also be optimised / memoised if applicable (i.e. for function spaces).

default wellDefinedVector :: Eq v => v -> Maybe v Source #

wellDefinedTensor :: (TensorSpace w, Scalar w ~ Scalar v) => (v w) -> Maybe (v w) Source #

Instances

Instances details
TensorSpace Rational Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type TensorProduct Rational w Source #

Methods

scalarSpaceWitness :: ScalarSpaceWitness Rational Source #

linearManifoldWitness :: LinearManifoldWitness Rational Source #

zeroTensor :: (TensorSpace w, Scalar w ~ Scalar Rational) => Rational w Source #

toFlatTensor :: Rational -+> (Rational Scalar Rational) Source #

fromFlatTensor :: (Rational Scalar Rational) -+> Rational Source #

addTensors :: (TensorSpace w, Scalar w ~ Scalar Rational) => (Rational w) -> (Rational w) -> Rational w Source #

subtractTensors :: (TensorSpace Rational, TensorSpace w, Scalar w ~ Scalar Rational) => (Rational w) -> (Rational w) -> Rational w Source #

scaleTensor :: (TensorSpace w, Scalar w ~ Scalar Rational) => Bilinear (Scalar Rational) (Rational w) (Rational w) Source #

negateTensor :: (TensorSpace w, Scalar w ~ Scalar Rational) => (Rational w) -+> (Rational w) Source #

tensorProduct :: (TensorSpace w, Scalar w ~ Scalar Rational) => Bilinear Rational w (Rational w) Source #

tensorProducts :: (TensorSpace w, Scalar w ~ Scalar Rational) => [(Rational, w)] -> Rational w Source #

transposeTensor :: (TensorSpace w, Scalar w ~ Scalar Rational) => (Rational w) -+> (w Rational) Source #

fmapTensor :: (TensorSpace w, TensorSpace x, Scalar w ~ Scalar Rational, Scalar x ~ Scalar Rational) => Bilinear (w -+> x) (Rational w) (Rational x) Source #

fzipTensorWith :: (TensorSpace u, TensorSpace w, TensorSpace x, Scalar u ~ Scalar Rational, Scalar w ~ Scalar Rational, Scalar x ~ Scalar Rational) => Bilinear ((w, x) -+> u) (Rational w, Rational x) (Rational u) Source #

tensorUnsafeFromArrayWithOffset :: forall w α (n :: Nat) (m :: Nat). (Dimensional n Rational, TensorSpace w, Dimensional m w, Scalar w ~ Scalar Rational, Vector α (Scalar Rational)) => Int -> α (Scalar Rational) -> Rational w Source #

tensorUnsafeWriteArrayWithOffset :: forall w (α :: Type -> Type) σ (n :: Nat) (m :: Nat). (Dimensional n Rational, TensorSpace w, Dimensional m w, Scalar w ~ Scalar Rational, Vector α (Scalar Rational)) => Mutable α σ (Scalar Rational) -> Int -> (Rational w) -> ST σ () Source #

coerceFmapTensorProduct :: (Functor p, TensorSpace a, Scalar a ~ Scalar Rational, TensorSpace b, Scalar b ~ Scalar Rational) => p Rational -> VSCCoercion (Scalar Rational) a b -> Coercion (TensorProduct Rational a) (TensorProduct Rational b) Source #

wellDefinedVector :: Rational -> Maybe Rational Source #

wellDefinedTensor :: (TensorSpace w, Scalar w ~ Scalar Rational) => (Rational w) -> Maybe (Rational w) Source #

TensorSpace Float Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type TensorProduct Float w Source #

Methods

scalarSpaceWitness :: ScalarSpaceWitness Float Source #

linearManifoldWitness :: LinearManifoldWitness Float Source #

zeroTensor :: (TensorSpace w, Scalar w ~ Scalar Float) => Float w Source #

toFlatTensor :: Float -+> (Float Scalar Float) Source #

fromFlatTensor :: (Float Scalar Float) -+> Float Source #

addTensors :: (TensorSpace w, Scalar w ~ Scalar Float) => (Float w) -> (Float w) -> Float w Source #

subtractTensors :: (TensorSpace Float, TensorSpace w, Scalar w ~ Scalar Float) => (Float w) -> (Float w) -> Float w Source #

scaleTensor :: (TensorSpace w, Scalar w ~ Scalar Float) => Bilinear (Scalar Float) (Float w) (Float w) Source #

negateTensor :: (TensorSpace w, Scalar w ~ Scalar Float) => (Float w) -+> (Float w) Source #

tensorProduct :: (TensorSpace w, Scalar w ~ Scalar Float) => Bilinear Float w (Float w) Source #

tensorProducts :: (TensorSpace w, Scalar w ~ Scalar Float) => [(Float, w)] -> Float w Source #

transposeTensor :: (TensorSpace w, Scalar w ~ Scalar Float) => (Float w) -+> (w Float) Source #

fmapTensor :: (TensorSpace w, TensorSpace x, Scalar w ~ Scalar Float, Scalar x ~ Scalar Float) => Bilinear (w -+> x) (Float w) (Float x) Source #

fzipTensorWith :: (TensorSpace u, TensorSpace w, TensorSpace x, Scalar u ~ Scalar Float, Scalar w ~ Scalar Float, Scalar x ~ Scalar Float) => Bilinear ((w, x) -+> u) (Float w, Float x) (Float u) Source #

tensorUnsafeFromArrayWithOffset :: forall w α (n :: Nat) (m :: Nat). (Dimensional n Float, TensorSpace w, Dimensional m w, Scalar w ~ Scalar Float, Vector α (Scalar Float)) => Int -> α (Scalar Float) -> Float w Source #

tensorUnsafeWriteArrayWithOffset :: forall w (α :: Type -> Type) σ (n :: Nat) (m :: Nat). (Dimensional n Float, TensorSpace w, Dimensional m w, Scalar w ~ Scalar Float, Vector α (Scalar Float)) => Mutable α σ (Scalar Float) -> Int -> (Float w) -> ST σ () Source #

coerceFmapTensorProduct :: (Functor p, TensorSpace a, Scalar a ~ Scalar Float, TensorSpace b, Scalar b ~ Scalar Float) => p Float -> VSCCoercion (Scalar Float) a b -> Coercion (TensorProduct Float a) (TensorProduct Float b) Source #

wellDefinedVector :: Float -> Maybe Float Source #

wellDefinedTensor :: (TensorSpace w, Scalar w ~ Scalar Float) => (Float w) -> Maybe (Float w) Source #

(Num' n, Unbox n) => TensorSpace (FinSuppSeq n) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type TensorProduct (FinSuppSeq n) w Source #

Methods

scalarSpaceWitness :: ScalarSpaceWitness (FinSuppSeq n) Source #

linearManifoldWitness :: LinearManifoldWitness (FinSuppSeq n) Source #

zeroTensor :: (TensorSpace w, Scalar w ~ Scalar (FinSuppSeq n)) => FinSuppSeq n w Source #

toFlatTensor :: FinSuppSeq n -+> (FinSuppSeq n Scalar (FinSuppSeq n)) Source #

fromFlatTensor :: (FinSuppSeq n Scalar (FinSuppSeq n)) -+> FinSuppSeq n Source #

addTensors :: (TensorSpace w, Scalar w ~ Scalar (FinSuppSeq n)) => (FinSuppSeq n w) -> (FinSuppSeq n w) -> FinSuppSeq n w Source #

subtractTensors :: (TensorSpace (FinSuppSeq n), TensorSpace w, Scalar w ~ Scalar (FinSuppSeq n)) => (FinSuppSeq n w) -> (FinSuppSeq n w) -> FinSuppSeq n w Source #

scaleTensor :: (TensorSpace w, Scalar w ~ Scalar (FinSuppSeq n)) => Bilinear (Scalar (FinSuppSeq n)) (FinSuppSeq n w) (FinSuppSeq n w) Source #

negateTensor :: (TensorSpace w, Scalar w ~ Scalar (FinSuppSeq n)) => (FinSuppSeq n w) -+> (FinSuppSeq n w) Source #

tensorProduct :: (TensorSpace w, Scalar w ~ Scalar (FinSuppSeq n)) => Bilinear (FinSuppSeq n) w (FinSuppSeq n w) Source #

tensorProducts :: (TensorSpace w, Scalar w ~ Scalar (FinSuppSeq n)) => [(FinSuppSeq n, w)] -> FinSuppSeq n w Source #

transposeTensor :: (TensorSpace w, Scalar w ~ Scalar (FinSuppSeq n)) => (FinSuppSeq n w) -+> (w FinSuppSeq n) Source #

fmapTensor :: (TensorSpace w, TensorSpace x, Scalar w ~ Scalar (FinSuppSeq n), Scalar x ~ Scalar (FinSuppSeq n)) => Bilinear (w -+> x) (FinSuppSeq n w) (FinSuppSeq n x) Source #

fzipTensorWith :: (TensorSpace u, TensorSpace w, TensorSpace x, Scalar u ~ Scalar (FinSuppSeq n), Scalar w ~ Scalar (FinSuppSeq n), Scalar x ~ Scalar (FinSuppSeq n)) => Bilinear ((w, x) -+> u) (FinSuppSeq n w, FinSuppSeq n x) (FinSuppSeq n u) Source #

tensorUnsafeFromArrayWithOffset :: forall w α (n0 :: Nat) (m :: Nat). (Dimensional n0 (FinSuppSeq n), TensorSpace w, Dimensional m w, Scalar w ~ Scalar (FinSuppSeq n), Vector α (Scalar (FinSuppSeq n))) => Int -> α (Scalar (FinSuppSeq n)) -> FinSuppSeq n w Source #

tensorUnsafeWriteArrayWithOffset :: forall w (α :: Type -> Type) σ (n0 :: Nat) (m :: Nat). (Dimensional n0 (FinSuppSeq n), TensorSpace w, Dimensional m w, Scalar w ~ Scalar (FinSuppSeq n), Vector α (Scalar (FinSuppSeq n))) => Mutable α σ (Scalar (FinSuppSeq n)) -> Int -> (FinSuppSeq n w) -> ST σ () Source #

coerceFmapTensorProduct :: (Functor p, TensorSpace a, Scalar a ~ Scalar (FinSuppSeq n), TensorSpace b, Scalar b ~ Scalar (FinSuppSeq n)) => p (FinSuppSeq n) -> VSCCoercion (Scalar (FinSuppSeq n)) a b -> Coercion (TensorProduct (FinSuppSeq n) a) (TensorProduct (FinSuppSeq n) b) Source #

wellDefinedVector :: FinSuppSeq n -> Maybe (FinSuppSeq n) Source #

wellDefinedTensor :: (TensorSpace w, Scalar w ~ Scalar (FinSuppSeq n)) => (FinSuppSeq n w) -> Maybe (FinSuppSeq n w) Source #

(Num' n, Unbox n) => TensorSpace (Sequence n) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type TensorProduct (Sequence n) w Source #

Methods

scalarSpaceWitness :: ScalarSpaceWitness (Sequence n) Source #

linearManifoldWitness :: LinearManifoldWitness (Sequence n) Source #

zeroTensor :: (TensorSpace w, Scalar w ~ Scalar (Sequence n)) => Sequence n w Source #

toFlatTensor :: Sequence n -+> (Sequence n Scalar (Sequence n)) Source #

fromFlatTensor :: (Sequence n Scalar (Sequence n)) -+> Sequence n Source #

addTensors :: (TensorSpace w, Scalar w ~ Scalar (Sequence n)) => (Sequence n w) -> (Sequence n w) -> Sequence n w Source #

subtractTensors :: (TensorSpace (Sequence n), TensorSpace w, Scalar w ~ Scalar (Sequence n)) => (Sequence n w) -> (Sequence n w) -> Sequence n w Source #

scaleTensor :: (TensorSpace w, Scalar w ~ Scalar (Sequence n)) => Bilinear (Scalar (Sequence n)) (Sequence n w) (Sequence n w) Source #

negateTensor :: (TensorSpace w, Scalar w ~ Scalar (Sequence n)) => (Sequence n w) -+> (Sequence n w) Source #

tensorProduct :: (TensorSpace w, Scalar w ~ Scalar (Sequence n)) => Bilinear (Sequence n) w (Sequence n w) Source #

tensorProducts :: (TensorSpace w, Scalar w ~ Scalar (Sequence n)) => [(Sequence n, w)] -> Sequence n w Source #

transposeTensor :: (TensorSpace w, Scalar w ~ Scalar (Sequence n)) => (Sequence n w) -+> (w Sequence n) Source #

fmapTensor :: (TensorSpace w, TensorSpace x, Scalar w ~ Scalar (Sequence n), Scalar x ~ Scalar (Sequence n)) => Bilinear (w -+> x) (Sequence n w) (Sequence n x) Source #

fzipTensorWith :: (TensorSpace u, TensorSpace w, TensorSpace x, Scalar u ~ Scalar (Sequence n), Scalar w ~ Scalar (Sequence n), Scalar x ~ Scalar (Sequence n)) => Bilinear ((w, x) -+> u) (Sequence n w, Sequence n x) (Sequence n u) Source #

tensorUnsafeFromArrayWithOffset :: forall w α (n0 :: Nat) (m :: Nat). (Dimensional n0 (Sequence n), TensorSpace w, Dimensional m w, Scalar w ~ Scalar (Sequence n), Vector α (Scalar (Sequence n))) => Int -> α (Scalar (Sequence n)) -> Sequence n w Source #

tensorUnsafeWriteArrayWithOffset :: forall w (α :: Type -> Type) σ (n0 :: Nat) (m :: Nat). (Dimensional n0 (Sequence n), TensorSpace w, Dimensional m w, Scalar w ~ Scalar (Sequence n), Vector α (Scalar (Sequence n))) => Mutable α σ (Scalar (Sequence n)) -> Int -> (Sequence n w) -> ST σ () Source #

coerceFmapTensorProduct :: (Functor p, TensorSpace a, Scalar a ~ Scalar (Sequence n), TensorSpace b, Scalar b ~ Scalar (Sequence n)) => p (Sequence n) -> VSCCoercion (Scalar (Sequence n)) a b -> Coercion (TensorProduct (Sequence n) a) (TensorProduct (Sequence n) b) Source #

wellDefinedVector :: Sequence n -> Maybe (Sequence n) Source #

wellDefinedTensor :: (TensorSpace w, Scalar w ~ Scalar (Sequence n)) => (Sequence n w) -> Maybe (Sequence n w) Source #

(Num' s, Eq s) => TensorSpace (V0 s) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type TensorProduct (V0 s) w Source #

Methods

scalarSpaceWitness :: ScalarSpaceWitness (V0 s) Source #

linearManifoldWitness :: LinearManifoldWitness (V0 s) Source #

zeroTensor :: (TensorSpace w, Scalar w ~ Scalar (V0 s)) => V0 s w Source #

toFlatTensor :: V0 s -+> (V0 s Scalar (V0 s)) Source #

fromFlatTensor :: (V0 s Scalar (V0 s)) -+> V0 s Source #

addTensors :: (TensorSpace w, Scalar w ~ Scalar (V0 s)) => (V0 s w) -> (V0 s w) -> V0 s w Source #

subtractTensors :: (TensorSpace (V0 s), TensorSpace w, Scalar w ~ Scalar (V0 s)) => (V0 s w) -> (V0 s w) -> V0 s w Source #

scaleTensor :: (TensorSpace w, Scalar w ~ Scalar (V0 s)) => Bilinear (Scalar (V0 s)) (V0 s w) (V0 s w) Source #

negateTensor :: (TensorSpace w, Scalar w ~ Scalar (V0 s)) => (V0 s w) -+> (V0 s w) Source #

tensorProduct :: (TensorSpace w, Scalar w ~ Scalar (V0 s)) => Bilinear (V0 s) w (V0 s w) Source #

tensorProducts :: (TensorSpace w, Scalar w ~ Scalar (V0 s)) => [(V0 s, w)] -> V0 s w Source #

transposeTensor :: (TensorSpace w, Scalar w ~ Scalar (V0 s)) => (V0 s w) -+> (w V0 s) Source #

fmapTensor :: (TensorSpace w, TensorSpace x, Scalar w ~ Scalar (V0 s), Scalar x ~ Scalar (V0 s)) => Bilinear (w -+> x) (V0 s w) (V0 s x) Source #

fzipTensorWith :: (TensorSpace u, TensorSpace w, TensorSpace x, Scalar u ~ Scalar (V0 s), Scalar w ~ Scalar (V0 s), Scalar x ~ Scalar (V0 s)) => Bilinear ((w, x) -+> u) (V0 s w, V0 s x) (V0 s u) Source #

tensorUnsafeFromArrayWithOffset :: forall w α (n :: Nat) (m :: Nat). (Dimensional n (V0 s), TensorSpace w, Dimensional m w, Scalar w ~ Scalar (V0 s), Vector α (Scalar (V0 s))) => Int -> α (Scalar (V0 s)) -> V0 s w Source #

tensorUnsafeWriteArrayWithOffset :: forall w (α :: Type -> Type) σ (n :: Nat) (m :: Nat). (Dimensional n (V0 s), TensorSpace w, Dimensional m w, Scalar w ~ Scalar (V0 s), Vector α (Scalar (V0 s))) => Mutable α σ (Scalar (V0 s)) -> Int -> (V0 s w) -> ST σ () Source #

coerceFmapTensorProduct :: (Functor p, TensorSpace a, Scalar a ~ Scalar (V0 s), TensorSpace b, Scalar b ~ Scalar (V0 s)) => p (V0 s) -> VSCCoercion (Scalar (V0 s)) a b -> Coercion (TensorProduct (V0 s) a) (TensorProduct (V0 s) b) Source #

wellDefinedVector :: V0 s -> Maybe (V0 s) Source #

wellDefinedTensor :: (TensorSpace w, Scalar w ~ Scalar (V0 s)) => (V0 s w) -> Maybe (V0 s w) Source #

(Num' s, Eq s) => TensorSpace (V1 s) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type TensorProduct (V1 s) w Source #

Methods

scalarSpaceWitness :: ScalarSpaceWitness (V1 s) Source #

linearManifoldWitness :: LinearManifoldWitness (V1 s) Source #

zeroTensor :: (TensorSpace w, Scalar w ~ Scalar (V1 s)) => V1 s w Source #

toFlatTensor :: V1 s -+> (V1 s Scalar (V1 s)) Source #

fromFlatTensor :: (V1 s Scalar (V1 s)) -+> V1 s Source #

addTensors :: (TensorSpace w, Scalar w ~ Scalar (V1 s)) => (V1 s w) -> (V1 s w) -> V1 s w Source #

subtractTensors :: (TensorSpace (V1 s), TensorSpace w, Scalar w ~ Scalar (V1 s)) => (V1 s w) -> (V1 s w) -> V1 s w Source #

scaleTensor :: (TensorSpace w, Scalar w ~ Scalar (V1 s)) => Bilinear (Scalar (V1 s)) (V1 s w) (V1 s w) Source #

negateTensor :: (TensorSpace w, Scalar w ~ Scalar (V1 s)) => (V1 s w) -+> (V1 s w) Source #

tensorProduct :: (TensorSpace w, Scalar w ~ Scalar (V1 s)) => Bilinear (V1 s) w (V1 s w) Source #

tensorProducts :: (TensorSpace w, Scalar w ~ Scalar (V1 s)) => [(V1 s, w)] -> V1 s w Source #

transposeTensor :: (TensorSpace w, Scalar w ~ Scalar (V1 s)) => (V1 s w) -+> (w V1 s) Source #

fmapTensor :: (TensorSpace w, TensorSpace x, Scalar w ~ Scalar (V1 s), Scalar x ~ Scalar (V1 s)) => Bilinear (w -+> x) (V1 s w) (V1 s x) Source #

fzipTensorWith :: (TensorSpace u, TensorSpace w, TensorSpace x, Scalar u ~ Scalar (V1 s), Scalar w ~ Scalar (V1 s), Scalar x ~ Scalar (V1 s)) => Bilinear ((w, x) -+> u) (V1 s w, V1 s x) (V1 s u) Source #

tensorUnsafeFromArrayWithOffset :: forall w α (n :: Nat) (m :: Nat). (Dimensional n (V1 s), TensorSpace w, Dimensional m w, Scalar w ~ Scalar (V1 s), Vector α (Scalar (V1 s))) => Int -> α (Scalar (V1 s)) -> V1 s w Source #

tensorUnsafeWriteArrayWithOffset :: forall w (α :: Type -> Type) σ (n :: Nat) (m :: Nat). (Dimensional n (V1 s), TensorSpace w, Dimensional m w, Scalar w ~ Scalar (V1 s), Vector α (Scalar (V1 s))) => Mutable α σ (Scalar (V1 s)) -> Int -> (V1 s w) -> ST σ () Source #

coerceFmapTensorProduct :: (Functor p, TensorSpace a, Scalar a ~ Scalar (V1 s), TensorSpace b, Scalar b ~ Scalar (V1 s)) => p (V1 s) -> VSCCoercion (Scalar (V1 s)) a b -> Coercion (TensorProduct (V1 s) a) (TensorProduct (V1 s) b) Source #

wellDefinedVector :: V1 s -> Maybe (V1 s) Source #

wellDefinedTensor :: (TensorSpace w, Scalar w ~ Scalar (V1 s)) => (V1 s w) -> Maybe (V1 s w) Source #

(Num' s, Eq s) => TensorSpace (V2 s) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type TensorProduct (V2 s) w Source #

Methods

scalarSpaceWitness :: ScalarSpaceWitness (V2 s) Source #

linearManifoldWitness :: LinearManifoldWitness (V2 s) Source #

zeroTensor :: (TensorSpace w, Scalar w ~ Scalar (V2 s)) => V2 s w Source #

toFlatTensor :: V2 s -+> (V2 s Scalar (V2 s)) Source #

fromFlatTensor :: (V2 s Scalar (V2 s)) -+> V2 s Source #

addTensors :: (TensorSpace w, Scalar w ~ Scalar (V2 s)) => (V2 s w) -> (V2 s w) -> V2 s w Source #

subtractTensors :: (TensorSpace (V2 s), TensorSpace w, Scalar w ~ Scalar (V2 s)) => (V2 s w) -> (V2 s w) -> V2 s w Source #

scaleTensor :: (TensorSpace w, Scalar w ~ Scalar (V2 s)) => Bilinear (Scalar (V2 s)) (V2 s w) (V2 s w) Source #

negateTensor :: (TensorSpace w, Scalar w ~ Scalar (V2 s)) => (V2 s w) -+> (V2 s w) Source #

tensorProduct :: (TensorSpace w, Scalar w ~ Scalar (V2 s)) => Bilinear (V2 s) w (V2 s w) Source #

tensorProducts :: (TensorSpace w, Scalar w ~ Scalar (V2 s)) => [(V2 s, w)] -> V2 s w Source #

transposeTensor :: (TensorSpace w, Scalar w ~ Scalar (V2 s)) => (V2 s w) -+> (w V2 s) Source #

fmapTensor :: (TensorSpace w, TensorSpace x, Scalar w ~ Scalar (V2 s), Scalar x ~ Scalar (V2 s)) => Bilinear (w -+> x) (V2 s w) (V2 s x) Source #

fzipTensorWith :: (TensorSpace u, TensorSpace w, TensorSpace x, Scalar u ~ Scalar (V2 s), Scalar w ~ Scalar (V2 s), Scalar x ~ Scalar (V2 s)) => Bilinear ((w, x) -+> u) (V2 s w, V2 s x) (V2 s u) Source #

tensorUnsafeFromArrayWithOffset :: forall w α (n :: Nat) (m :: Nat). (Dimensional n (V2 s), TensorSpace w, Dimensional m w, Scalar w ~ Scalar (V2 s), Vector α (Scalar (V2 s))) => Int -> α (Scalar (V2 s)) -> V2 s w Source #

tensorUnsafeWriteArrayWithOffset :: forall w (α :: Type -> Type) σ (n :: Nat) (m :: Nat). (Dimensional n (V2 s), TensorSpace w, Dimensional m w, Scalar w ~ Scalar (V2 s), Vector α (Scalar (V2 s))) => Mutable α σ (Scalar (V2 s)) -> Int -> (V2 s w) -> ST σ () Source #

coerceFmapTensorProduct :: (Functor p, TensorSpace a, Scalar a ~ Scalar (V2 s), TensorSpace b, Scalar b ~ Scalar (V2 s)) => p (V2 s) -> VSCCoercion (Scalar (V2 s)) a b -> Coercion (TensorProduct (V2 s) a) (TensorProduct (V2 s) b) Source #

wellDefinedVector :: V2 s -> Maybe (V2 s) Source #

wellDefinedTensor :: (TensorSpace w, Scalar w ~ Scalar (V2 s)) => (V2 s w) -> Maybe (V2 s w) Source #

(Num' s, Eq s) => TensorSpace (V3 s) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type TensorProduct (V3 s) w Source #

Methods

scalarSpaceWitness :: ScalarSpaceWitness (V3 s) Source #

linearManifoldWitness :: LinearManifoldWitness (V3 s) Source #

zeroTensor :: (TensorSpace w, Scalar w ~ Scalar (V3 s)) => V3 s w Source #

toFlatTensor :: V3 s -+> (V3 s Scalar (V3 s)) Source #

fromFlatTensor :: (V3 s Scalar (V3 s)) -+> V3 s Source #

addTensors :: (TensorSpace w, Scalar w ~ Scalar (V3 s)) => (V3 s w) -> (V3 s w) -> V3 s w Source #

subtractTensors :: (TensorSpace (V3 s), TensorSpace w, Scalar w ~ Scalar (V3 s)) => (V3 s w) -> (V3 s w) -> V3 s w Source #

scaleTensor :: (TensorSpace w, Scalar w ~ Scalar (V3 s)) => Bilinear (Scalar (V3 s)) (V3 s w) (V3 s w) Source #

negateTensor :: (TensorSpace w, Scalar w ~ Scalar (V3 s)) => (V3 s w) -+> (V3 s w) Source #

tensorProduct :: (TensorSpace w, Scalar w ~ Scalar (V3 s)) => Bilinear (V3 s) w (V3 s w) Source #

tensorProducts :: (TensorSpace w, Scalar w ~ Scalar (V3 s)) => [(V3 s, w)] -> V3 s w Source #

transposeTensor :: (TensorSpace w, Scalar w ~ Scalar (V3 s)) => (V3 s w) -+> (w V3 s) Source #

fmapTensor :: (TensorSpace w, TensorSpace x, Scalar w ~ Scalar (V3 s), Scalar x ~ Scalar (V3 s)) => Bilinear (w -+> x) (V3 s w) (V3 s x) Source #

fzipTensorWith :: (TensorSpace u, TensorSpace w, TensorSpace x, Scalar u ~ Scalar (V3 s), Scalar w ~ Scalar (V3 s), Scalar x ~ Scalar (V3 s)) => Bilinear ((w, x) -+> u) (V3 s w, V3 s x) (V3 s u) Source #

tensorUnsafeFromArrayWithOffset :: forall w α (n :: Nat) (m :: Nat). (Dimensional n (V3 s), TensorSpace w, Dimensional m w, Scalar w ~ Scalar (V3 s), Vector α (Scalar (V3 s))) => Int -> α (Scalar (V3 s)) -> V3 s w Source #

tensorUnsafeWriteArrayWithOffset :: forall w (α :: Type -> Type) σ (n :: Nat) (m :: Nat). (Dimensional n (V3 s), TensorSpace w, Dimensional m w, Scalar w ~ Scalar (V3 s), Vector α (Scalar (V3 s))) => Mutable α σ (Scalar (V3 s)) -> Int -> (V3 s w) -> ST σ () Source #

coerceFmapTensorProduct :: (Functor p, TensorSpace a, Scalar a ~ Scalar (V3 s), TensorSpace b, Scalar b ~ Scalar (V3 s)) => p (V3 s) -> VSCCoercion (Scalar (V3 s)) a b -> Coercion (TensorProduct (V3 s) a) (TensorProduct (V3 s) b) Source #

wellDefinedVector :: V3 s -> Maybe (V3 s) Source #

wellDefinedTensor :: (TensorSpace w, Scalar w ~ Scalar (V3 s)) => (V3 s w) -> Maybe (V3 s w) Source #

(Num' s, Eq s) => TensorSpace (V4 s) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type TensorProduct (V4 s) w Source #

Methods

scalarSpaceWitness :: ScalarSpaceWitness (V4 s) Source #

linearManifoldWitness :: LinearManifoldWitness (V4 s) Source #

zeroTensor :: (TensorSpace w, Scalar w ~ Scalar (V4 s)) => V4 s w Source #

toFlatTensor :: V4 s -+> (V4 s Scalar (V4 s)) Source #

fromFlatTensor :: (V4 s Scalar (V4 s)) -+> V4 s Source #

addTensors :: (TensorSpace w, Scalar w ~ Scalar (V4 s)) => (V4 s w) -> (V4 s w) -> V4 s w Source #

subtractTensors :: (TensorSpace (V4 s), TensorSpace w, Scalar w ~ Scalar (V4 s)) => (V4 s w) -> (V4 s w) -> V4 s w Source #

scaleTensor :: (TensorSpace w, Scalar w ~ Scalar (V4 s)) => Bilinear (Scalar (V4 s)) (V4 s w) (V4 s w) Source #

negateTensor :: (TensorSpace w, Scalar w ~ Scalar (V4 s)) => (V4 s w) -+> (V4 s w) Source #

tensorProduct :: (TensorSpace w, Scalar w ~ Scalar (V4 s)) => Bilinear (V4 s) w (V4 s w) Source #

tensorProducts :: (TensorSpace w, Scalar w ~ Scalar (V4 s)) => [(V4 s, w)] -> V4 s w Source #

transposeTensor :: (TensorSpace w, Scalar w ~ Scalar (V4 s)) => (V4 s w) -+> (w V4 s) Source #

fmapTensor :: (TensorSpace w, TensorSpace x, Scalar w ~ Scalar (V4 s), Scalar x ~ Scalar (V4 s)) => Bilinear (w -+> x) (V4 s w) (V4 s x) Source #

fzipTensorWith :: (TensorSpace u, TensorSpace w, TensorSpace x, Scalar u ~ Scalar (V4 s), Scalar w ~ Scalar (V4 s), Scalar x ~ Scalar (V4 s)) => Bilinear ((w, x) -+> u) (V4 s w, V4 s x) (V4 s u) Source #

tensorUnsafeFromArrayWithOffset :: forall w α (n :: Nat) (m :: Nat). (Dimensional n (V4 s), TensorSpace w, Dimensional m w, Scalar w ~ Scalar (V4 s), Vector α (Scalar (V4 s))) => Int -> α (Scalar (V4 s)) -> V4 s w Source #

tensorUnsafeWriteArrayWithOffset :: forall w (α :: Type -> Type) σ (n :: Nat) (m :: Nat). (Dimensional n (V4 s), TensorSpace w, Dimensional m w, Scalar w ~ Scalar (V4 s), Vector α (Scalar (V4 s))) => Mutable α σ (Scalar (V4 s)) -> Int -> (V4 s w) -> ST σ () Source #

coerceFmapTensorProduct :: (Functor p, TensorSpace a, Scalar a ~ Scalar (V4 s), TensorSpace b, Scalar b ~ Scalar (V4 s)) => p (V4 s) -> VSCCoercion (Scalar (V4 s)) a b -> Coercion (TensorProduct (V4 s) a) (TensorProduct (V4 s) b) Source #

wellDefinedVector :: V4 s -> Maybe (V4 s) Source #

wellDefinedTensor :: (TensorSpace w, Scalar w ~ Scalar (V4 s)) => (V4 s w) -> Maybe (V4 s w) Source #

(Semimanifold m, TensorSpace (Needle (VRep m)), Scalar (Needle m) ~ Scalar (Needle (VRep m))) => TensorSpace (GenericNeedle m) Source # 
Instance details

Defined in Math.LinearMap.Category.Class

Associated Types

type TensorProduct (GenericNeedle m) w Source #

Methods

scalarSpaceWitness :: ScalarSpaceWitness (GenericNeedle m) Source #

linearManifoldWitness :: LinearManifoldWitness (GenericNeedle m) Source #

zeroTensor :: (TensorSpace w, Scalar w ~ Scalar (GenericNeedle m)) => GenericNeedle m w Source #

toFlatTensor :: GenericNeedle m -+> (GenericNeedle m Scalar (GenericNeedle m)) Source #

fromFlatTensor :: (GenericNeedle m Scalar (GenericNeedle m)) -+> GenericNeedle m Source #

addTensors :: (TensorSpace w, Scalar w ~ Scalar (GenericNeedle m)) => (GenericNeedle m w) -> (GenericNeedle m w) -> GenericNeedle m w Source #

subtractTensors :: (TensorSpace (GenericNeedle m), TensorSpace w, Scalar w ~ Scalar (GenericNeedle m)) => (GenericNeedle m w) -> (GenericNeedle m w) -> GenericNeedle m w Source #

scaleTensor :: (TensorSpace w, Scalar w ~ Scalar (GenericNeedle m)) => Bilinear (Scalar (GenericNeedle m)) (GenericNeedle m w) (GenericNeedle m w) Source #

negateTensor :: (TensorSpace w, Scalar w ~ Scalar (GenericNeedle m)) => (GenericNeedle m w) -+> (GenericNeedle m w) Source #

tensorProduct :: (TensorSpace w, Scalar w ~ Scalar (GenericNeedle m)) => Bilinear (GenericNeedle m) w (GenericNeedle m w) Source #

tensorProducts :: (TensorSpace w, Scalar w ~ Scalar (GenericNeedle m)) => [(GenericNeedle m, w)] -> GenericNeedle m w Source #

transposeTensor :: (TensorSpace w, Scalar w ~ Scalar (GenericNeedle m)) => (GenericNeedle m w) -+> (w GenericNeedle m) Source #

fmapTensor :: (TensorSpace w, TensorSpace x, Scalar w ~ Scalar (GenericNeedle m), Scalar x ~ Scalar (GenericNeedle m)) => Bilinear (w -+> x) (GenericNeedle m w) (GenericNeedle m x) Source #

fzipTensorWith :: (TensorSpace u, TensorSpace w, TensorSpace x, Scalar u ~ Scalar (GenericNeedle m), Scalar w ~ Scalar (GenericNeedle m), Scalar x ~ Scalar (GenericNeedle m)) => Bilinear ((w, x) -+> u) (GenericNeedle m w, GenericNeedle m x) (GenericNeedle m u) Source #

tensorUnsafeFromArrayWithOffset :: forall w α (n :: Nat) (m0 :: Nat). (Dimensional n (GenericNeedle m), TensorSpace w, Dimensional m0 w, Scalar w ~ Scalar (GenericNeedle m), Vector α (Scalar (GenericNeedle m))) => Int -> α (Scalar (GenericNeedle m)) -> GenericNeedle m w Source #

tensorUnsafeWriteArrayWithOffset :: forall w (α :: Type -> Type) σ (n :: Nat) (m0 :: Nat). (Dimensional n (GenericNeedle m), TensorSpace w, Dimensional m0 w, Scalar w ~ Scalar (GenericNeedle m), Vector α (Scalar (GenericNeedle m))) => Mutable α σ (Scalar (GenericNeedle m)) -> Int -> (GenericNeedle m w) -> ST σ () Source #

coerceFmapTensorProduct :: (Functor p, TensorSpace a, Scalar a ~ Scalar (GenericNeedle m), TensorSpace b, Scalar b ~ Scalar (GenericNeedle m)) => p (GenericNeedle m) -> VSCCoercion (Scalar (GenericNeedle m)) a b -> Coercion (TensorProduct (GenericNeedle m) a) (TensorProduct (GenericNeedle m) b) Source #

wellDefinedVector :: GenericNeedle m -> Maybe (GenericNeedle m) Source #

wellDefinedTensor :: (TensorSpace w, Scalar w ~ Scalar (GenericNeedle m)) => (GenericNeedle m w) -> Maybe (GenericNeedle m w) Source #

Num' s => TensorSpace (ZeroDim s) Source # 
Instance details

Defined in Math.LinearMap.Category.Class

Associated Types

type TensorProduct (ZeroDim s) w Source #

Methods

scalarSpaceWitness :: ScalarSpaceWitness (ZeroDim s) Source #

linearManifoldWitness :: LinearManifoldWitness (ZeroDim s) Source #

zeroTensor :: (TensorSpace w, Scalar w ~ Scalar (ZeroDim s)) => ZeroDim s w Source #

toFlatTensor :: ZeroDim s -+> (ZeroDim s Scalar (ZeroDim s)) Source #

fromFlatTensor :: (ZeroDim s Scalar (ZeroDim s)) -+> ZeroDim s Source #

addTensors :: (TensorSpace w, Scalar w ~ Scalar (ZeroDim s)) => (ZeroDim s w) -> (ZeroDim s w) -> ZeroDim s w Source #

subtractTensors :: (TensorSpace (ZeroDim s), TensorSpace w, Scalar w ~ Scalar (ZeroDim s)) => (ZeroDim s w) -> (ZeroDim s w) -> ZeroDim s w Source #

scaleTensor :: (TensorSpace w, Scalar w ~ Scalar (ZeroDim s)) => Bilinear (Scalar (ZeroDim s)) (ZeroDim s w) (ZeroDim s w) Source #

negateTensor :: (TensorSpace w, Scalar w ~ Scalar (ZeroDim s)) => (ZeroDim s w) -+> (ZeroDim s w) Source #

tensorProduct :: (TensorSpace w, Scalar w ~ Scalar (ZeroDim s)) => Bilinear (ZeroDim s) w (ZeroDim s w) Source #

tensorProducts :: (TensorSpace w, Scalar w ~ Scalar (ZeroDim s)) => [(ZeroDim s, w)] -> ZeroDim s w Source #

transposeTensor :: (TensorSpace w, Scalar w ~ Scalar (ZeroDim s)) => (ZeroDim s w) -+> (w ZeroDim s) Source #

fmapTensor :: (TensorSpace w, TensorSpace x, Scalar w ~ Scalar (ZeroDim s), Scalar x ~ Scalar (ZeroDim s)) => Bilinear (w -+> x) (ZeroDim s w) (ZeroDim s x) Source #

fzipTensorWith :: (TensorSpace u, TensorSpace w, TensorSpace x, Scalar u ~ Scalar (ZeroDim s), Scalar w ~ Scalar (ZeroDim s), Scalar x ~ Scalar (ZeroDim s)) => Bilinear ((w, x) -+> u) (ZeroDim s w, ZeroDim s x) (ZeroDim s u) Source #

tensorUnsafeFromArrayWithOffset :: forall w α (n :: Nat) (m :: Nat). (Dimensional n (ZeroDim s), TensorSpace w, Dimensional m w, Scalar w ~ Scalar (ZeroDim s), Vector α (Scalar (ZeroDim s))) => Int -> α (Scalar (ZeroDim s)) -> ZeroDim s w Source #

tensorUnsafeWriteArrayWithOffset :: forall w (α :: Type -> Type) σ (n :: Nat) (m :: Nat). (Dimensional n (ZeroDim s), TensorSpace w, Dimensional m w, Scalar w ~ Scalar (ZeroDim s), Vector α (Scalar (ZeroDim s))) => Mutable α σ (Scalar (ZeroDim s)) -> Int -> (ZeroDim s w) -> ST σ () Source #

coerceFmapTensorProduct :: (Functor p, TensorSpace a, Scalar a ~ Scalar (ZeroDim s), TensorSpace b, Scalar b ~ Scalar (ZeroDim s)) => p (ZeroDim s) -> VSCCoercion (Scalar (ZeroDim s)) a b -> Coercion (TensorProduct (ZeroDim s) a) (TensorProduct (ZeroDim s) b) Source #

wellDefinedVector :: ZeroDim s -> Maybe (ZeroDim s) Source #

wellDefinedTensor :: (TensorSpace w, Scalar w ~ Scalar (ZeroDim s)) => (ZeroDim s w) -> Maybe (ZeroDim s w) Source #

(Num' s, TensorSpace v, Scalar v ~ s) => TensorSpace (SymmetricTensor s v) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type TensorProduct (SymmetricTensor s v) w Source #

Methods

scalarSpaceWitness :: ScalarSpaceWitness (SymmetricTensor s v) Source #

linearManifoldWitness :: LinearManifoldWitness (SymmetricTensor s v) Source #

zeroTensor :: (TensorSpace w, Scalar w ~ Scalar (SymmetricTensor s v)) => SymmetricTensor s v w Source #

toFlatTensor :: SymmetricTensor s v -+> (SymmetricTensor s v Scalar (SymmetricTensor s v)) Source #

fromFlatTensor :: (SymmetricTensor s v Scalar (SymmetricTensor s v)) -+> SymmetricTensor s v Source #

addTensors :: (TensorSpace w, Scalar w ~ Scalar (SymmetricTensor s v)) => (SymmetricTensor s v w) -> (SymmetricTensor s v w) -> SymmetricTensor s v w Source #

subtractTensors :: (TensorSpace (SymmetricTensor s v), TensorSpace w, Scalar w ~ Scalar (SymmetricTensor s v)) => (SymmetricTensor s v w) -> (SymmetricTensor s v w) -> SymmetricTensor s v w Source #

scaleTensor :: (TensorSpace w, Scalar w ~ Scalar (SymmetricTensor s v)) => Bilinear (Scalar (SymmetricTensor s v)) (SymmetricTensor s v w) (SymmetricTensor s v w) Source #

negateTensor :: (TensorSpace w, Scalar w ~ Scalar (SymmetricTensor s v)) => (SymmetricTensor s v w) -+> (SymmetricTensor s v w) Source #

tensorProduct :: (TensorSpace w, Scalar w ~ Scalar (SymmetricTensor s v)) => Bilinear (SymmetricTensor s v) w (SymmetricTensor s v w) Source #

tensorProducts :: (TensorSpace w, Scalar w ~ Scalar (SymmetricTensor s v)) => [(SymmetricTensor s v, w)] -> SymmetricTensor s v w Source #

transposeTensor :: (TensorSpace w, Scalar w ~ Scalar (SymmetricTensor s v)) => (SymmetricTensor s v w) -+> (w SymmetricTensor s v) Source #

fmapTensor :: (TensorSpace w, TensorSpace x, Scalar w ~ Scalar (SymmetricTensor s v), Scalar x ~ Scalar (SymmetricTensor s v)) => Bilinear (w -+> x) (SymmetricTensor s v w) (SymmetricTensor s v x) Source #

fzipTensorWith :: (TensorSpace u, TensorSpace w, TensorSpace x, Scalar u ~ Scalar (SymmetricTensor s v), Scalar w ~ Scalar (SymmetricTensor s v), Scalar x ~ Scalar (SymmetricTensor s v)) => Bilinear ((w, x) -+> u) (SymmetricTensor s v w, SymmetricTensor s v x) (SymmetricTensor s v u) Source #

tensorUnsafeFromArrayWithOffset :: forall w α (n :: Nat) (m :: Nat). (Dimensional n (SymmetricTensor s v), TensorSpace w, Dimensional m w, Scalar w ~ Scalar (SymmetricTensor s v), Vector α (Scalar (SymmetricTensor s v))) => Int -> α (Scalar (SymmetricTensor s v)) -> SymmetricTensor s v w Source #

tensorUnsafeWriteArrayWithOffset :: forall w (α :: Type -> Type) σ (n :: Nat) (m :: Nat). (Dimensional n (SymmetricTensor s v), TensorSpace w, Dimensional m w, Scalar w ~ Scalar (SymmetricTensor s v), Vector α (Scalar (SymmetricTensor s v))) => Mutable α σ (Scalar (SymmetricTensor s v)) -> Int -> (SymmetricTensor s v w) -> ST σ () Source #

coerceFmapTensorProduct :: (Functor p, TensorSpace a, Scalar a ~ Scalar (SymmetricTensor s v), TensorSpace b, Scalar b ~ Scalar (SymmetricTensor s v)) => p (SymmetricTensor s v) -> VSCCoercion (Scalar (SymmetricTensor s v)) a b -> Coercion (TensorProduct (SymmetricTensor s v) a) (TensorProduct (SymmetricTensor s v) b) Source #

wellDefinedVector :: SymmetricTensor s v -> Maybe (SymmetricTensor s v) Source #

wellDefinedTensor :: (TensorSpace w, Scalar w ~ Scalar (SymmetricTensor s v)) => (SymmetricTensor s v w) -> Maybe (SymmetricTensor s v w) Source #

(TensorSpace u, TensorSpace v, Scalar u ~ Scalar v) => TensorSpace (u, v) Source # 
Instance details

Defined in Math.LinearMap.Category.Class

Associated Types

type TensorProduct (u, v) w Source #

Methods

scalarSpaceWitness :: ScalarSpaceWitness (u, v) Source #

linearManifoldWitness :: LinearManifoldWitness (u, v) Source #

zeroTensor :: (TensorSpace w, Scalar w ~ Scalar (u, v)) => (u, v) w Source #

toFlatTensor :: (u, v) -+> ((u, v) Scalar (u, v)) Source #

fromFlatTensor :: ((u, v) Scalar (u, v)) -+> (u, v) Source #

addTensors :: (TensorSpace w, Scalar w ~ Scalar (u, v)) => ((u, v) w) -> ((u, v) w) -> (u, v) w Source #

subtractTensors :: (TensorSpace (u, v), TensorSpace w, Scalar w ~ Scalar (u, v)) => ((u, v) w) -> ((u, v) w) -> (u, v) w Source #

scaleTensor :: (TensorSpace w, Scalar w ~ Scalar (u, v)) => Bilinear (Scalar (u, v)) ((u, v) w) ((u, v) w) Source #

negateTensor :: (TensorSpace w, Scalar w ~ Scalar (u, v)) => ((u, v) w) -+> ((u, v) w) Source #

tensorProduct :: (TensorSpace w, Scalar w ~ Scalar (u, v)) => Bilinear (u, v) w ((u, v) w) Source #

tensorProducts :: (TensorSpace w, Scalar w ~ Scalar (u, v)) => [((u, v), w)] -> (u, v) w Source #

transposeTensor :: (TensorSpace w, Scalar w ~ Scalar (u, v)) => ((u, v) w) -+> (w (u, v)) Source #

fmapTensor :: (TensorSpace w, TensorSpace x, Scalar w ~ Scalar (u, v), Scalar x ~ Scalar (u, v)) => Bilinear (w -+> x) ((u, v) w) ((u, v) x) Source #

fzipTensorWith :: (TensorSpace u0, TensorSpace w, TensorSpace x, Scalar u0 ~ Scalar (u, v), Scalar w ~ Scalar (u, v), Scalar x ~ Scalar (u, v)) => Bilinear ((w, x) -+> u0) ((u, v) w, (u, v) x) ((u, v) u0) Source #

tensorUnsafeFromArrayWithOffset :: forall w α (n :: Nat) (m :: Nat). (Dimensional n (u, v), TensorSpace w, Dimensional m w, Scalar w ~ Scalar (u, v), Vector α (Scalar (u, v))) => Int -> α (Scalar (u, v)) -> (u, v) w Source #

tensorUnsafeWriteArrayWithOffset :: forall w (α :: Type -> Type) σ (n :: Nat) (m :: Nat). (Dimensional n (u, v), TensorSpace w, Dimensional m w, Scalar w ~ Scalar (u, v), Vector α (Scalar (u, v))) => Mutable α σ (Scalar (u, v)) -> Int -> ((u, v) w) -> ST σ () Source #

coerceFmapTensorProduct :: (Functor p, TensorSpace a, Scalar a ~ Scalar (u, v), TensorSpace b, Scalar b ~ Scalar (u, v)) => p (u, v) -> VSCCoercion (Scalar (u, v)) a b -> Coercion (TensorProduct (u, v) a) (TensorProduct (u, v) b) Source #

wellDefinedVector :: (u, v) -> Maybe (u, v) Source #

wellDefinedTensor :: (TensorSpace w, Scalar w ~ Scalar (u, v)) => ((u, v) w) -> Maybe ((u, v) w) Source #

TensorSpace v => TensorSpace (Rec0 v s) Source # 
Instance details

Defined in Math.LinearMap.Category.Class

Associated Types

type TensorProduct (Rec0 v s) w Source #

Methods

scalarSpaceWitness :: ScalarSpaceWitness (Rec0 v s) Source #

linearManifoldWitness :: LinearManifoldWitness (Rec0 v s) Source #

zeroTensor :: (TensorSpace w, Scalar w ~ Scalar (Rec0 v s)) => Rec0 v s w Source #

toFlatTensor :: Rec0 v s -+> (Rec0 v s Scalar (Rec0 v s)) Source #

fromFlatTensor :: (Rec0 v s Scalar (Rec0 v s)) -+> Rec0 v s Source #

addTensors :: (TensorSpace w, Scalar w ~ Scalar (Rec0 v s)) => (Rec0 v s w) -> (Rec0 v s w) -> Rec0 v s w Source #

subtractTensors :: (TensorSpace (Rec0 v s), TensorSpace w, Scalar w ~ Scalar (Rec0 v s)) => (Rec0 v s w) -> (Rec0 v s w) -> Rec0 v s w Source #

scaleTensor :: (TensorSpace w, Scalar w ~ Scalar (Rec0 v s)) => Bilinear (Scalar (Rec0 v s)) (Rec0 v s w) (Rec0 v s w) Source #

negateTensor :: (TensorSpace w, Scalar w ~ Scalar (Rec0 v s)) => (Rec0 v s w) -+> (Rec0 v s w) Source #

tensorProduct :: (TensorSpace w, Scalar w ~ Scalar (Rec0 v s)) => Bilinear (Rec0 v s) w (Rec0 v s w) Source #

tensorProducts :: (TensorSpace w, Scalar w ~ Scalar (Rec0 v s)) => [(Rec0 v s, w)] -> Rec0 v s w Source #

transposeTensor :: (TensorSpace w, Scalar w ~ Scalar (Rec0 v s)) => (Rec0 v s w) -+> (w Rec0 v s) Source #

fmapTensor :: (TensorSpace w, TensorSpace x, Scalar w ~ Scalar (Rec0 v s), Scalar x ~ Scalar (Rec0 v s)) => Bilinear (w -+> x) (Rec0 v s w) (Rec0 v s x) Source #

fzipTensorWith :: (TensorSpace u, TensorSpace w, TensorSpace x, Scalar u ~ Scalar (Rec0 v s), Scalar w ~ Scalar (Rec0 v s), Scalar x ~ Scalar (Rec0 v s)) => Bilinear ((w, x) -+> u) (Rec0 v s w, Rec0 v s x) (Rec0 v s u) Source #

tensorUnsafeFromArrayWithOffset :: forall w α (n :: Nat) (m :: Nat). (Dimensional n (Rec0 v s), TensorSpace w, Dimensional m w, Scalar w ~ Scalar (Rec0 v s), Vector α (Scalar (Rec0 v s))) => Int -> α (Scalar (Rec0 v s)) -> Rec0 v s w Source #

tensorUnsafeWriteArrayWithOffset :: forall w (α :: Type -> Type) σ (n :: Nat) (m :: Nat). (Dimensional n (Rec0 v s), TensorSpace w, Dimensional m w, Scalar w ~ Scalar (Rec0 v s), Vector α (Scalar (Rec0 v s))) => Mutable α σ (Scalar (Rec0 v s)) -> Int -> (Rec0 v s w) -> ST σ () Source #

coerceFmapTensorProduct :: (Functor p, TensorSpace a, Scalar a ~ Scalar (Rec0 v s), TensorSpace b, Scalar b ~ Scalar (Rec0 v s)) => p (Rec0 v s) -> VSCCoercion (Scalar (Rec0 v s)) a b -> Coercion (TensorProduct (Rec0 v s) a) (TensorProduct (Rec0 v s) b) Source #

wellDefinedVector :: Rec0 v s -> Maybe (Rec0 v s) Source #

wellDefinedTensor :: (TensorSpace w, Scalar w ~ Scalar (Rec0 v s)) => (Rec0 v s w) -> Maybe (Rec0 v s w) Source #

(LinearSpace u, LinearSpace v, Scalar u ~ s, Scalar v ~ s) => TensorSpace (LinearFunction s u v) Source # 
Instance details

Defined in Math.LinearMap.Category.Class

Associated Types

type TensorProduct (LinearFunction s u v) w Source #

Methods

scalarSpaceWitness :: ScalarSpaceWitness (LinearFunction s u v) Source #

linearManifoldWitness :: LinearManifoldWitness (LinearFunction s u v) Source #

zeroTensor :: (TensorSpace w, Scalar w ~ Scalar (LinearFunction s u v)) => LinearFunction s u v w Source #

toFlatTensor :: LinearFunction s u v -+> (LinearFunction s u v Scalar (LinearFunction s u v)) Source #

fromFlatTensor :: (LinearFunction s u v Scalar (LinearFunction s u v)) -+> LinearFunction s u v Source #

addTensors :: (TensorSpace w, Scalar w ~ Scalar (LinearFunction s u v)) => (LinearFunction s u v w) -> (LinearFunction s u v w) -> LinearFunction s u v w Source #

subtractTensors :: (TensorSpace (LinearFunction s u v), TensorSpace w, Scalar w ~ Scalar (LinearFunction s u v)) => (LinearFunction s u v w) -> (LinearFunction s u v w) -> LinearFunction s u v w Source #

scaleTensor :: (TensorSpace w, Scalar w ~ Scalar (LinearFunction s u v)) => Bilinear (Scalar (LinearFunction s u v)) (LinearFunction s u v w) (LinearFunction s u v w) Source #

negateTensor :: (TensorSpace w, Scalar w ~ Scalar (LinearFunction s u v)) => (LinearFunction s u v w) -+> (LinearFunction s u v w) Source #

tensorProduct :: (TensorSpace w, Scalar w ~ Scalar (LinearFunction s u v)) => Bilinear (LinearFunction s u v) w (LinearFunction s u v w) Source #

tensorProducts :: (TensorSpace w, Scalar w ~ Scalar (LinearFunction s u v)) => [(LinearFunction s u v, w)] -> LinearFunction s u v w Source #

transposeTensor :: (TensorSpace w, Scalar w ~ Scalar (LinearFunction s u v)) => (LinearFunction s u v w) -+> (w LinearFunction s u v) Source #

fmapTensor :: (TensorSpace w, TensorSpace x, Scalar w ~ Scalar (LinearFunction s u v), Scalar x ~ Scalar (LinearFunction s u v)) => Bilinear (w -+> x) (LinearFunction s u v w) (LinearFunction s u v x) Source #

fzipTensorWith :: (TensorSpace u0, TensorSpace w, TensorSpace x, Scalar u0 ~ Scalar (LinearFunction s u v), Scalar w ~ Scalar (LinearFunction s u v), Scalar x ~ Scalar (LinearFunction s u v)) => Bilinear ((w, x) -+> u0) (LinearFunction s u v w, LinearFunction s u v x) (LinearFunction s u v u0) Source #

tensorUnsafeFromArrayWithOffset :: forall w α (n :: Nat) (m :: Nat). (Dimensional n (LinearFunction s u v), TensorSpace w, Dimensional m w, Scalar w ~ Scalar (LinearFunction s u v), Vector α (Scalar (LinearFunction s u v))) => Int -> α (Scalar (LinearFunction s u v)) -> LinearFunction s u v w Source #

tensorUnsafeWriteArrayWithOffset :: forall w (α :: Type -> Type) σ (n :: Nat) (m :: Nat). (Dimensional n (LinearFunction s u v), TensorSpace w, Dimensional m w, Scalar w ~ Scalar (LinearFunction s u v), Vector α (Scalar (LinearFunction s u v))) => Mutable α σ (Scalar (LinearFunction s u v)) -> Int -> (LinearFunction s u v w) -> ST σ () Source #

coerceFmapTensorProduct :: (Functor p, TensorSpace a, Scalar a ~ Scalar (LinearFunction s u v), TensorSpace b, Scalar b ~ Scalar (LinearFunction s u v)) => p (LinearFunction s u v) -> VSCCoercion (Scalar (LinearFunction s u v)) a b -> Coercion (TensorProduct (LinearFunction s u v) a) (TensorProduct (LinearFunction s u v) b) Source #

wellDefinedVector :: LinearFunction s u v -> Maybe (LinearFunction s u v) Source #

wellDefinedTensor :: (TensorSpace w, Scalar w ~ Scalar (LinearFunction s u v)) => (LinearFunction s u v w) -> Maybe (LinearFunction s u v w) Source #

(LinearSpace u, TensorSpace v, Scalar u ~ s, Scalar v ~ s) => TensorSpace (LinearMap s u v) Source # 
Instance details

Defined in Math.LinearMap.Category.Class

Associated Types

type TensorProduct (LinearMap s u v) w Source #

Methods

scalarSpaceWitness :: ScalarSpaceWitness (LinearMap s u v) Source #

linearManifoldWitness :: LinearManifoldWitness (LinearMap s u v) Source #

zeroTensor :: (TensorSpace w, Scalar w ~ Scalar (LinearMap s u v)) => LinearMap s u v w Source #

toFlatTensor :: LinearMap s u v -+> (LinearMap s u v Scalar (LinearMap s u v)) Source #

fromFlatTensor :: (LinearMap s u v Scalar (LinearMap s u v)) -+> LinearMap s u v Source #

addTensors :: (TensorSpace w, Scalar w ~ Scalar (LinearMap s u v)) => (LinearMap s u v w) -> (LinearMap s u v w) -> LinearMap s u v w Source #

subtractTensors :: (TensorSpace (LinearMap s u v), TensorSpace w, Scalar w ~ Scalar (LinearMap s u v)) => (LinearMap s u v w) -> (LinearMap s u v w) -> LinearMap s u v w Source #

scaleTensor :: (TensorSpace w, Scalar w ~ Scalar (LinearMap s u v)) => Bilinear (Scalar (LinearMap s u v)) (LinearMap s u v w) (LinearMap s u v w) Source #

negateTensor :: (TensorSpace w, Scalar w ~ Scalar (LinearMap s u v)) => (LinearMap s u v w) -+> (LinearMap s u v w) Source #

tensorProduct :: (TensorSpace w, Scalar w ~ Scalar (LinearMap s u v)) => Bilinear (LinearMap s u v) w (LinearMap s u v w) Source #

tensorProducts :: (TensorSpace w, Scalar w ~ Scalar (LinearMap s u v)) => [(LinearMap s u v, w)] -> LinearMap s u v w Source #

transposeTensor :: (TensorSpace w, Scalar w ~ Scalar (LinearMap s u v)) => (LinearMap s u v w) -+> (w LinearMap s u v) Source #

fmapTensor :: (TensorSpace w, TensorSpace x, Scalar w ~ Scalar (LinearMap s u v), Scalar x ~ Scalar (LinearMap s u v)) => Bilinear (w -+> x) (LinearMap s u v w) (LinearMap s u v x) Source #

fzipTensorWith :: (TensorSpace u0, TensorSpace w, TensorSpace x, Scalar u0 ~ Scalar (LinearMap s u v), Scalar w ~ Scalar (LinearMap s u v), Scalar x ~ Scalar (LinearMap s u v)) => Bilinear ((w, x) -+> u0) (LinearMap s u v w, LinearMap s u v x) (LinearMap s u v u0) Source #

tensorUnsafeFromArrayWithOffset :: forall w α (n :: Nat) (m :: Nat). (Dimensional n (LinearMap s u v), TensorSpace w, Dimensional m w, Scalar w ~ Scalar (LinearMap s u v), Vector α (Scalar (LinearMap s u v))) => Int -> α (Scalar (LinearMap s u v)) -> LinearMap s u v w Source #

tensorUnsafeWriteArrayWithOffset :: forall w (α :: Type -> Type) σ (n :: Nat) (m :: Nat). (Dimensional n (LinearMap s u v), TensorSpace w, Dimensional m w, Scalar w ~ Scalar (LinearMap s u v), Vector α (Scalar (LinearMap s u v))) => Mutable α σ (Scalar (LinearMap s u v)) -> Int -> (LinearMap s u v w) -> ST σ () Source #

coerceFmapTensorProduct :: (Functor p, TensorSpace a, Scalar a ~ Scalar (LinearMap s u v), TensorSpace b, Scalar b ~ Scalar (LinearMap s u v)) => p (LinearMap s u v) -> VSCCoercion (Scalar (LinearMap s u v)) a b -> Coercion (TensorProduct (LinearMap s u v) a) (TensorProduct (LinearMap s u v) b) Source #

wellDefinedVector :: LinearMap s u v -> Maybe (LinearMap s u v) Source #

wellDefinedTensor :: (TensorSpace w, Scalar w ~ Scalar (LinearMap s u v)) => (LinearMap s u v w) -> Maybe (LinearMap s u v w) Source #

(TensorSpace u, TensorSpace v, Scalar u ~ s, Scalar v ~ s) => TensorSpace (Tensor s u v) Source # 
Instance details

Defined in Math.LinearMap.Category.Class

Associated Types

type TensorProduct (Tensor s u v) w Source #

Methods

scalarSpaceWitness :: ScalarSpaceWitness (Tensor s u v) Source #

linearManifoldWitness :: LinearManifoldWitness (Tensor s u v) Source #

zeroTensor :: (TensorSpace w, Scalar w ~ Scalar (Tensor s u v)) => Tensor s u v w Source #

toFlatTensor :: Tensor s u v -+> (Tensor s u v Scalar (Tensor s u v)) Source #

fromFlatTensor :: (Tensor s u v Scalar (Tensor s u v)) -+> Tensor s u v Source #

addTensors :: (TensorSpace w, Scalar w ~ Scalar (Tensor s u v)) => (Tensor s u v w) -> (Tensor s u v w) -> Tensor s u v w Source #

subtractTensors :: (TensorSpace (Tensor s u v), TensorSpace w, Scalar w ~ Scalar (Tensor s u v)) => (Tensor s u v w) -> (Tensor s u v w) -> Tensor s u v w Source #

scaleTensor :: (TensorSpace w, Scalar w ~ Scalar (Tensor s u v)) => Bilinear (Scalar (Tensor s u v)) (Tensor s u v w) (Tensor s u v w) Source #

negateTensor :: (TensorSpace w, Scalar w ~ Scalar (Tensor s u v)) => (Tensor s u v w) -+> (Tensor s u v w) Source #

tensorProduct :: (TensorSpace w, Scalar w ~ Scalar (Tensor s u v)) => Bilinear (Tensor s u v) w (Tensor s u v w) Source #

tensorProducts :: (TensorSpace w, Scalar w ~ Scalar (Tensor s u v)) => [(Tensor s u v, w)] -> Tensor s u v w Source #

transposeTensor :: (TensorSpace w, Scalar w ~ Scalar (Tensor s u v)) => (Tensor s u v w) -+> (w Tensor s u v) Source #

fmapTensor :: (TensorSpace w, TensorSpace x, Scalar w ~ Scalar (Tensor s u v), Scalar x ~ Scalar (Tensor s u v)) => Bilinear (w -+> x) (Tensor s u v w) (Tensor s u v x) Source #

fzipTensorWith :: (TensorSpace u0, TensorSpace w, TensorSpace x, Scalar u0 ~ Scalar (Tensor s u v), Scalar w ~ Scalar (Tensor s u v), Scalar x ~ Scalar (Tensor s u v)) => Bilinear ((w, x) -+> u0) (Tensor s u v w, Tensor s u v x) (Tensor s u v u0) Source #

tensorUnsafeFromArrayWithOffset :: forall w α (n :: Nat) (m :: Nat). (Dimensional n (Tensor s u v), TensorSpace w, Dimensional m w, Scalar w ~ Scalar (Tensor s u v), Vector α (Scalar (Tensor s u v))) => Int -> α (Scalar (Tensor s u v)) -> Tensor s u v w Source #

tensorUnsafeWriteArrayWithOffset :: forall w (α :: Type -> Type) σ (n :: Nat) (m :: Nat). (Dimensional n (Tensor s u v), TensorSpace w, Dimensional m w, Scalar w ~ Scalar (Tensor s u v), Vector α (Scalar (Tensor s u v))) => Mutable α σ (Scalar (Tensor s u v)) -> Int -> (Tensor s u v w) -> ST σ () Source #

coerceFmapTensorProduct :: (Functor p, TensorSpace a, Scalar a ~ Scalar (Tensor s u v), TensorSpace b, Scalar b ~ Scalar (Tensor s u v)) => p (Tensor s u v) -> VSCCoercion (Scalar (Tensor s u v)) a b -> Coercion (TensorProduct (Tensor s u v) a) (TensorProduct (Tensor s u v) b) Source #

wellDefinedVector :: Tensor s u v -> Maybe (Tensor s u v) Source #

wellDefinedTensor :: (TensorSpace w, Scalar w ~ Scalar (Tensor s u v)) => (Tensor s u v w) -> Maybe (Tensor s u v w) Source #

(TensorSpace (f p), TensorSpace (g p), Scalar (f p) ~ Scalar (g p)) => TensorSpace ((f :*: g) p) Source # 
Instance details

Defined in Math.LinearMap.Category.Class

Associated Types

type TensorProduct ((f :*: g) p) w Source #

Methods

scalarSpaceWitness :: ScalarSpaceWitness ((f :*: g) p) Source #

linearManifoldWitness :: LinearManifoldWitness ((f :*: g) p) Source #

zeroTensor :: (TensorSpace w, Scalar w ~ Scalar ((f :*: g) p)) => (f :*: g) p w Source #

toFlatTensor :: (f :*: g) p -+> ((f :*: g) p Scalar ((f :*: g) p)) Source #

fromFlatTensor :: ((f :*: g) p Scalar ((f :*: g) p)) -+> (f :*: g) p Source #

addTensors :: (TensorSpace w, Scalar w ~ Scalar ((f :*: g) p)) => ((f :*: g) p w) -> ((f :*: g) p w) -> (f :*: g) p w Source #

subtractTensors :: (TensorSpace ((f :*: g) p), TensorSpace w, Scalar w ~ Scalar ((f :*: g) p)) => ((f :*: g) p w) -> ((f :*: g) p w) -> (f :*: g) p w Source #

scaleTensor :: (TensorSpace w, Scalar w ~ Scalar ((f :*: g) p)) => Bilinear (Scalar ((f :*: g) p)) ((f :*: g) p w) ((f :*: g) p w) Source #

negateTensor :: (TensorSpace w, Scalar w ~ Scalar ((f :*: g) p)) => ((f :*: g) p w) -+> ((f :*: g) p w) Source #

tensorProduct :: (TensorSpace w, Scalar w ~ Scalar ((f :*: g) p)) => Bilinear ((f :*: g) p) w ((f :*: g) p w) Source #

tensorProducts :: (TensorSpace w, Scalar w ~ Scalar ((f :*: g) p)) => [((f :*: g) p, w)] -> (f :*: g) p w Source #

transposeTensor :: (TensorSpace w, Scalar w ~ Scalar ((f :*: g) p)) => ((f :*: g) p w) -+> (w (f :*: g) p) Source #

fmapTensor :: (TensorSpace w, TensorSpace x, Scalar w ~ Scalar ((f :*: g) p), Scalar x ~ Scalar ((f :*: g) p)) => Bilinear (w -+> x) ((f :*: g) p w) ((f :*: g) p x) Source #

fzipTensorWith :: (TensorSpace u, TensorSpace w, TensorSpace x, Scalar u ~ Scalar ((f :*: g) p), Scalar w ~ Scalar ((f :*: g) p), Scalar x ~ Scalar ((f :*: g) p)) => Bilinear ((w, x) -+> u) ((f :*: g) p w, (f :*: g) p x) ((f :*: g) p u) Source #

tensorUnsafeFromArrayWithOffset :: forall w α (n :: Nat) (m :: Nat). (Dimensional n ((f :*: g) p), TensorSpace w, Dimensional m w, Scalar w ~ Scalar ((f :*: g) p), Vector α (Scalar ((f :*: g) p))) => Int -> α (Scalar ((f :*: g) p)) -> (f :*: g) p w Source #

tensorUnsafeWriteArrayWithOffset :: forall w (α :: Type -> Type) σ (n :: Nat) (m :: Nat). (Dimensional n ((f :*: g) p), TensorSpace w, Dimensional m w, Scalar w ~ Scalar ((f :*: g) p), Vector α (Scalar ((f :*: g) p))) => Mutable α σ (Scalar ((f :*: g) p)) -> Int -> ((f :*: g) p w) -> ST σ () Source #

coerceFmapTensorProduct :: (Functor p0, TensorSpace a, Scalar a ~ Scalar ((f :*: g) p), TensorSpace b, Scalar b ~ Scalar ((f :*: g) p)) => p0 ((f :*: g) p) -> VSCCoercion (Scalar ((f :*: g) p)) a b -> Coercion (TensorProduct ((f :*: g) p) a) (TensorProduct ((f :*: g) p) b) Source #

wellDefinedVector :: (f :*: g) p -> Maybe ((f :*: g) p) Source #

wellDefinedTensor :: (TensorSpace w, Scalar w ~ Scalar ((f :*: g) p)) => ((f :*: g) p w) -> Maybe ((f :*: g) p w) Source #

TensorSpace (f p) => TensorSpace (M1 i c f p) Source # 
Instance details

Defined in Math.LinearMap.Category.Class

Associated Types

type TensorProduct (M1 i c f p) w Source #

Methods

scalarSpaceWitness :: ScalarSpaceWitness (M1 i c f p) Source #

linearManifoldWitness :: LinearManifoldWitness (M1 i c f p) Source #

zeroTensor :: (TensorSpace w, Scalar w ~ Scalar (M1 i c f p)) => M1 i c f p w Source #

toFlatTensor :: M1 i c f p -+> (M1 i c f p Scalar (M1 i c f p)) Source #

fromFlatTensor :: (M1 i c f p Scalar (M1 i c f p)) -+> M1 i c f p Source #

addTensors :: (TensorSpace w, Scalar w ~ Scalar (M1 i c f p)) => (M1 i c f p w) -> (M1 i c f p w) -> M1 i c f p w Source #

subtractTensors :: (TensorSpace (M1 i c f p), TensorSpace w, Scalar w ~ Scalar (M1 i c f p)) => (M1 i c f p w) -> (M1 i c f p w) -> M1 i c f p w Source #

scaleTensor :: (TensorSpace w, Scalar w ~ Scalar (M1 i c f p)) => Bilinear (Scalar (M1 i c f p)) (M1 i c f p w) (M1 i c f p w) Source #

negateTensor :: (TensorSpace w, Scalar w ~ Scalar (M1 i c f p)) => (M1 i c f p w) -+> (M1 i c f p w) Source #

tensorProduct :: (TensorSpace w, Scalar w ~ Scalar (M1 i c f p)) => Bilinear (M1 i c f p) w (M1 i c f p w) Source #

tensorProducts :: (TensorSpace w, Scalar w ~ Scalar (M1 i c f p)) => [(M1 i c f p, w)] -> M1 i c f p w Source #

transposeTensor :: (TensorSpace w, Scalar w ~ Scalar (M1 i c f p)) => (M1 i c f p w) -+> (w M1 i c f p) Source #

fmapTensor :: (TensorSpace w, TensorSpace x, Scalar w ~ Scalar (M1 i c f p), Scalar x ~ Scalar (M1 i c f p)) => Bilinear (w -+> x) (M1 i c f p w) (M1 i c f p x) Source #

fzipTensorWith :: (TensorSpace u, TensorSpace w, TensorSpace x, Scalar u ~ Scalar (M1 i c f p), Scalar w ~ Scalar (M1 i c f p), Scalar x ~ Scalar (M1 i c f p)) => Bilinear ((w, x) -+> u) (M1 i c f p w, M1 i c f p x) (M1 i c f p u) Source #

tensorUnsafeFromArrayWithOffset :: forall w α (n :: Nat) (m :: Nat). (Dimensional n (M1 i c f p), TensorSpace w, Dimensional m w, Scalar w ~ Scalar (M1 i c f p), Vector α (Scalar (M1 i c f p))) => Int -> α (Scalar (M1 i c f p)) -> M1 i c f p w Source #

tensorUnsafeWriteArrayWithOffset :: forall w (α :: Type -> Type) σ (n :: Nat) (m :: Nat). (Dimensional n (M1 i c f p), TensorSpace w, Dimensional m w, Scalar w ~ Scalar (M1 i c f p), Vector α (Scalar (M1 i c f p))) => Mutable α σ (Scalar (M1 i c f p)) -> Int -> (M1 i c f p w) -> ST σ () Source #

coerceFmapTensorProduct :: (Functor p0, TensorSpace a, Scalar a ~ Scalar (M1 i c f p), TensorSpace b, Scalar b ~ Scalar (M1 i c f p)) => p0 (M1 i c f p) -> VSCCoercion (Scalar (M1 i c f p)) a b -> Coercion (TensorProduct (M1 i c f p) a) (TensorProduct (M1 i c f p) b) Source #

wellDefinedVector :: M1 i c f p -> Maybe (M1 i c f p) Source #

wellDefinedTensor :: (TensorSpace w, Scalar w ~ Scalar (M1 i c f p)) => (M1 i c f p w) -> Maybe (M1 i c f p w) Source #

class (TensorSpace v, Num (Scalar v)) => LinearSpace v where Source #

The class of vector spaces v for which LinearMap s v w is well-implemented.

Associated Types

type DualVector v :: Type Source #

Suitable representation of a linear map from the space v to its field.

For the usual euclidean spaces, you can just define DualVector v = v. (In this case, a dual vector will be just a “row vector” if you consider v-vectors as “column vectors”. LinearMap will then effectively have a matrix layout.)

Methods

dualSpaceWitness :: DualSpaceWitness v Source #

linearId :: v +> v Source #

idTensor :: v DualVector v Source #

sampleLinearFunction :: (TensorSpace w, Scalar v ~ Scalar w) => (v -+> w) -+> (v +> w) Source #

toLinearForm :: DualVector v -+> (v +> Scalar v) Source #

fromLinearForm :: (v +> Scalar v) -+> DualVector v Source #

coerceDoubleDual :: VSCCoercion (Scalar v) v (DualVector (DualVector v)) Source #

This will probably be removed in the future, since infinite-dimensional (e.g. Banach-) spaces may be not isomorphic to their double dual.

trace :: (v +> v) -+> Scalar v Source #

contractTensorMap :: (TensorSpace w, Scalar w ~ Scalar v) => (v +> (v w)) -+> w Source #

contractMapTensor :: (TensorSpace w, Scalar w ~ Scalar v) => (v (v +> w)) -+> w Source #

contractTensorFn :: forall w. (TensorSpace w, Scalar w ~ Scalar v) => (v -+> (v w)) -+> w Source #

contractLinearMapAgainst :: (LinearSpace w, Scalar w ~ Scalar v) => Bilinear (v +> w) (w -+> v) (Scalar v) Source #

applyDualVector :: LinearSpace v => Bilinear (DualVector v) v (Scalar v) Source #

applyLinear :: (TensorSpace w, Scalar w ~ Scalar v) => Bilinear (v +> w) v w Source #

composeLinear :: (LinearSpace w, TensorSpace x, Scalar w ~ Scalar v, Scalar x ~ Scalar v) => Bilinear (w +> x) (v +> w) (v +> x) Source #

tensorId :: (LinearSpace w, Scalar w ~ Scalar v) => (v w) +> (v w) Source #

applyTensorFunctional :: (LinearSpace u, Scalar u ~ Scalar v) => Bilinear (DualVector (v u)) (v u) (Scalar v) Source #

applyTensorLinMap :: (LinearSpace u, TensorSpace w, Scalar u ~ Scalar v, Scalar w ~ Scalar v) => Bilinear ((v u) +> w) (v u) w Source #

useTupleLinearSpaceComponents :: v ~ (x, y) => ((LinearSpace x, LinearSpace y, Scalar x ~ Scalar y) => φ) -> φ Source #

Instances

Instances details
LinearSpace Rational Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type DualVector Rational Source #

Methods

dualSpaceWitness :: DualSpaceWitness Rational Source #

linearId :: Rational +> Rational Source #

idTensor :: Rational DualVector Rational Source #

sampleLinearFunction :: (TensorSpace w, Scalar Rational ~ Scalar w) => (Rational -+> w) -+> (Rational +> w) Source #

toLinearForm :: DualVector Rational -+> (Rational +> Scalar Rational) Source #

fromLinearForm :: (Rational +> Scalar Rational) -+> DualVector Rational Source #

coerceDoubleDual :: VSCCoercion (Scalar Rational) Rational (DualVector (DualVector Rational)) Source #

trace :: (Rational +> Rational) -+> Scalar Rational Source #

contractTensorMap :: (TensorSpace w, Scalar w ~ Scalar Rational) => (Rational +> (Rational w)) -+> w Source #

contractMapTensor :: (TensorSpace w, Scalar w ~ Scalar Rational) => (Rational (Rational +> w)) -+> w Source #

contractTensorFn :: (TensorSpace w, Scalar w ~ Scalar Rational) => (Rational -+> (Rational w)) -+> w Source #

contractLinearMapAgainst :: (LinearSpace w, Scalar w ~ Scalar Rational) => Bilinear (Rational +> w) (w -+> Rational) (Scalar Rational) Source #

applyDualVector :: Bilinear (DualVector Rational) Rational (Scalar Rational) Source #

applyLinear :: (TensorSpace w, Scalar w ~ Scalar Rational) => Bilinear (Rational +> w) Rational w Source #

composeLinear :: (LinearSpace w, TensorSpace x, Scalar w ~ Scalar Rational, Scalar x ~ Scalar Rational) => Bilinear (w +> x) (Rational +> w) (Rational +> x) Source #

tensorId :: (LinearSpace w, Scalar w ~ Scalar Rational) => (Rational w) +> (Rational w) Source #

applyTensorFunctional :: (LinearSpace u, Scalar u ~ Scalar Rational) => Bilinear (DualVector (Rational u)) (Rational u) (Scalar Rational) Source #

applyTensorLinMap :: (LinearSpace u, TensorSpace w, Scalar u ~ Scalar Rational, Scalar w ~ Scalar Rational) => Bilinear ((Rational u) +> w) (Rational u) w Source #

useTupleLinearSpaceComponents :: Rational ~ (x, y) => ((LinearSpace x, LinearSpace y, Scalar x ~ Scalar y) => φ) -> φ Source #

LinearSpace Float Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type DualVector Float Source #

Methods

dualSpaceWitness :: DualSpaceWitness Float Source #

linearId :: Float +> Float Source #

idTensor :: Float DualVector Float Source #

sampleLinearFunction :: (TensorSpace w, Scalar Float ~ Scalar w) => (Float -+> w) -+> (Float +> w) Source #

toLinearForm :: DualVector Float -+> (Float +> Scalar Float) Source #

fromLinearForm :: (Float +> Scalar Float) -+> DualVector Float Source #

coerceDoubleDual :: VSCCoercion (Scalar Float) Float (DualVector (DualVector Float)) Source #

trace :: (Float +> Float) -+> Scalar Float Source #

contractTensorMap :: (TensorSpace w, Scalar w ~ Scalar Float) => (Float +> (Float w)) -+> w Source #

contractMapTensor :: (TensorSpace w, Scalar w ~ Scalar Float) => (Float (Float +> w)) -+> w Source #

contractTensorFn :: (TensorSpace w, Scalar w ~ Scalar Float) => (Float -+> (Float w)) -+> w Source #

contractLinearMapAgainst :: (LinearSpace w, Scalar w ~ Scalar Float) => Bilinear (Float +> w) (w -+> Float) (Scalar Float) Source #

applyDualVector :: Bilinear (DualVector Float) Float (Scalar Float) Source #

applyLinear :: (TensorSpace w, Scalar w ~ Scalar Float) => Bilinear (Float +> w) Float w Source #

composeLinear :: (LinearSpace w, TensorSpace x, Scalar w ~ Scalar Float, Scalar x ~ Scalar Float) => Bilinear (w +> x) (Float +> w) (Float +> x) Source #

tensorId :: (LinearSpace w, Scalar w ~ Scalar Float) => (Float w) +> (Float w) Source #

applyTensorFunctional :: (LinearSpace u, Scalar u ~ Scalar Float) => Bilinear (DualVector (Float u)) (Float u) (Scalar Float) Source #

applyTensorLinMap :: (LinearSpace u, TensorSpace w, Scalar u ~ Scalar Float, Scalar w ~ Scalar Float) => Bilinear ((Float u) +> w) (Float u) w Source #

useTupleLinearSpaceComponents :: Float ~ (x, y) => ((LinearSpace x, LinearSpace y, Scalar x ~ Scalar y) => φ) -> φ Source #

(Num' n, Unbox n) => LinearSpace (FinSuppSeq n) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type DualVector (FinSuppSeq n) Source #

Methods

dualSpaceWitness :: DualSpaceWitness (FinSuppSeq n) Source #

linearId :: FinSuppSeq n +> FinSuppSeq n Source #

idTensor :: FinSuppSeq n DualVector (FinSuppSeq n) Source #

sampleLinearFunction :: (TensorSpace w, Scalar (FinSuppSeq n) ~ Scalar w) => (FinSuppSeq n -+> w) -+> (FinSuppSeq n +> w) Source #

toLinearForm :: DualVector (FinSuppSeq n) -+> (FinSuppSeq n +> Scalar (FinSuppSeq n)) Source #

fromLinearForm :: (FinSuppSeq n +> Scalar (FinSuppSeq n)) -+> DualVector (FinSuppSeq n) Source #

coerceDoubleDual :: VSCCoercion (Scalar (FinSuppSeq n)) (FinSuppSeq n) (DualVector (DualVector (FinSuppSeq n))) Source #

trace :: (FinSuppSeq n +> FinSuppSeq n) -+> Scalar (FinSuppSeq n) Source #

contractTensorMap :: (TensorSpace w, Scalar w ~ Scalar (FinSuppSeq n)) => (FinSuppSeq n +> (FinSuppSeq n w)) -+> w Source #

contractMapTensor :: (TensorSpace w, Scalar w ~ Scalar (FinSuppSeq n)) => (FinSuppSeq n (FinSuppSeq n +> w)) -+> w Source #

contractTensorFn :: (TensorSpace w, Scalar w ~ Scalar (FinSuppSeq n)) => (FinSuppSeq n -+> (FinSuppSeq n w)) -+> w Source #

contractLinearMapAgainst :: (LinearSpace w, Scalar w ~ Scalar (FinSuppSeq n)) => Bilinear (FinSuppSeq n +> w) (w -+> FinSuppSeq n) (Scalar (FinSuppSeq n)) Source #

applyDualVector :: Bilinear (DualVector (FinSuppSeq n)) (FinSuppSeq n) (Scalar (FinSuppSeq n)) Source #

applyLinear :: (TensorSpace w, Scalar w ~ Scalar (FinSuppSeq n)) => Bilinear (FinSuppSeq n +> w) (FinSuppSeq n) w Source #

composeLinear :: (LinearSpace w, TensorSpace x, Scalar w ~ Scalar (FinSuppSeq n), Scalar x ~ Scalar (FinSuppSeq n)) => Bilinear (w +> x) (FinSuppSeq n +> w) (FinSuppSeq n +> x) Source #

tensorId :: (LinearSpace w, Scalar w ~ Scalar (FinSuppSeq n)) => (FinSuppSeq n w) +> (FinSuppSeq n w) Source #

applyTensorFunctional :: (LinearSpace u, Scalar u ~ Scalar (FinSuppSeq n)) => Bilinear (DualVector (FinSuppSeq n u)) (FinSuppSeq n u) (Scalar (FinSuppSeq n)) Source #

applyTensorLinMap :: (LinearSpace u, TensorSpace w, Scalar u ~ Scalar (FinSuppSeq n), Scalar w ~ Scalar (FinSuppSeq n)) => Bilinear ((FinSuppSeq n u) +> w) (FinSuppSeq n u) w Source #

useTupleLinearSpaceComponents :: FinSuppSeq n ~ (x, y) => ((LinearSpace x, LinearSpace y, Scalar x ~ Scalar y) => φ) -> φ Source #

(Num' n, Unbox n) => LinearSpace (Sequence n) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type DualVector (Sequence n) Source #

Methods

dualSpaceWitness :: DualSpaceWitness (Sequence n) Source #

linearId :: Sequence n +> Sequence n Source #

idTensor :: Sequence n DualVector (Sequence n) Source #

sampleLinearFunction :: (TensorSpace w, Scalar (Sequence n) ~ Scalar w) => (Sequence n -+> w) -+> (Sequence n +> w) Source #

toLinearForm :: DualVector (Sequence n) -+> (Sequence n +> Scalar (Sequence n)) Source #

fromLinearForm :: (Sequence n +> Scalar (Sequence n)) -+> DualVector (Sequence n) Source #

coerceDoubleDual :: VSCCoercion (Scalar (Sequence n)) (Sequence n) (DualVector (DualVector (Sequence n))) Source #

trace :: (Sequence n +> Sequence n) -+> Scalar (Sequence n) Source #

contractTensorMap :: (TensorSpace w, Scalar w ~ Scalar (Sequence n)) => (Sequence n +> (Sequence n w)) -+> w Source #

contractMapTensor :: (TensorSpace w, Scalar w ~ Scalar (Sequence n)) => (Sequence n (Sequence n +> w)) -+> w Source #

contractTensorFn :: (TensorSpace w, Scalar w ~ Scalar (Sequence n)) => (Sequence n -+> (Sequence n w)) -+> w Source #

contractLinearMapAgainst :: (LinearSpace w, Scalar w ~ Scalar (Sequence n)) => Bilinear (Sequence n +> w) (w -+> Sequence n) (Scalar (Sequence n)) Source #

applyDualVector :: Bilinear (DualVector (Sequence n)) (Sequence n) (Scalar (Sequence n)) Source #

applyLinear :: (TensorSpace w, Scalar w ~ Scalar (Sequence n)) => Bilinear (Sequence n +> w) (Sequence n) w Source #

composeLinear :: (LinearSpace w, TensorSpace x, Scalar w ~ Scalar (Sequence n), Scalar x ~ Scalar (Sequence n)) => Bilinear (w +> x) (Sequence n +> w) (Sequence n +> x) Source #

tensorId :: (LinearSpace w, Scalar w ~ Scalar (Sequence n)) => (Sequence n w) +> (Sequence n w) Source #

applyTensorFunctional :: (LinearSpace u, Scalar u ~ Scalar (Sequence n)) => Bilinear (DualVector (Sequence n u)) (Sequence n u) (Scalar (Sequence n)) Source #

applyTensorLinMap :: (LinearSpace u, TensorSpace w, Scalar u ~ Scalar (Sequence n), Scalar w ~ Scalar (Sequence n)) => Bilinear ((Sequence n u) +> w) (Sequence n u) w Source #

useTupleLinearSpaceComponents :: Sequence n ~ (x, y) => ((LinearSpace x, LinearSpace y, Scalar x ~ Scalar y) => φ) -> φ Source #

(Num' s, Eq s) => LinearSpace (V0 s) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type DualVector (V0 s) Source #

Methods

dualSpaceWitness :: DualSpaceWitness (V0 s) Source #

linearId :: V0 s +> V0 s Source #

idTensor :: V0 s DualVector (V0 s) Source #

sampleLinearFunction :: (TensorSpace w, Scalar (V0 s) ~ Scalar w) => (V0 s -+> w) -+> (V0 s +> w) Source #

toLinearForm :: DualVector (V0 s) -+> (V0 s +> Scalar (V0 s)) Source #

fromLinearForm :: (V0 s +> Scalar (V0 s)) -+> DualVector (V0 s) Source #

coerceDoubleDual :: VSCCoercion (Scalar (V0 s)) (V0 s) (DualVector (DualVector (V0 s))) Source #

trace :: (V0 s +> V0 s) -+> Scalar (V0 s) Source #

contractTensorMap :: (TensorSpace w, Scalar w ~ Scalar (V0 s)) => (V0 s +> (V0 s w)) -+> w Source #

contractMapTensor :: (TensorSpace w, Scalar w ~ Scalar (V0 s)) => (V0 s (V0 s +> w)) -+> w Source #

contractTensorFn :: (TensorSpace w, Scalar w ~ Scalar (V0 s)) => (V0 s -+> (V0 s w)) -+> w Source #

contractLinearMapAgainst :: (LinearSpace w, Scalar w ~ Scalar (V0 s)) => Bilinear (V0 s +> w) (w -+> V0 s) (Scalar (V0 s)) Source #

applyDualVector :: Bilinear (DualVector (V0 s)) (V0 s) (Scalar (V0 s)) Source #

applyLinear :: (TensorSpace w, Scalar w ~ Scalar (V0 s)) => Bilinear (V0 s +> w) (V0 s) w Source #

composeLinear :: (LinearSpace w, TensorSpace x, Scalar w ~ Scalar (V0 s), Scalar x ~ Scalar (V0 s)) => Bilinear (w +> x) (V0 s +> w) (V0 s +> x) Source #

tensorId :: (LinearSpace w, Scalar w ~ Scalar (V0 s)) => (V0 s w) +> (V0 s w) Source #

applyTensorFunctional :: (LinearSpace u, Scalar u ~ Scalar (V0 s)) => Bilinear (DualVector (V0 s u)) (V0 s u) (Scalar (V0 s)) Source #

applyTensorLinMap :: (LinearSpace u, TensorSpace w, Scalar u ~ Scalar (V0 s), Scalar w ~ Scalar (V0 s)) => Bilinear ((V0 s u) +> w) (V0 s u) w Source #

useTupleLinearSpaceComponents :: V0 s ~ (x, y) => ((LinearSpace x, LinearSpace y, Scalar x ~ Scalar y) => φ) -> φ Source #

(Num' s, Eq s) => LinearSpace (V1 s) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type DualVector (V1 s) Source #

Methods

dualSpaceWitness :: DualSpaceWitness (V1 s) Source #

linearId :: V1 s +> V1 s Source #

idTensor :: V1 s DualVector (V1 s) Source #

sampleLinearFunction :: (TensorSpace w, Scalar (V1 s) ~ Scalar w) => (V1 s -+> w) -+> (V1 s +> w) Source #

toLinearForm :: DualVector (V1 s) -+> (V1 s +> Scalar (V1 s)) Source #

fromLinearForm :: (V1 s +> Scalar (V1 s)) -+> DualVector (V1 s) Source #

coerceDoubleDual :: VSCCoercion (Scalar (V1 s)) (V1 s) (DualVector (DualVector (V1 s))) Source #

trace :: (V1 s +> V1 s) -+> Scalar (V1 s) Source #

contractTensorMap :: (TensorSpace w, Scalar w ~ Scalar (V1 s)) => (V1 s +> (V1 s w)) -+> w Source #

contractMapTensor :: (TensorSpace w, Scalar w ~ Scalar (V1 s)) => (V1 s (V1 s +> w)) -+> w Source #

contractTensorFn :: (TensorSpace w, Scalar w ~ Scalar (V1 s)) => (V1 s -+> (V1 s w)) -+> w Source #

contractLinearMapAgainst :: (LinearSpace w, Scalar w ~ Scalar (V1 s)) => Bilinear (V1 s +> w) (w -+> V1 s) (Scalar (V1 s)) Source #

applyDualVector :: Bilinear (DualVector (V1 s)) (V1 s) (Scalar (V1 s)) Source #

applyLinear :: (TensorSpace w, Scalar w ~ Scalar (V1 s)) => Bilinear (V1 s +> w) (V1 s) w Source #

composeLinear :: (LinearSpace w, TensorSpace x, Scalar w ~ Scalar (V1 s), Scalar x ~ Scalar (V1 s)) => Bilinear (w +> x) (V1 s +> w) (V1 s +> x) Source #

tensorId :: (LinearSpace w, Scalar w ~ Scalar (V1 s)) => (V1 s w) +> (V1 s w) Source #

applyTensorFunctional :: (LinearSpace u, Scalar u ~ Scalar (V1 s)) => Bilinear (DualVector (V1 s u)) (V1 s u) (Scalar (V1 s)) Source #

applyTensorLinMap :: (LinearSpace u, TensorSpace w, Scalar u ~ Scalar (V1 s), Scalar w ~ Scalar (V1 s)) => Bilinear ((V1 s u) +> w) (V1 s u) w Source #

useTupleLinearSpaceComponents :: V1 s ~ (x, y) => ((LinearSpace x, LinearSpace y, Scalar x ~ Scalar y) => φ) -> φ Source #

(Num' s, Eq s) => LinearSpace (V2 s) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type DualVector (V2 s) Source #

Methods

dualSpaceWitness :: DualSpaceWitness (V2 s) Source #

linearId :: V2 s +> V2 s Source #

idTensor :: V2 s DualVector (V2 s) Source #

sampleLinearFunction :: (TensorSpace w, Scalar (V2 s) ~ Scalar w) => (V2 s -+> w) -+> (V2 s +> w) Source #

toLinearForm :: DualVector (V2 s) -+> (V2 s +> Scalar (V2 s)) Source #

fromLinearForm :: (V2 s +> Scalar (V2 s)) -+> DualVector (V2 s) Source #

coerceDoubleDual :: VSCCoercion (Scalar (V2 s)) (V2 s) (DualVector (DualVector (V2 s))) Source #

trace :: (V2 s +> V2 s) -+> Scalar (V2 s) Source #

contractTensorMap :: (TensorSpace w, Scalar w ~ Scalar (V2 s)) => (V2 s +> (V2 s w)) -+> w Source #

contractMapTensor :: (TensorSpace w, Scalar w ~ Scalar (V2 s)) => (V2 s (V2 s +> w)) -+> w Source #

contractTensorFn :: (TensorSpace w, Scalar w ~ Scalar (V2 s)) => (V2 s -+> (V2 s w)) -+> w Source #

contractLinearMapAgainst :: (LinearSpace w, Scalar w ~ Scalar (V2 s)) => Bilinear (V2 s +> w) (w -+> V2 s) (Scalar (V2 s)) Source #

applyDualVector :: Bilinear (DualVector (V2 s)) (V2 s) (Scalar (V2 s)) Source #

applyLinear :: (TensorSpace w, Scalar w ~ Scalar (V2 s)) => Bilinear (V2 s +> w) (V2 s) w Source #

composeLinear :: (LinearSpace w, TensorSpace x, Scalar w ~ Scalar (V2 s), Scalar x ~ Scalar (V2 s)) => Bilinear (w +> x) (V2 s +> w) (V2 s +> x) Source #

tensorId :: (LinearSpace w, Scalar w ~ Scalar (V2 s)) => (V2 s w) +> (V2 s w) Source #

applyTensorFunctional :: (LinearSpace u, Scalar u ~ Scalar (V2 s)) => Bilinear (DualVector (V2 s u)) (V2 s u) (Scalar (V2 s)) Source #

applyTensorLinMap :: (LinearSpace u, TensorSpace w, Scalar u ~ Scalar (V2 s), Scalar w ~ Scalar (V2 s)) => Bilinear ((V2 s u) +> w) (V2 s u) w Source #

useTupleLinearSpaceComponents :: V2 s ~ (x, y) => ((LinearSpace x, LinearSpace y, Scalar x ~ Scalar y) => φ) -> φ Source #

(Num' s, Eq s) => LinearSpace (V3 s) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type DualVector (V3 s) Source #

Methods

dualSpaceWitness :: DualSpaceWitness (V3 s) Source #

linearId :: V3 s +> V3 s Source #

idTensor :: V3 s DualVector (V3 s) Source #

sampleLinearFunction :: (TensorSpace w, Scalar (V3 s) ~ Scalar w) => (V3 s -+> w) -+> (V3 s +> w) Source #

toLinearForm :: DualVector (V3 s) -+> (V3 s +> Scalar (V3 s)) Source #

fromLinearForm :: (V3 s +> Scalar (V3 s)) -+> DualVector (V3 s) Source #

coerceDoubleDual :: VSCCoercion (Scalar (V3 s)) (V3 s) (DualVector (DualVector (V3 s))) Source #

trace :: (V3 s +> V3 s) -+> Scalar (V3 s) Source #

contractTensorMap :: (TensorSpace w, Scalar w ~ Scalar (V3 s)) => (V3 s +> (V3 s w)) -+> w Source #

contractMapTensor :: (TensorSpace w, Scalar w ~ Scalar (V3 s)) => (V3 s (V3 s +> w)) -+> w Source #

contractTensorFn :: (TensorSpace w, Scalar w ~ Scalar (V3 s)) => (V3 s -+> (V3 s w)) -+> w Source #

contractLinearMapAgainst :: (LinearSpace w, Scalar w ~ Scalar (V3 s)) => Bilinear (V3 s +> w) (w -+> V3 s) (Scalar (V3 s)) Source #

applyDualVector :: Bilinear (DualVector (V3 s)) (V3 s) (Scalar (V3 s)) Source #

applyLinear :: (TensorSpace w, Scalar w ~ Scalar (V3 s)) => Bilinear (V3 s +> w) (V3 s) w Source #

composeLinear :: (LinearSpace w, TensorSpace x, Scalar w ~ Scalar (V3 s), Scalar x ~ Scalar (V3 s)) => Bilinear (w +> x) (V3 s +> w) (V3 s +> x) Source #

tensorId :: (LinearSpace w, Scalar w ~ Scalar (V3 s)) => (V3 s w) +> (V3 s w) Source #

applyTensorFunctional :: (LinearSpace u, Scalar u ~ Scalar (V3 s)) => Bilinear (DualVector (V3 s u)) (V3 s u) (Scalar (V3 s)) Source #

applyTensorLinMap :: (LinearSpace u, TensorSpace w, Scalar u ~ Scalar (V3 s), Scalar w ~ Scalar (V3 s)) => Bilinear ((V3 s u) +> w) (V3 s u) w Source #

useTupleLinearSpaceComponents :: V3 s ~ (x, y) => ((LinearSpace x, LinearSpace y, Scalar x ~ Scalar y) => φ) -> φ Source #

(Num' s, Eq s) => LinearSpace (V4 s) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type DualVector (V4 s) Source #

Methods

dualSpaceWitness :: DualSpaceWitness (V4 s) Source #

linearId :: V4 s +> V4 s Source #

idTensor :: V4 s DualVector (V4 s) Source #

sampleLinearFunction :: (TensorSpace w, Scalar (V4 s) ~ Scalar w) => (V4 s -+> w) -+> (V4 s +> w) Source #

toLinearForm :: DualVector (V4 s) -+> (V4 s +> Scalar (V4 s)) Source #

fromLinearForm :: (V4 s +> Scalar (V4 s)) -+> DualVector (V4 s) Source #

coerceDoubleDual :: VSCCoercion (Scalar (V4 s)) (V4 s) (DualVector (DualVector (V4 s))) Source #

trace :: (V4 s +> V4 s) -+> Scalar (V4 s) Source #

contractTensorMap :: (TensorSpace w, Scalar w ~ Scalar (V4 s)) => (V4 s +> (V4 s w)) -+> w Source #

contractMapTensor :: (TensorSpace w, Scalar w ~ Scalar (V4 s)) => (V4 s (V4 s +> w)) -+> w Source #

contractTensorFn :: (TensorSpace w, Scalar w ~ Scalar (V4 s)) => (V4 s -+> (V4 s w)) -+> w Source #

contractLinearMapAgainst :: (LinearSpace w, Scalar w ~ Scalar (V4 s)) => Bilinear (V4 s +> w) (w -+> V4 s) (Scalar (V4 s)) Source #

applyDualVector :: Bilinear (DualVector (V4 s)) (V4 s) (Scalar (V4 s)) Source #

applyLinear :: (TensorSpace w, Scalar w ~ Scalar (V4 s)) => Bilinear (V4 s +> w) (V4 s) w Source #

composeLinear :: (LinearSpace w, TensorSpace x, Scalar w ~ Scalar (V4 s), Scalar x ~ Scalar (V4 s)) => Bilinear (w +> x) (V4 s +> w) (V4 s +> x) Source #

tensorId :: (LinearSpace w, Scalar w ~ Scalar (V4 s)) => (V4 s w) +> (V4 s w) Source #

applyTensorFunctional :: (LinearSpace u, Scalar u ~ Scalar (V4 s)) => Bilinear (DualVector (V4 s u)) (V4 s u) (Scalar (V4 s)) Source #

applyTensorLinMap :: (LinearSpace u, TensorSpace w, Scalar u ~ Scalar (V4 s), Scalar w ~ Scalar (V4 s)) => Bilinear ((V4 s u) +> w) (V4 s u) w Source #

useTupleLinearSpaceComponents :: V4 s ~ (x, y) => ((LinearSpace x, LinearSpace y, Scalar x ~ Scalar y) => φ) -> φ Source #

(Num' s, Semimanifold m, LinearSpace (Needle (VRep m)), Scalar (Needle m) ~ s, Scalar (Needle (VRep m)) ~ s) => LinearSpace (GenericNeedle m) Source # 
Instance details

Defined in Math.LinearMap.Category.Class

Associated Types

type DualVector (GenericNeedle m) Source #

Methods

dualSpaceWitness :: DualSpaceWitness (GenericNeedle m) Source #

linearId :: GenericNeedle m +> GenericNeedle m Source #

idTensor :: GenericNeedle m DualVector (GenericNeedle m) Source #

sampleLinearFunction :: (TensorSpace w, Scalar (GenericNeedle m) ~ Scalar w) => (GenericNeedle m -+> w) -+> (GenericNeedle m +> w) Source #

toLinearForm :: DualVector (GenericNeedle m) -+> (GenericNeedle m +> Scalar (GenericNeedle m)) Source #

fromLinearForm :: (GenericNeedle m +> Scalar (GenericNeedle m)) -+> DualVector (GenericNeedle m) Source #

coerceDoubleDual :: VSCCoercion (Scalar (GenericNeedle m)) (GenericNeedle m) (DualVector (DualVector (GenericNeedle m))) Source #

trace :: (GenericNeedle m +> GenericNeedle m) -+> Scalar (GenericNeedle m) Source #

contractTensorMap :: (TensorSpace w, Scalar w ~ Scalar (GenericNeedle m)) => (GenericNeedle m +> (GenericNeedle m w)) -+> w Source #

contractMapTensor :: (TensorSpace w, Scalar w ~ Scalar (GenericNeedle m)) => (GenericNeedle m (GenericNeedle m +> w)) -+> w Source #

contractTensorFn :: (TensorSpace w, Scalar w ~ Scalar (GenericNeedle m)) => (GenericNeedle m -+> (GenericNeedle m w)) -+> w Source #

contractLinearMapAgainst :: (LinearSpace w, Scalar w ~ Scalar (GenericNeedle m)) => Bilinear (GenericNeedle m +> w) (w -+> GenericNeedle m) (Scalar (GenericNeedle m)) Source #

applyDualVector :: Bilinear (DualVector (GenericNeedle m)) (GenericNeedle m) (Scalar (GenericNeedle m)) Source #

applyLinear :: (TensorSpace w, Scalar w ~ Scalar (GenericNeedle m)) => Bilinear (GenericNeedle m +> w) (GenericNeedle m) w Source #

composeLinear :: (LinearSpace w, TensorSpace x, Scalar w ~ Scalar (GenericNeedle m), Scalar x ~ Scalar (GenericNeedle m)) => Bilinear (w +> x) (GenericNeedle m +> w) (GenericNeedle m +> x) Source #

tensorId :: (LinearSpace w, Scalar w ~ Scalar (GenericNeedle m)) => (GenericNeedle m w) +> (GenericNeedle m w) Source #

applyTensorFunctional :: (LinearSpace u, Scalar u ~ Scalar (GenericNeedle m)) => Bilinear (DualVector (GenericNeedle m u)) (GenericNeedle m u) (Scalar (GenericNeedle m)) Source #

applyTensorLinMap :: (LinearSpace u, TensorSpace w, Scalar u ~ Scalar (GenericNeedle m), Scalar w ~ Scalar (GenericNeedle m)) => Bilinear ((GenericNeedle m u) +> w) (GenericNeedle m u) w Source #

useTupleLinearSpaceComponents :: GenericNeedle m ~ (x, y) => ((LinearSpace x, LinearSpace y, Scalar x ~ Scalar y) => φ) -> φ Source #

Num' s => LinearSpace (ZeroDim s) Source # 
Instance details

Defined in Math.LinearMap.Category.Class

Associated Types

type DualVector (ZeroDim s) Source #

Methods

dualSpaceWitness :: DualSpaceWitness (ZeroDim s) Source #

linearId :: ZeroDim s +> ZeroDim s Source #

idTensor :: ZeroDim s DualVector (ZeroDim s) Source #

sampleLinearFunction :: (TensorSpace w, Scalar (ZeroDim s) ~ Scalar w) => (ZeroDim s -+> w) -+> (ZeroDim s +> w) Source #

toLinearForm :: DualVector (ZeroDim s) -+> (ZeroDim s +> Scalar (ZeroDim s)) Source #

fromLinearForm :: (ZeroDim s +> Scalar (ZeroDim s)) -+> DualVector (ZeroDim s) Source #

coerceDoubleDual :: VSCCoercion (Scalar (ZeroDim s)) (ZeroDim s) (DualVector (DualVector (ZeroDim s))) Source #

trace :: (ZeroDim s +> ZeroDim s) -+> Scalar (ZeroDim s) Source #

contractTensorMap :: (TensorSpace w, Scalar w ~ Scalar (ZeroDim s)) => (ZeroDim s +> (ZeroDim s w)) -+> w Source #

contractMapTensor :: (TensorSpace w, Scalar w ~ Scalar (ZeroDim s)) => (ZeroDim s (ZeroDim s +> w)) -+> w Source #

contractTensorFn :: (TensorSpace w, Scalar w ~ Scalar (ZeroDim s)) => (ZeroDim s -+> (ZeroDim s w)) -+> w Source #

contractLinearMapAgainst :: (LinearSpace w, Scalar w ~ Scalar (ZeroDim s)) => Bilinear (ZeroDim s +> w) (w -+> ZeroDim s) (Scalar (ZeroDim s)) Source #

applyDualVector :: Bilinear (DualVector (ZeroDim s)) (ZeroDim s) (Scalar (ZeroDim s)) Source #

applyLinear :: (TensorSpace w, Scalar w ~ Scalar (ZeroDim s)) => Bilinear (ZeroDim s +> w) (ZeroDim s) w Source #

composeLinear :: (LinearSpace w, TensorSpace x, Scalar w ~ Scalar (ZeroDim s), Scalar x ~ Scalar (ZeroDim s)) => Bilinear (w +> x) (ZeroDim s +> w) (ZeroDim s +> x) Source #

tensorId :: (LinearSpace w, Scalar w ~ Scalar (ZeroDim s)) => (ZeroDim s w) +> (ZeroDim s w) Source #

applyTensorFunctional :: (LinearSpace u, Scalar u ~ Scalar (ZeroDim s)) => Bilinear (DualVector (ZeroDim s u)) (ZeroDim s u) (Scalar (ZeroDim s)) Source #

applyTensorLinMap :: (LinearSpace u, TensorSpace w, Scalar u ~ Scalar (ZeroDim s), Scalar w ~ Scalar (ZeroDim s)) => Bilinear ((ZeroDim s u) +> w) (ZeroDim s u) w Source #

useTupleLinearSpaceComponents :: ZeroDim s ~ (x, y) => ((LinearSpace x, LinearSpace y, Scalar x ~ Scalar y) => φ) -> φ Source #

(Num' s, LinearSpace v, Scalar v ~ s) => LinearSpace (SymmetricTensor s v) Source # 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type DualVector (SymmetricTensor s v) Source #

Methods

dualSpaceWitness :: DualSpaceWitness (SymmetricTensor s v) Source #

linearId :: SymmetricTensor s v +> SymmetricTensor s v Source #

idTensor :: SymmetricTensor s v DualVector (SymmetricTensor s v) Source #

sampleLinearFunction :: (TensorSpace w, Scalar (SymmetricTensor s v) ~ Scalar w) => (SymmetricTensor s v -+> w) -+> (SymmetricTensor s v +> w) Source #

toLinearForm :: DualVector (SymmetricTensor s v) -+> (SymmetricTensor s v +> Scalar (SymmetricTensor s v)) Source #

fromLinearForm :: (SymmetricTensor s v +> Scalar (SymmetricTensor s v)) -+> DualVector (SymmetricTensor s v) Source #

coerceDoubleDual :: VSCCoercion (Scalar (SymmetricTensor s v)) (SymmetricTensor s v) (DualVector (DualVector (SymmetricTensor s v))) Source #

trace :: (SymmetricTensor s v +> SymmetricTensor s v) -+> Scalar (SymmetricTensor s v) Source #

contractTensorMap :: (TensorSpace w, Scalar w ~ Scalar (SymmetricTensor s v)) => (SymmetricTensor s v +> (SymmetricTensor s v w)) -+> w Source #

contractMapTensor :: (TensorSpace w, Scalar w ~ Scalar (SymmetricTensor s v)) => (SymmetricTensor s v (SymmetricTensor s v +> w)) -+> w Source #

contractTensorFn :: (TensorSpace w, Scalar w ~ Scalar (SymmetricTensor s v)) => (SymmetricTensor s v -+> (SymmetricTensor s v w)) -+> w Source #

contractLinearMapAgainst :: (LinearSpace w, Scalar w ~ Scalar (SymmetricTensor s v)) => Bilinear (SymmetricTensor s v +> w) (w -+> SymmetricTensor s v) (Scalar (SymmetricTensor s v)) Source #

applyDualVector :: Bilinear (DualVector (SymmetricTensor s v)) (SymmetricTensor s v) (Scalar (SymmetricTensor s v)) Source #

applyLinear :: (TensorSpace w, Scalar w ~ Scalar (SymmetricTensor s v)) => Bilinear (SymmetricTensor s v +> w) (SymmetricTensor s v) w Source #

composeLinear :: (LinearSpace w, TensorSpace x, Scalar w ~ Scalar (SymmetricTensor s v), Scalar x ~ Scalar (SymmetricTensor s v)) => Bilinear (w +> x) (SymmetricTensor s v +> w) (SymmetricTensor s v +> x) Source #

tensorId :: (LinearSpace w, Scalar w ~ Scalar (SymmetricTensor s v)) => (SymmetricTensor s v w) +> (SymmetricTensor s v w) Source #

applyTensorFunctional :: (LinearSpace u, Scalar u ~ Scalar (SymmetricTensor s v)) => Bilinear (DualVector (SymmetricTensor s v u)) (SymmetricTensor s v u) (Scalar (SymmetricTensor s v)) Source #

applyTensorLinMap :: (LinearSpace u, TensorSpace w, Scalar u ~ Scalar (SymmetricTensor s v), Scalar w ~ Scalar (SymmetricTensor s v)) => Bilinear ((SymmetricTensor s v u) +> w) (SymmetricTensor s v u) w Source #

useTupleLinearSpaceComponents :: SymmetricTensor s v ~ (x, y) => ((LinearSpace x, LinearSpace y, Scalar x ~ Scalar y) => φ) -> φ Source #

(LinearSpace u, LinearSpace v, Scalar u ~ Scalar v) => LinearSpace (u, v) Source # 
Instance details

Defined in Math.LinearMap.Category.Class

Associated Types

type DualVector (u, v) Source #

Methods

dualSpaceWitness :: DualSpaceWitness (u, v) Source #

linearId :: (u, v) +> (u, v) Source #

idTensor :: (u, v) DualVector (u, v) Source #

sampleLinearFunction :: (TensorSpace w, Scalar (u, v) ~ Scalar w) => ((u, v) -+> w) -+> ((u, v) +> w) Source #

toLinearForm :: DualVector (u, v) -+> ((u, v) +> Scalar (u, v)) Source #

fromLinearForm :: ((u, v) +> Scalar (u, v)) -+> DualVector (u, v) Source #

coerceDoubleDual :: VSCCoercion (Scalar (u, v)) (u, v) (DualVector (DualVector (u, v))) Source #

trace :: ((u, v) +> (u, v)) -+> Scalar (u, v) Source #

contractTensorMap :: (TensorSpace w, Scalar w ~ Scalar (u, v)) => ((u, v) +> ((u, v) w)) -+> w Source #

contractMapTensor :: (TensorSpace w, Scalar w ~ Scalar (u, v)) => ((u, v) ((u, v) +> w)) -+> w Source #

contractTensorFn :: (TensorSpace w, Scalar w ~ Scalar (u, v)) => ((u, v) -+> ((u, v) w)) -+> w Source #

contractLinearMapAgainst :: (LinearSpace w, Scalar w ~ Scalar (u, v)) => Bilinear ((u, v) +> w) (w -+> (u, v)) (Scalar (u, v)) Source #

applyDualVector :: Bilinear (DualVector (u, v)) (u, v) (Scalar (u, v)) Source #

applyLinear :: (TensorSpace w, Scalar w ~ Scalar (u, v)) => Bilinear ((u, v) +> w) (u, v) w Source #

composeLinear :: (LinearSpace w, TensorSpace x, Scalar w ~ Scalar (u, v), Scalar x ~ Scalar (u, v)) => Bilinear (w +> x) ((u, v) +> w) ((u, v) +> x) Source #

tensorId :: (LinearSpace w, Scalar w ~ Scalar (u, v)) => ((u, v) w) +> ((u, v) w) Source #

applyTensorFunctional :: (LinearSpace u0, Scalar u0 ~ Scalar (u, v)) => Bilinear (DualVector ((u, v) u0)) ((u, v) u0) (Scalar (u, v)) Source #

applyTensorLinMap :: (LinearSpace u0, TensorSpace w, Scalar u0 ~ Scalar (u, v), Scalar w ~ Scalar (u, v)) => Bilinear (((u, v) u0) +> w) ((u, v) u0) w Source #

useTupleLinearSpaceComponents :: (u, v) ~ (x, y) => ((LinearSpace x, LinearSpace y, Scalar x ~ Scalar y) => φ) -> φ Source #

(LinearSpace v, Num (Scalar v)) => LinearSpace (Rec0 v s) Source # 
Instance details

Defined in Math.LinearMap.Category.Class

Associated Types

type DualVector (Rec0 v s) Source #

Methods

dualSpaceWitness :: DualSpaceWitness (Rec0 v s) Source #

linearId :: Rec0 v s +> Rec0 v s Source #

idTensor :: Rec0 v s DualVector (Rec0 v s) Source #

sampleLinearFunction :: (TensorSpace w, Scalar (Rec0 v s) ~ Scalar w) => (Rec0 v s -+> w) -+> (Rec0 v s +> w) Source #

toLinearForm :: DualVector (Rec0 v s) -+> (Rec0 v s +> Scalar (Rec0 v s)) Source #

fromLinearForm :: (Rec0 v s +> Scalar (Rec0 v s)) -+> DualVector (Rec0 v s) Source #

coerceDoubleDual :: VSCCoercion (Scalar (Rec0 v s)) (Rec0 v s) (DualVector (DualVector (Rec0 v s))) Source #

trace :: (Rec0 v s +> Rec0 v s) -+> Scalar (Rec0 v s) Source #

contractTensorMap :: (TensorSpace w, Scalar w ~ Scalar (Rec0 v s)) => (Rec0 v s +> (Rec0 v s w)) -+> w Source #

contractMapTensor :: (TensorSpace w, Scalar w ~ Scalar (Rec0 v s)) => (Rec0 v s (Rec0 v s +> w)) -+> w Source #

contractTensorFn :: (TensorSpace w, Scalar w ~ Scalar (Rec0 v s)) => (Rec0 v s -+> (Rec0 v s w)) -+> w Source #

contractLinearMapAgainst :: (LinearSpace w, Scalar w ~ Scalar (Rec0 v s)) => Bilinear (Rec0 v s +> w) (w -+> Rec0 v s) (Scalar (Rec0 v s)) Source #

applyDualVector :: Bilinear (DualVector (Rec0 v s)) (Rec0 v s) (Scalar (Rec0 v s)) Source #

applyLinear :: (TensorSpace w, Scalar w ~ Scalar (Rec0 v s)) => Bilinear (Rec0 v s +> w) (Rec0 v s) w Source #

composeLinear :: (LinearSpace w, TensorSpace x, Scalar w ~ Scalar (Rec0 v s), Scalar x ~ Scalar (Rec0 v s)) => Bilinear (w +> x) (Rec0 v s +> w) (Rec0 v s +> x) Source #

tensorId :: (LinearSpace w, Scalar w ~ Scalar (Rec0 v s)) => (Rec0 v s w) +> (Rec0 v s w) Source #

applyTensorFunctional :: (LinearSpace u, Scalar u ~ Scalar (Rec0 v s)) => Bilinear (DualVector (Rec0 v s u)) (Rec0 v s u) (Scalar (Rec0 v s)) Source #

applyTensorLinMap :: (LinearSpace u, TensorSpace w, Scalar u ~ Scalar (Rec0 v s), Scalar w ~ Scalar (Rec0 v s)) => Bilinear ((Rec0 v s u) +> w) (Rec0 v s u) w Source #

useTupleLinearSpaceComponents :: Rec0 v s ~ (x, y) => ((LinearSpace x, LinearSpace y, Scalar x ~ Scalar y) => φ) -> φ Source #

(LinearSpace u, LinearSpace v, Scalar u ~ s, Scalar v ~ s) => LinearSpace (LinearFunction s u v) Source # 
Instance details

Defined in Math.LinearMap.Category.Class

Associated Types

type DualVector (LinearFunction s u v) Source #

Methods

dualSpaceWitness :: DualSpaceWitness (LinearFunction s u v) Source #

linearId :: LinearFunction s u v +> LinearFunction s u v Source #

idTensor :: LinearFunction s u v DualVector (LinearFunction s u v) Source #

sampleLinearFunction :: (TensorSpace w, Scalar (LinearFunction s u v) ~ Scalar w) => (LinearFunction s u v -+> w) -+> (LinearFunction s u v +> w) Source #

toLinearForm :: DualVector (LinearFunction s u v) -+> (LinearFunction s u v +> Scalar (LinearFunction s u v)) Source #

fromLinearForm :: (LinearFunction s u v +> Scalar (LinearFunction s u v)) -+> DualVector (LinearFunction s u v) Source #

coerceDoubleDual :: VSCCoercion (Scalar (LinearFunction s u v)) (LinearFunction s u v) (DualVector (DualVector (LinearFunction s u v))) Source #

trace :: (LinearFunction s u v +> LinearFunction s u v) -+> Scalar (LinearFunction s u v) Source #

contractTensorMap :: (TensorSpace w, Scalar w ~ Scalar (LinearFunction s u v)) => (LinearFunction s u v +> (LinearFunction s u v w)) -+> w Source #

contractMapTensor :: (TensorSpace w, Scalar w ~ Scalar (LinearFunction s u v)) => (LinearFunction s u v (LinearFunction s u v +> w)) -+> w Source #

contractTensorFn :: (TensorSpace w, Scalar w ~ Scalar (LinearFunction s u v)) => (LinearFunction s u v -+> (LinearFunction s u v w)) -+> w Source #

contractLinearMapAgainst :: (LinearSpace w, Scalar w ~ Scalar (LinearFunction s u v)) => Bilinear (LinearFunction s u v +> w) (w -+> LinearFunction s u v) (Scalar (LinearFunction s u v)) Source #

applyDualVector :: Bilinear (DualVector (LinearFunction s u v)) (LinearFunction s u v) (Scalar (LinearFunction s u v)) Source #

applyLinear :: (TensorSpace w, Scalar w ~ Scalar (LinearFunction s u v)) => Bilinear (LinearFunction s u v +> w) (LinearFunction s u v) w Source #

composeLinear :: (LinearSpace w, TensorSpace x, Scalar w ~ Scalar (LinearFunction s u v), Scalar x ~ Scalar (LinearFunction s u v)) => Bilinear (w +> x) (LinearFunction s u v +> w) (LinearFunction s u v +> x) Source #

tensorId :: (LinearSpace w, Scalar w ~ Scalar (LinearFunction s u v)) => (LinearFunction s u v w) +> (LinearFunction s u v w) Source #

applyTensorFunctional :: (LinearSpace u0, Scalar u0 ~ Scalar (LinearFunction s u v)) => Bilinear (DualVector (LinearFunction s u v u0)) (LinearFunction s u v u0) (Scalar (LinearFunction s u v)) Source #

applyTensorLinMap :: (LinearSpace u0, TensorSpace w, Scalar u0 ~ Scalar (LinearFunction s u v), Scalar w ~ Scalar (LinearFunction s u v)) => Bilinear ((LinearFunction s u v u0) +> w) (LinearFunction s u v u0) w Source #

useTupleLinearSpaceComponents :: LinearFunction s u v ~ (x, y) => ((LinearSpace x, LinearSpace y, Scalar x ~ Scalar y) => φ) -> φ Source #

(LinearSpace u, LinearSpace v, Scalar u ~ s, Scalar v ~ s) => LinearSpace (LinearMap s u v) Source # 
Instance details

Defined in Math.LinearMap.Category.Class

Associated Types

type DualVector (LinearMap s u v) Source #

Methods

dualSpaceWitness :: DualSpaceWitness (LinearMap s u v) Source #

linearId :: LinearMap s u v +> LinearMap s u v Source #

idTensor :: LinearMap s u v DualVector (LinearMap s u v) Source #

sampleLinearFunction :: (TensorSpace w, Scalar (LinearMap s u v) ~ Scalar w) => (LinearMap s u v -+> w) -+> (LinearMap s u v +> w) Source #

toLinearForm :: DualVector (LinearMap s u v) -+> (LinearMap s u v +> Scalar (LinearMap s u v)) Source #

fromLinearForm :: (LinearMap s u v +> Scalar (LinearMap s u v)) -+> DualVector (LinearMap s u v) Source #

coerceDoubleDual :: VSCCoercion (Scalar (LinearMap s u v)) (LinearMap s u v) (DualVector (DualVector (LinearMap s u v))) Source #

trace :: (LinearMap s u v +> LinearMap s u v) -+> Scalar (LinearMap s u v) Source #

contractTensorMap :: (TensorSpace w, Scalar w ~ Scalar (LinearMap s u v)) => (LinearMap s u v +> (LinearMap s u v w)) -+> w Source #

contractMapTensor :: (TensorSpace w, Scalar w ~ Scalar (LinearMap s u v)) => (LinearMap s u v (LinearMap s u v +> w)) -+> w Source #

contractTensorFn :: (TensorSpace w, Scalar w ~ Scalar (LinearMap s u v)) => (LinearMap s u v -+> (LinearMap s u v w)) -+> w Source #

contractLinearMapAgainst :: (LinearSpace w, Scalar w ~ Scalar (LinearMap s u v)) => Bilinear (LinearMap s u v +> w) (w -+> LinearMap s u v) (Scalar (LinearMap s u v)) Source #

applyDualVector :: Bilinear (DualVector (LinearMap s u v)) (LinearMap s u v) (Scalar (LinearMap s u v)) Source #

applyLinear :: (TensorSpace w, Scalar w ~ Scalar (LinearMap s u v)) => Bilinear (LinearMap s u v +> w) (LinearMap s u v) w Source #

composeLinear :: (LinearSpace w, TensorSpace x, Scalar w ~ Scalar (LinearMap s u v), Scalar x ~ Scalar (LinearMap s u v)) => Bilinear (w +> x) (LinearMap s u v +> w) (LinearMap s u v +> x) Source #

tensorId :: (LinearSpace w, Scalar w ~ Scalar (LinearMap s u v)) => (LinearMap s u v w) +> (LinearMap s u v w) Source #

applyTensorFunctional :: (LinearSpace u0, Scalar u0 ~ Scalar (LinearMap s u v)) => Bilinear (DualVector (LinearMap s u v u0)) (LinearMap s u v u0) (Scalar (LinearMap s u v)) Source #

applyTensorLinMap :: (LinearSpace u0, TensorSpace w, Scalar u0 ~ Scalar (LinearMap s u v), Scalar w ~ Scalar (LinearMap s u v)) => Bilinear ((LinearMap s u v u0) +> w) (LinearMap s u v u0) w Source #

useTupleLinearSpaceComponents :: LinearMap s u v ~ (x, y) => ((LinearSpace x, LinearSpace y, Scalar x ~ Scalar y) => φ) -> φ Source #

(LinearSpace u, LinearSpace v, Scalar u ~ s, Scalar v ~ s) => LinearSpace (Tensor s u v) Source # 
Instance details

Defined in Math.LinearMap.Category.Class

Associated Types

type DualVector (Tensor s u v) Source #

Methods

dualSpaceWitness :: DualSpaceWitness (Tensor s u v) Source #

linearId :: Tensor s u v +> Tensor s u v Source #

idTensor :: Tensor s u v DualVector (Tensor s u v) Source #

sampleLinearFunction :: (TensorSpace w, Scalar (Tensor s u v) ~ Scalar w) => (Tensor s u v -+> w) -+> (Tensor s u v +> w) Source #

toLinearForm :: DualVector (Tensor s u v) -+> (Tensor s u v +> Scalar (Tensor s u v)) Source #

fromLinearForm :: (Tensor s u v +> Scalar (Tensor s u v)) -+> DualVector (Tensor s u v) Source #

coerceDoubleDual :: VSCCoercion (Scalar (Tensor s u v)) (Tensor s u v) (DualVector (DualVector (Tensor s u v))) Source #

trace :: (Tensor s u v +> Tensor s u v) -+> Scalar (Tensor s u v) Source #

contractTensorMap :: (TensorSpace w, Scalar w ~ Scalar (Tensor s u v)) => (Tensor s u v +> (Tensor s u v w)) -+> w Source #

contractMapTensor :: (TensorSpace w, Scalar w ~ Scalar (Tensor s u v)) => (Tensor s u v (Tensor s u v +> w)) -+> w Source #

contractTensorFn :: (TensorSpace w, Scalar w ~ Scalar (Tensor s u v)) => (Tensor s u v -+> (Tensor s u v w)) -+> w Source #

contractLinearMapAgainst :: (LinearSpace w, Scalar w ~ Scalar (Tensor s u v)) => Bilinear (Tensor s u v +> w) (w -+> Tensor s u v) (Scalar (Tensor s u v)) Source #

applyDualVector :: Bilinear (DualVector (Tensor s u v)) (Tensor s u v) (Scalar (Tensor s u v)) Source #

applyLinear :: (TensorSpace w, Scalar w ~ Scalar (Tensor s u v)) => Bilinear (Tensor s u v +> w) (Tensor s u v) w Source #

composeLinear :: (LinearSpace w, TensorSpace x, Scalar w ~ Scalar (Tensor s u v), Scalar x ~ Scalar (Tensor s u v)) => Bilinear (w +> x) (Tensor s u v +> w) (Tensor s u v +> x) Source #

tensorId :: (LinearSpace w, Scalar w ~ Scalar (Tensor s u v)) => (Tensor s u v w) +> (Tensor s u v w) Source #

applyTensorFunctional :: (LinearSpace u0, Scalar u0 ~ Scalar (Tensor s u v)) => Bilinear (DualVector (Tensor s u v u0)) (Tensor s u v u0) (Scalar (Tensor s u v)) Source #

applyTensorLinMap :: (LinearSpace u0, TensorSpace w, Scalar u0 ~ Scalar (Tensor s u v), Scalar w ~ Scalar (Tensor s u v)) => Bilinear ((Tensor s u v u0) +> w) (Tensor s u v u0) w Source #

useTupleLinearSpaceComponents :: Tensor s u v ~ (x, y) => ((LinearSpace x, LinearSpace y, Scalar x ~ Scalar y) => φ) -> φ Source #

(LinearSpace (f p), LinearSpace (g p), Scalar (f p) ~ Scalar (g p)) => LinearSpace ((f :*: g) p) Source # 
Instance details

Defined in Math.LinearMap.Category.Class

Associated Types

type DualVector ((f :*: g) p) Source #

Methods

dualSpaceWitness :: DualSpaceWitness ((f :*: g) p) Source #

linearId :: (f :*: g) p +> (f :*: g) p Source #

idTensor :: (f :*: g) p DualVector ((f :*: g) p) Source #

sampleLinearFunction :: (TensorSpace w, Scalar ((f :*: g) p) ~ Scalar w) => ((f :*: g) p -+> w) -+> ((f :*: g) p +> w) Source #

toLinearForm :: DualVector ((f :*: g) p) -+> ((f :*: g) p +> Scalar ((f :*: g) p)) Source #

fromLinearForm :: ((f :*: g) p +> Scalar ((f :*: g) p)) -+> DualVector ((f :*: g) p) Source #

coerceDoubleDual :: VSCCoercion (Scalar ((f :*: g) p)) ((f :*: g) p) (DualVector (DualVector ((f :*: g) p))) Source #

trace :: ((f :*: g) p +> (f :*: g) p) -+> Scalar ((f :*: g) p) Source #

contractTensorMap :: (TensorSpace w, Scalar w ~ Scalar ((f :*: g) p)) => ((f :*: g) p +> ((f :*: g) p w)) -+> w Source #

contractMapTensor :: (TensorSpace w, Scalar w ~ Scalar ((f :*: g) p)) => ((f :*: g) p ((f :*: g) p +> w)) -+> w Source #

contractTensorFn :: (TensorSpace w, Scalar w ~ Scalar ((f :*: g) p)) => ((f :*: g) p -+> ((f :*: g) p w)) -+> w Source #

contractLinearMapAgainst :: (LinearSpace w, Scalar w ~ Scalar ((f :*: g) p)) => Bilinear ((f :*: g) p +> w) (w -+> (f :*: g) p) (Scalar ((f :*: g) p)) Source #

applyDualVector :: Bilinear (DualVector ((f :*: g) p)) ((f :*: g) p) (Scalar ((f :*: g) p)) Source #

applyLinear :: (TensorSpace w, Scalar w ~ Scalar ((f :*: g) p)) => Bilinear ((f :*: g) p +> w) ((f :*: g) p) w Source #

composeLinear :: (LinearSpace w, TensorSpace x, Scalar w ~ Scalar ((f :*: g) p), Scalar x ~ Scalar ((f :*: g) p)) => Bilinear (w +> x) ((f :*: g) p +> w) ((f :*: g) p +> x) Source #

tensorId :: (LinearSpace w, Scalar w ~ Scalar ((f :*: g) p)) => ((f :*: g) p w) +> ((f :*: g) p w) Source #

applyTensorFunctional :: (LinearSpace u, Scalar u ~ Scalar ((f :*: g) p)) => Bilinear (DualVector ((f :*: g) p u)) ((f :*: g) p u) (Scalar ((f :*: g) p)) Source #

applyTensorLinMap :: (LinearSpace u, TensorSpace w, Scalar u ~ Scalar ((f :*: g) p), Scalar w ~ Scalar ((f :*: g) p)) => Bilinear (((f :*: g) p u) +> w) ((f :*: g) p u) w Source #

useTupleLinearSpaceComponents :: (f :*: g) p ~ (x, y) => ((LinearSpace x, LinearSpace y, Scalar x ~ Scalar y) => φ) -> φ Source #

(LinearSpace (f p), Num (Scalar (f p))) => LinearSpace (M1 i c f p) Source # 
Instance details

Defined in Math.LinearMap.Category.Class

Associated Types

type DualVector (M1 i c f p) Source #

Methods

dualSpaceWitness :: DualSpaceWitness (M1 i c f p) Source #

linearId :: M1 i c f p +> M1 i c f p Source #

idTensor :: M1 i c f p DualVector (M1 i c f p) Source #

sampleLinearFunction :: (TensorSpace w, Scalar (M1 i c f p) ~ Scalar w) => (M1 i c f p -+> w) -+> (M1 i c f p +> w) Source #

toLinearForm :: DualVector (M1 i c f p) -+> (M1 i c f p +> Scalar (M1 i c f p)) Source #

fromLinearForm :: (M1 i c f p +> Scalar (M1 i c f p)) -+> DualVector (M1 i c f p) Source #

coerceDoubleDual :: VSCCoercion (Scalar (M1 i c f p)) (M1 i c f p) (DualVector (DualVector (M1 i c f p))) Source #

trace :: (M1 i c f p +> M1 i c f p) -+> Scalar (M1 i c f p) Source #

contractTensorMap :: (TensorSpace w, Scalar w ~ Scalar (M1 i c f p)) => (M1 i c f p +> (M1 i c f p w)) -+> w Source #

contractMapTensor :: (TensorSpace w, Scalar w ~ Scalar (M1 i c f p)) => (M1 i c f p (M1 i c f p +> w)) -+> w Source #

contractTensorFn :: (TensorSpace w, Scalar w ~ Scalar (M1 i c f p)) => (M1 i c f p -+> (M1 i c f p w)) -+> w Source #

contractLinearMapAgainst :: (LinearSpace w, Scalar w ~ Scalar (M1 i c f p)) => Bilinear (M1 i c f p +> w) (w -+> M1 i c f p) (Scalar (M1 i c f p)) Source #

applyDualVector :: Bilinear (DualVector (M1 i c f p)) (M1 i c f p) (Scalar (M1 i c f p)) Source #

applyLinear :: (TensorSpace w, Scalar w ~ Scalar (M1 i c f p)) => Bilinear (M1 i c f p +> w) (M1 i c f p) w Source #

composeLinear :: (LinearSpace w, TensorSpace x, Scalar w ~ Scalar (M1 i c f p), Scalar x ~ Scalar (M1 i c f p)) => Bilinear (w +> x) (M1 i c f p +> w) (M1 i c f p +> x) Source #

tensorId :: (LinearSpace w, Scalar w ~ Scalar (M1 i c f p)) => (M1 i c f p w) +> (M1 i c f p w) Source #

applyTensorFunctional :: (LinearSpace u, Scalar u ~ Scalar (M1 i c f p)) => Bilinear (DualVector (M1 i c f p u)) (M1 i c f p u) (Scalar (M1 i c f p)) Source #

applyTensorLinMap :: (LinearSpace u, TensorSpace w, Scalar u ~ Scalar (M1 i c f p), Scalar w ~ Scalar (M1 i c f p)) => Bilinear ((M1 i c f p u) +> w) (M1 i c f p u) w Source #

useTupleLinearSpaceComponents :: M1 i c f p ~ (x, y) => ((LinearSpace x, LinearSpace y, Scalar x ~ Scalar y) => φ) -> φ Source #

class (LSpace v, Eq v) => FiniteDimensional v where Source #

Associated Types

data SubBasis v :: Type Source #

Whereas Basis-values refer to a single basis vector, a single SubBasis value represents a collection of such basis vectors, which can be used to associate a vector with a list of coefficients.

For spaces with a canonical finite basis, SubBasis does not actually need to contain any information, it can simply have the full finite basis as its only value. Even for large sparse spaces, it should only have a very coarse structure that can be shared by many vectors.

Methods

entireBasis :: SubBasis v Source #

enumerateSubBasis :: SubBasis v -> [v] Source #

subbasisDimension :: SubBasis v -> Int Source #

decomposeLinMap :: (LSpace w, Scalar w ~ Scalar v) => (v +> w) -> (SubBasis v, DList w) Source #

Split up a linear map in “column vectors” WRT some suitable basis.

decomposeLinMapWithin :: (LSpace w, Scalar w ~ Scalar v) => SubBasis v -> (v +> w) -> Either (SubBasis v, DList w) (DList w) Source #

Expand in the given basis, if possible. Else yield a superbasis of the given one, in which this is possible, and the decomposition therein.

recomposeSB :: SubBasis v -> [Scalar v] -> (v, [Scalar v]) Source #

Assemble a vector from coefficients in some basis. Return any excess coefficients.

recomposeSBTensor :: (FiniteDimensional w, Scalar w ~ Scalar v) => SubBasis v -> SubBasis w -> [Scalar v] -> (v w, [Scalar v]) Source #

recomposeLinMap :: (LSpace w, Scalar w ~ Scalar v) => SubBasis v -> [w] -> (v +> w, [w]) Source #

recomposeContraLinMap :: (LinearSpace w, Scalar w ~ Scalar v, Functor f) => (f (Scalar w) -> w) -> f (DualVector v) -> v +> w Source #

Given a function that interprets a coefficient-container as a vector representation, build a linear function mapping to that space.

recomposeContraLinMapTensor :: (FiniteDimensional u, LinearSpace w, Scalar u ~ Scalar v, Scalar w ~ Scalar v, Functor f) => (f (Scalar w) -> w) -> f (v +> DualVector u) -> (v u) +> w Source #

uncanonicallyFromDual :: DualVector v -+> v Source #

The existance of a finite basis gives us an isomorphism between a space and its dual space. Note that this isomorphism is not natural (i.e. it depends on the actual choice of basis, unlike everything else in this library).

uncanonicallyToDual :: v -+> DualVector v Source #

tensorEquality :: (TensorSpace w, Eq w, Scalar w ~ Scalar v) => (v w) -> (v w) -> Bool Source #

dualFinitenessWitness :: DualFinitenessWitness v Source #

Instances

Instances details
(Num' s, Eq s, LinearSpace s) => FiniteDimensional (V0 s) Source # 
Instance details

Defined in Math.VectorSpace.Docile

Associated Types

data SubBasis (V0 s) Source #

Methods

entireBasis :: SubBasis (V0 s) Source #

enumerateSubBasis :: SubBasis (V0 s) -> [V0 s] Source #

subbasisDimension :: SubBasis (V0 s) -> Int Source #

decomposeLinMap :: (LSpace w, Scalar w ~ Scalar (V0 s)) => (V0 s +> w) -> (SubBasis (V0 s), DList w) Source #

decomposeLinMapWithin :: (LSpace w, Scalar w ~ Scalar (V0 s)) => SubBasis (V0 s) -> (V0 s +> w) -> Either (SubBasis (V0 s), DList w) (DList w) Source #

recomposeSB :: SubBasis (V0 s) -> [Scalar (V0 s)] -> (V0 s, [Scalar (V0 s)]) Source #

recomposeSBTensor :: (FiniteDimensional w, Scalar w ~ Scalar (V0 s)) => SubBasis (V0 s) -> SubBasis w -> [Scalar (V0 s)] -> (V0 s w, [Scalar (V0 s)]) Source #

recomposeLinMap :: (LSpace w, Scalar w ~ Scalar (V0 s)) => SubBasis (V0 s) -> [w] -> (V0 s +> w, [w]) Source #

recomposeContraLinMap :: (LinearSpace w, Scalar w ~ Scalar (V0 s), Functor f) => (f (Scalar w) -> w) -> f (DualVector (V0 s)) -> V0 s +> w Source #

recomposeContraLinMapTensor :: (FiniteDimensional u, LinearSpace w, Scalar u ~ Scalar (V0 s), Scalar w ~ Scalar (V0 s), Functor f) => (f (Scalar w) -> w) -> f (V0 s +> DualVector u) -> (V0 s u) +> w Source #

uncanonicallyFromDual :: DualVector (V0 s) -+> V0 s Source #

uncanonicallyToDual :: V0 s -+> DualVector (V0 s) Source #

tensorEquality :: (TensorSpace w, Eq w, Scalar w ~ Scalar (V0 s)) => (V0 s w) -> (V0 s w) -> Bool Source #

dualFinitenessWitness :: DualFinitenessWitness (V0 s) Source #

(Num' s, Eq s, LSpace s) => FiniteDimensional (V1 s) Source # 
Instance details

Defined in Math.VectorSpace.Docile

Associated Types

data SubBasis (V1 s) Source #

Methods

entireBasis :: SubBasis (V1 s) Source #

enumerateSubBasis :: SubBasis (V1 s) -> [V1 s] Source #

subbasisDimension :: SubBasis (V1 s) -> Int Source #

decomposeLinMap :: (LSpace w, Scalar w ~ Scalar (V1 s)) => (V1 s +> w) -> (SubBasis (V1 s), DList w) Source #

decomposeLinMapWithin :: (LSpace w, Scalar w ~ Scalar (V1 s)) => SubBasis (V1 s) -> (V1 s +> w) -> Either (SubBasis (V1 s), DList w) (DList w) Source #

recomposeSB :: SubBasis (V1 s) -> [Scalar (V1 s)] -> (V1 s, [Scalar (V1 s)]) Source #

recomposeSBTensor :: (FiniteDimensional w, Scalar w ~ Scalar (V1 s)) => SubBasis (V1 s) -> SubBasis w -> [Scalar (V1 s)] -> (V1 s w, [Scalar (V1 s)]) Source #

recomposeLinMap :: (LSpace w, Scalar w ~ Scalar (V1 s)) => SubBasis (V1 s) -> [w] -> (V1 s +> w, [w]) Source #

recomposeContraLinMap :: (LinearSpace w, Scalar w ~ Scalar (V1 s), Functor f) => (f (Scalar w) -> w) -> f (DualVector (V1 s)) -> V1 s +> w Source #

recomposeContraLinMapTensor :: (FiniteDimensional u, LinearSpace w, Scalar u ~ Scalar (V1 s), Scalar w ~ Scalar (V1 s), Functor f) => (f (Scalar w) -> w) -> f (V1 s +> DualVector u) -> (V1 s u) +> w Source #

uncanonicallyFromDual :: DualVector (V1 s) -+> V1 s Source #

uncanonicallyToDual :: V1 s -+> DualVector (V1 s) Source #

tensorEquality :: (TensorSpace w, Eq w, Scalar w ~ Scalar (V1 s)) => (V1 s w) -> (V1 s w) -> Bool Source #

dualFinitenessWitness :: DualFinitenessWitness (V1 s) Source #

(Num' s, Eq s, LSpace s) => FiniteDimensional (V2 s) Source # 
Instance details

Defined in Math.VectorSpace.Docile

Associated Types

data SubBasis (V2 s) Source #

Methods

entireBasis :: SubBasis (V2 s) Source #

enumerateSubBasis :: SubBasis (V2 s) -> [V2 s] Source #

subbasisDimension :: SubBasis (V2 s) -> Int Source #

decomposeLinMap :: (LSpace w, Scalar w ~ Scalar (V2 s)) => (V2 s +> w) -> (SubBasis (V2 s), DList w) Source #

decomposeLinMapWithin :: (LSpace w, Scalar w ~ Scalar (V2 s)) => SubBasis (V2 s) -> (V2 s +> w) -> Either (SubBasis (V2 s), DList w) (DList w) Source #

recomposeSB :: SubBasis (V2 s) -> [Scalar (V2 s)] -> (V2 s, [Scalar (V2 s)]) Source #

recomposeSBTensor :: (FiniteDimensional w, Scalar w ~ Scalar (V2 s)) => SubBasis (V2 s) -> SubBasis w -> [Scalar (V2 s)] -> (V2 s w, [Scalar (V2 s)]) Source #

recomposeLinMap :: (LSpace w, Scalar w ~ Scalar (V2 s)) => SubBasis (V2 s) -> [w] -> (V2 s +> w, [w]) Source #

recomposeContraLinMap :: (LinearSpace w, Scalar w ~ Scalar (V2 s), Functor f) => (f (Scalar w) -> w) -> f (DualVector (V2 s)) -> V2 s +> w Source #

recomposeContraLinMapTensor :: (FiniteDimensional u, LinearSpace w, Scalar u ~ Scalar (V2 s), Scalar w ~ Scalar (V2 s), Functor f) => (f (Scalar w) -> w) -> f (V2 s +> DualVector u) -> (V2 s u) +> w Source #

uncanonicallyFromDual :: DualVector (V2 s) -+> V2 s Source #

uncanonicallyToDual :: V2 s -+> DualVector (V2 s) Source #

tensorEquality :: (TensorSpace w, Eq w, Scalar w ~ Scalar (V2 s)) => (V2 s w) -> (V2 s w) -> Bool Source #

dualFinitenessWitness :: DualFinitenessWitness (V2 s) Source #

(Num' s, Eq s, LSpace s) => FiniteDimensional (V3 s) Source # 
Instance details

Defined in Math.VectorSpace.Docile

Associated Types

data SubBasis (V3 s) Source #

Methods

entireBasis :: SubBasis (V3 s) Source #

enumerateSubBasis :: SubBasis (V3 s) -> [V3 s] Source #

subbasisDimension :: SubBasis (V3 s) -> Int Source #

decomposeLinMap :: (LSpace w, Scalar w ~ Scalar (V3 s)) => (V3 s +> w) -> (SubBasis (V3 s), DList w) Source #

decomposeLinMapWithin :: (LSpace w, Scalar w ~ Scalar (V3 s)) => SubBasis (V3 s) -> (V3 s +> w) -> Either (SubBasis (V3 s), DList w) (DList w) Source #

recomposeSB :: SubBasis (V3 s) -> [Scalar (V3 s)] -> (V3 s, [Scalar (V3 s)]) Source #

recomposeSBTensor :: (FiniteDimensional w, Scalar w ~ Scalar (V3 s)) => SubBasis (V3 s) -> SubBasis w -> [Scalar (V3 s)] -> (V3 s w, [Scalar (V3 s)]) Source #

recomposeLinMap :: (LSpace w, Scalar w ~ Scalar (V3 s)) => SubBasis (V3 s) -> [w] -> (V3 s +> w, [w]) Source #

recomposeContraLinMap :: (LinearSpace w, Scalar w ~ Scalar (V3 s), Functor f) => (f (Scalar w) -> w) -> f (DualVector (V3 s)) -> V3 s +> w Source #

recomposeContraLinMapTensor :: (FiniteDimensional u, LinearSpace w, Scalar u ~ Scalar (V3 s), Scalar w ~ Scalar (V3 s), Functor f) => (f (Scalar w) -> w) -> f (V3 s +> DualVector u) -> (V3 s u) +> w Source #

uncanonicallyFromDual :: DualVector (V3 s) -+> V3 s Source #

uncanonicallyToDual :: V3 s -+> DualVector (V3 s) Source #

tensorEquality :: (TensorSpace w, Eq w, Scalar w ~ Scalar (V3 s)) => (V3 s w) -> (V3 s w) -> Bool Source #

dualFinitenessWitness :: DualFinitenessWitness (V3 s) Source #

(Num' s, Eq s, LSpace s) => FiniteDimensional (V4 s) Source # 
Instance details

Defined in Math.VectorSpace.Docile

Associated Types

data SubBasis (V4 s) Source #

Methods

entireBasis :: SubBasis (V4 s) Source #

enumerateSubBasis :: SubBasis (V4 s) -> [V4 s] Source #

subbasisDimension :: SubBasis (V4 s) -> Int Source #

decomposeLinMap :: (LSpace w, Scalar w ~ Scalar (V4 s)) => (V4 s +> w) -> (SubBasis (V4 s), DList w) Source #

decomposeLinMapWithin :: (LSpace w, Scalar w ~ Scalar (V4 s)) => SubBasis (V4 s) -> (V4 s +> w) -> Either (SubBasis (V4 s), DList w) (DList w) Source #

recomposeSB :: SubBasis (V4 s) -> [Scalar (V4 s)] -> (V4 s, [Scalar (V4 s)]) Source #

recomposeSBTensor :: (FiniteDimensional w, Scalar w ~ Scalar (V4 s)) => SubBasis (V4 s) -> SubBasis w -> [Scalar (V4 s)] -> (V4 s w, [Scalar (V4 s)]) Source #

recomposeLinMap :: (LSpace w, Scalar w ~ Scalar (V4 s)) => SubBasis (V4 s) -> [w] -> (V4 s +> w, [w]) Source #

recomposeContraLinMap :: (LinearSpace w, Scalar w ~ Scalar (V4 s), Functor f) => (f (Scalar w) -> w) -> f (DualVector (V4 s)) -> V4 s +> w Source #

recomposeContraLinMapTensor :: (FiniteDimensional u, LinearSpace w, Scalar u ~ Scalar (V4 s), Scalar w ~ Scalar (V4 s), Functor f) => (f (Scalar w) -> w) -> f (V4 s +> DualVector u) -> (V4 s u) +> w Source #

uncanonicallyFromDual :: DualVector (V4 s) -+> V4 s Source #

uncanonicallyToDual :: V4 s -+> DualVector (V4 s) Source #

tensorEquality :: (TensorSpace w, Eq w, Scalar w ~ Scalar (V4 s)) => (V4 s w) -> (V4 s w) -> Bool Source #

dualFinitenessWitness :: DualFinitenessWitness (V4 s) Source #

Num' s => FiniteDimensional (ZeroDim s) Source # 
Instance details

Defined in Math.VectorSpace.Docile

Associated Types

data SubBasis (ZeroDim s) Source #

Methods

entireBasis :: SubBasis (ZeroDim s) Source #

enumerateSubBasis :: SubBasis (ZeroDim s) -> [ZeroDim s] Source #

subbasisDimension :: SubBasis (ZeroDim s) -> Int Source #

decomposeLinMap :: (LSpace w, Scalar w ~ Scalar (ZeroDim s)) => (ZeroDim s +> w) -> (SubBasis (ZeroDim s), DList w) Source #

decomposeLinMapWithin :: (LSpace w, Scalar w ~ Scalar (ZeroDim s)) => SubBasis (ZeroDim s) -> (ZeroDim s +> w) -> Either (SubBasis (ZeroDim s), DList w) (DList w) Source #

recomposeSB :: SubBasis (ZeroDim s) -> [Scalar (ZeroDim s)] -> (ZeroDim s, [Scalar (ZeroDim s)]) Source #

recomposeSBTensor :: (FiniteDimensional w, Scalar w ~ Scalar (ZeroDim s)) => SubBasis (ZeroDim s) -> SubBasis w -> [Scalar (ZeroDim s)] -> (ZeroDim s w, [Scalar (ZeroDim s)]) Source #

recomposeLinMap :: (LSpace w, Scalar w ~ Scalar (ZeroDim s)) => SubBasis (ZeroDim s) -> [w] -> (ZeroDim s +> w, [w]) Source #

recomposeContraLinMap :: (LinearSpace w, Scalar w ~ Scalar (ZeroDim s), Functor f) => (f (Scalar w) -> w) -> f (DualVector (ZeroDim s)) -> ZeroDim s +> w Source #

recomposeContraLinMapTensor :: (FiniteDimensional u, LinearSpace w, Scalar u ~ Scalar (ZeroDim s), Scalar w ~ Scalar (ZeroDim s), Functor f) => (f (Scalar w) -> w) -> f (ZeroDim s +> DualVector u) -> (ZeroDim s u) +> w Source #

uncanonicallyFromDual :: DualVector (ZeroDim s) -+> ZeroDim s Source #

uncanonicallyToDual :: ZeroDim s -+> DualVector (ZeroDim s) Source #

tensorEquality :: (TensorSpace w, Eq w, Scalar w ~ Scalar (ZeroDim s)) => (ZeroDim s w) -> (ZeroDim s w) -> Bool Source #

dualFinitenessWitness :: DualFinitenessWitness (ZeroDim s) Source #

(FiniteDimensional v, Scalar v ~ s, Scalar (DualVector v) ~ s, RealFloat' s) => FiniteDimensional (SymmetricTensor s v) Source # 
Instance details

Defined in Math.VectorSpace.Docile

Associated Types

data SubBasis (SymmetricTensor s v) Source #

Methods

entireBasis :: SubBasis (SymmetricTensor s v) Source #

enumerateSubBasis :: SubBasis (SymmetricTensor s v) -> [SymmetricTensor s v] Source #

subbasisDimension :: SubBasis (SymmetricTensor s v) -> Int Source #

decomposeLinMap :: (LSpace w, Scalar w ~ Scalar (SymmetricTensor s v)) => (SymmetricTensor s v +> w) -> (SubBasis (SymmetricTensor s v), DList w) Source #

decomposeLinMapWithin :: (LSpace w, Scalar w ~ Scalar (SymmetricTensor s v)) => SubBasis (SymmetricTensor s v) -> (SymmetricTensor s v +> w) -> Either (SubBasis (SymmetricTensor s v), DList w) (DList w) Source #

recomposeSB :: SubBasis (SymmetricTensor s v) -> [Scalar (SymmetricTensor s v)] -> (SymmetricTensor s v, [Scalar (SymmetricTensor s v)]) Source #

recomposeSBTensor :: (FiniteDimensional w, Scalar w ~ Scalar (SymmetricTensor s v)) => SubBasis (SymmetricTensor s v) -> SubBasis w -> [Scalar (SymmetricTensor s v)] -> (SymmetricTensor s v w, [Scalar (SymmetricTensor s v)]) Source #

recomposeLinMap :: (LSpace w, Scalar w ~ Scalar (SymmetricTensor s v)) => SubBasis (SymmetricTensor s v) -> [w] -> (SymmetricTensor s v +> w, [w]) Source #

recomposeContraLinMap :: (LinearSpace w, Scalar w ~ Scalar (SymmetricTensor s v), Functor f) => (f (Scalar w) -> w) -> f (DualVector (SymmetricTensor s v)) -> SymmetricTensor s v +> w Source #

recomposeContraLinMapTensor :: (FiniteDimensional u, LinearSpace w, Scalar u ~ Scalar (SymmetricTensor s v), Scalar w ~ Scalar (SymmetricTensor s v), Functor f) => (f (Scalar w) -> w) -> f (SymmetricTensor s v +> DualVector u) -> (SymmetricTensor s v u) +> w Source #

uncanonicallyFromDual :: DualVector (SymmetricTensor s v) -+> SymmetricTensor s v Source #

uncanonicallyToDual :: SymmetricTensor s v -+> DualVector (SymmetricTensor s v) Source #

tensorEquality :: (TensorSpace w, Eq w, Scalar w ~ Scalar (SymmetricTensor s v)) => (SymmetricTensor s v w) -> (SymmetricTensor s v w) -> Bool Source #

dualFinitenessWitness :: DualFinitenessWitness (SymmetricTensor s v) Source #

(FiniteDimensional u, FiniteDimensional v, Scalar u ~ Scalar v) => FiniteDimensional (u, v) Source # 
Instance details

Defined in Math.VectorSpace.Docile

Associated Types

data SubBasis (u, v) Source #

Methods

entireBasis :: SubBasis (u, v) Source #

enumerateSubBasis :: SubBasis (u, v) -> [(u, v)] Source #

subbasisDimension :: SubBasis (u, v) -> Int Source #

decomposeLinMap :: (LSpace w, Scalar w ~ Scalar (u, v)) => ((u, v) +> w) -> (SubBasis (u, v), DList w) Source #

decomposeLinMapWithin :: (LSpace w, Scalar w ~ Scalar (u, v)) => SubBasis (u, v) -> ((u, v) +> w) -> Either (SubBasis (u, v), DList w) (DList w) Source #

recomposeSB :: SubBasis (u, v) -> [Scalar (u, v)] -> ((u, v), [Scalar (u, v)]) Source #

recomposeSBTensor :: (FiniteDimensional w, Scalar w ~ Scalar (u, v)) => SubBasis (u, v) -> SubBasis w -> [Scalar (u, v)] -> ((u, v) w, [Scalar (u, v)]) Source #

recomposeLinMap :: (LSpace w, Scalar w ~ Scalar (u, v)) => SubBasis (u, v) -> [w] -> ((u, v) +> w, [w]) Source #

recomposeContraLinMap :: (LinearSpace w, Scalar w ~ Scalar (u, v), Functor f) => (f (Scalar w) -> w) -> f (DualVector (u, v)) -> (u, v) +> w Source #

recomposeContraLinMapTensor :: (FiniteDimensional u0, LinearSpace w, Scalar u0 ~ Scalar (u, v), Scalar w ~ Scalar (u, v), Functor f) => (f (Scalar w) -> w) -> f ((u, v) +> DualVector u0) -> ((u, v) u0) +> w Source #

uncanonicallyFromDual :: DualVector (u, v) -+> (u, v) Source #

uncanonicallyToDual :: (u, v) -+> DualVector (u, v) Source #

tensorEquality :: (TensorSpace w, Eq w, Scalar w ~ Scalar (u, v)) => ((u, v) w) -> ((u, v) w) -> Bool Source #

dualFinitenessWitness :: DualFinitenessWitness (u, v) Source #

(LSpace u, FiniteDimensional u, FiniteDimensional v, Scalar u ~ s, Scalar v ~ s, Scalar (DualVector v) ~ s, Fractional' (Scalar v)) => FiniteDimensional (LinearMap s u v) Source # 
Instance details

Defined in Math.VectorSpace.Docile

Associated Types

data SubBasis (LinearMap s u v) Source #

Methods

entireBasis :: SubBasis (LinearMap s u v) Source #

enumerateSubBasis :: SubBasis (LinearMap s u v) -> [LinearMap s u v] Source #

subbasisDimension :: SubBasis (LinearMap s u v) -> Int Source #

decomposeLinMap :: (LSpace w, Scalar w ~ Scalar (LinearMap s u v)) => (LinearMap s u v +> w) -> (SubBasis (LinearMap s u v), DList w) Source #

decomposeLinMapWithin :: (LSpace w, Scalar w ~ Scalar (LinearMap s u v)) => SubBasis (LinearMap s u v) -> (LinearMap s u v +> w) -> Either (SubBasis (LinearMap s u v), DList w) (DList w) Source #

recomposeSB :: SubBasis (LinearMap s u v) -> [Scalar (LinearMap s u v)] -> (LinearMap s u v, [Scalar (LinearMap s u v)]) Source #

recomposeSBTensor :: (FiniteDimensional w, Scalar w ~ Scalar (LinearMap s u v)) => SubBasis (LinearMap s u v) -> SubBasis w -> [Scalar (LinearMap s u v)] -> (LinearMap s u v w, [Scalar (LinearMap s u v)]) Source #

recomposeLinMap :: (LSpace w, Scalar w ~ Scalar (LinearMap s u v)) => SubBasis (LinearMap s u v) -> [w] -> (LinearMap s u v +> w, [w]) Source #

recomposeContraLinMap :: (LinearSpace w, Scalar w ~ Scalar (LinearMap s u v), Functor f) => (f (Scalar w) -> w) -> f (DualVector (LinearMap s u v)) -> LinearMap s u v +> w Source #

recomposeContraLinMapTensor :: (FiniteDimensional u0, LinearSpace w, Scalar u0 ~ Scalar (LinearMap s u v), Scalar w ~ Scalar (LinearMap s u v), Functor f) => (f (Scalar w) -> w) -> f (LinearMap s u v +> DualVector u0) -> (LinearMap s u v u0) +> w Source #

uncanonicallyFromDual :: DualVector (LinearMap s u v) -+> LinearMap s u v Source #

uncanonicallyToDual :: LinearMap s u v -+> DualVector (LinearMap s u v) Source #

tensorEquality :: (TensorSpace w, Eq w, Scalar w ~ Scalar (LinearMap s u v)) => (LinearMap s u v w) -> (LinearMap s u v w) -> Bool Source #

dualFinitenessWitness :: DualFinitenessWitness (LinearMap s u v) Source #

(FiniteDimensional u, FiniteDimensional v, Scalar u ~ s, Scalar v ~ s, Scalar (DualVector u) ~ s, Scalar (DualVector v) ~ s, Fractional' (Scalar v)) => FiniteDimensional (Tensor s u v) Source # 
Instance details

Defined in Math.VectorSpace.Docile

Associated Types

data SubBasis (Tensor s u v) Source #

Methods

entireBasis :: SubBasis (Tensor s u v) Source #

enumerateSubBasis :: SubBasis (Tensor s u v) -> [Tensor s u v] Source #

subbasisDimension :: SubBasis (Tensor s u v) -> Int Source #

decomposeLinMap :: (LSpace w, Scalar w ~ Scalar (Tensor s u v)) => (Tensor s u v +> w) -> (SubBasis (Tensor s u v), DList w) Source #

decomposeLinMapWithin :: (LSpace w, Scalar w ~ Scalar (Tensor s u v)) => SubBasis (Tensor s u v) -> (Tensor s u v +> w) -> Either (SubBasis (Tensor s u v), DList w) (DList w) Source #

recomposeSB :: SubBasis (Tensor s u v) -> [Scalar (Tensor s u v)] -> (Tensor s u v, [Scalar (Tensor s u v)]) Source #

recomposeSBTensor :: (FiniteDimensional w, Scalar w ~ Scalar (Tensor s u v)) => SubBasis (Tensor s u v) -> SubBasis w -> [Scalar (Tensor s u v)] -> (Tensor s u v w, [Scalar (Tensor s u v)]) Source #

recomposeLinMap :: (LSpace w, Scalar w ~ Scalar (Tensor s u v)) => SubBasis (Tensor s u v) -> [w] -> (Tensor s u v +> w, [w]) Source #

recomposeContraLinMap :: (LinearSpace w, Scalar w ~ Scalar (Tensor s u v), Functor f) => (f (Scalar w) -> w) -> f (DualVector (Tensor s u v)) -> Tensor s u v +> w Source #

recomposeContraLinMapTensor :: (FiniteDimensional u0, LinearSpace w, Scalar u0 ~ Scalar (Tensor s u v), Scalar w ~ Scalar (Tensor s u v), Functor f) => (f (Scalar w) -> w) -> f (Tensor s u v +> DualVector u0) -> (Tensor s u v u0) +> w Source #

uncanonicallyFromDual :: DualVector (Tensor s u v) -+> Tensor s u v Source #

uncanonicallyToDual :: Tensor s u v -+> DualVector (Tensor s u v) Source #

tensorEquality :: (TensorSpace w, Eq w, Scalar w ~ Scalar (Tensor s u v)) => (Tensor s u v w) -> (Tensor s u v w) -> Bool Source #

dualFinitenessWitness :: DualFinitenessWitness (Tensor s u v) Source #

class LinearSpace v => SemiInner v where Source #

SemiInner is the class of vector spaces with finite subspaces in which you can define a basis that can be used to project from the whole space into the subspace. The usual application is for using a kind of Galerkin method to give an approximate solution (see \$) to a linear equation in a possibly infinite-dimensional space.

Of course, this also works for spaces which are already finite-dimensional themselves.

Methods

dualBasisCandidates :: [(Int, v)] -> Forest (Int, DualVector v) Source #

Lazily enumerate choices of a basis of functionals that can be made dual to the given vectors, in order of preference (which roughly means, large in the normal direction.) I.e., if the vector 𝑣 is assigned early to the dual vector 𝑣', then (𝑣' $ 𝑣) should be large and all the other products comparably small.

The purpose is that we should be able to make this basis orthonormal with a ~Gaussian-elimination approach, in a way that stays numerically stable. This is otherwise known as the choice of a pivot element.

For simple finite-dimensional array-vectors, you can easily define this method using cartesianDualBasisCandidates.

tensorDualBasisCandidates :: (SemiInner w, Scalar w ~ Scalar v) => [(Int, v w)] -> Forest (Int, DualVector (v w)) Source #

symTensorDualBasisCandidates :: [(Int, SymmetricTensor (Scalar v) v)] -> Forest (Int, SymmetricTensor (Scalar v) (DualVector v)) Source #

symTensorTensorDualBasisCandidates :: forall w. (SemiInner w, Scalar w ~ Scalar v) => [(Int, SymmetricTensor (Scalar v) v w)] -> Forest (Int, SymmetricTensor (Scalar v) v +> DualVector w) Source #

Instances

Instances details
(Fractional' s, SemiInner s) => SemiInner (V0 s) Source # 
Instance details

Defined in Math.VectorSpace.Docile

(Fractional' s, Ord s, SemiInner s) => SemiInner (V1 s) Source # 
Instance details

Defined in Math.VectorSpace.Docile

(Fractional' s, SemiInner s) => SemiInner (ZeroDim s) Source # 
Instance details

Defined in Math.VectorSpace.Docile

(Num' s, SemiInner v, Scalar v ~ s) => SemiInner (SymmetricTensor s v) Source # 
Instance details

Defined in Math.VectorSpace.Docile

(SemiInner u, SemiInner v, Scalar u ~ Scalar v, Num' (Scalar u)) => SemiInner (u, v) Source # 
Instance details

Defined in Math.VectorSpace.Docile

Methods

dualBasisCandidates :: [(Int, (u, v))] -> Forest (Int, DualVector (u, v)) Source #

tensorDualBasisCandidates :: (SemiInner w, Scalar w ~ Scalar (u, v)) => [(Int, (u, v) w)] -> Forest (Int, DualVector ((u, v) w)) Source #

symTensorDualBasisCandidates :: [(Int, SymmetricTensor (Scalar (u, v)) (u, v))] -> Forest (Int, SymmetricTensor (Scalar (u, v)) (DualVector (u, v))) Source #

symTensorTensorDualBasisCandidates :: (SemiInner w, Scalar w ~ Scalar (u, v)) => [(Int, SymmetricTensor (Scalar (u, v)) (u, v) w)] -> Forest (Int, SymmetricTensor (Scalar (u, v)) (u, v) +> DualVector w) Source #

(LinearSpace u, SemiInner (DualVector u), SemiInner v, Scalar u ~ s, Scalar v ~ s) => SemiInner (LinearMap s u v) Source # 
Instance details

Defined in Math.VectorSpace.Docile

(SemiInner u, SemiInner v, Scalar u ~ s, Scalar v ~ s) => SemiInner (Tensor s u v) Source # 
Instance details

Defined in Math.VectorSpace.Docile

Internals

class (HasBasis v, Num' (Scalar v), KnownCardinality (Basis v), StaticDimension v ~ Cardinality (Basis v), SingI (StaticDimension v), LinearSpace v, DualVector v ~ DualVectorFromBasis v) => BasisGeneratedSpace v where Source #

Do not manually instantiate this class. It is used internally by makeLinearSpaceFromBasis.

Methods

proveTensorProductIsTrie :: forall w φ. (TensorProduct v w ~ (Basis v :->: w) => φ) -> φ Source #

def :: Default a => a #

The default value for this type.