Copyright | (c) Justus Sagemüller 2022 |
---|---|
License | GPL v3 |
Maintainer | (@) jsag $ hvl.no |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- data VSCCoercion s a b where
- VSCCoercion :: (Coercible a b, StaticDimension a ~ StaticDimension b) => VSCCoercion s a b
- (-+$=>) :: VSCCoercion s a b -> a -> b
- fromLinearMap :: forall s v w. (LinearSpace v, Scalar v ~ s) => VSCCoercion s (LinearMap s (DualVector v) w) (Tensor s v w)
- asLinearMap :: forall s v w. (LinearSpace v, Scalar v ~ s) => VSCCoercion s (Tensor s v w) (LinearMap s (DualVector v) w)
- fromTensor :: forall s v w. LinearSpace v => VSCCoercion s (Tensor s (DualVector v) w) (LinearMap s v w)
- asTensor :: forall s v w. LinearSpace v => VSCCoercion s (LinearMap s v w) (Tensor s (DualVector v) w)
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.
VSCCoercion :: (Coercible a b, StaticDimension a ~ StaticDimension b) => VSCCoercion s a b |
Instances
(-+$=>) :: 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 #