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

Math.LinearMap.Coercion

Description

 
Synopsis

Documentation

data VSCCoercion s a b where Source #

A coercion that is compatible with the vector space structure of the types. Intended to be used for lossless conversion between newtype wrappers around vector spaces, under the requirement that they internally use the same basis (if any). Note that this does not mean they also need to have the same inner product / dual space.

Constructors

VSCCoercion :: (Coercible a b, StaticDimension a ~ StaticDimension b) => VSCCoercion s a b 

Instances

Instances details
Category (VSCCoercion s :: Type -> Type -> Type) Source # 
Instance details

Defined in Math.LinearMap.Category.Class

Associated Types

type Object (VSCCoercion s) o #

Methods

id :: forall (a :: κ). Object (VSCCoercion s) a => VSCCoercion s a a #

(.) :: forall (a :: κ) (b :: κ) (c :: κ). (Object (VSCCoercion s) a, Object (VSCCoercion s) b, Object (VSCCoercion s) c) => VSCCoercion s b c -> VSCCoercion s a b -> VSCCoercion s a c #

EnhancedCat (Coercion :: Type -> Type -> Type) (VSCCoercion s) Source # 
Instance details

Defined in Math.LinearMap.Category.Class

Methods

arr :: (Object (VSCCoercion s) b, Object (VSCCoercion s) c, Object Coercion b, Object Coercion c) => VSCCoercion s b c -> Coercion b c #

EnhancedCat (LinearFunction s) (VSCCoercion s) Source # 
Instance details

Defined in Math.LinearMap.Category.Class

EnhancedCat (->) (VSCCoercion s) Source # 
Instance details

Defined in Math.LinearMap.Category.Class

Methods

arr :: (Object (VSCCoercion s) b, Object (VSCCoercion s) c, Object (->) b, Object (->) c) => VSCCoercion s b c -> b -> c #

(LinearSpace v, Scalar v ~ s) => Functor (LinearMap s v) (VSCCoercion s) (VSCCoercion s) Source # 
Instance details

Defined in Math.LinearMap.Category.Class

Methods

fmap :: (Object (VSCCoercion s) a, Object (VSCCoercion s) (LinearMap s v a), Object (VSCCoercion s) b, Object (VSCCoercion s) (LinearMap s v b)) => VSCCoercion s a b -> VSCCoercion s (LinearMap s v a) (LinearMap s v b) #

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

Defined in Math.LinearMap.Category.Class

Methods

fmap :: (Object (VSCCoercion s) a, Object (VSCCoercion s) (Tensor s v a), Object (VSCCoercion s) b, Object (VSCCoercion s) (Tensor s v b)) => VSCCoercion s a b -> VSCCoercion s (Tensor s v a) (Tensor s v b) #

type Object (VSCCoercion s :: Type -> Type -> Type) (v :: Type) Source # 
Instance details

Defined in Math.LinearMap.Category.Class

type Object (VSCCoercion s :: Type -> Type -> Type) (v :: Type) = (TensorSpace v, Scalar v ~ s)

(-+$=>) :: VSCCoercion s a b -> a -> b infixr 0 Source #

Conversion between the internal types

fromLinearMap :: forall s v w. (LinearSpace v, Scalar v ~ s) => VSCCoercion s (LinearMap s (DualVector v) w) (Tensor s v w) Source #

asLinearMap :: forall s v w. (LinearSpace v, Scalar v ~ s) => VSCCoercion s (Tensor s v w) (LinearMap s (DualVector v) w) Source #

fromTensor :: forall s v w. LinearSpace v => VSCCoercion s (Tensor s (DualVector v) w) (LinearMap s v w) Source #

asTensor :: forall s v w. LinearSpace v => VSCCoercion s (LinearMap s v w) (Tensor s (DualVector v) w) Source #