{-# LANGUAGE Safe, MultiParamTypeClasses, TypeOperators #-}
module SDP.Shaped
(
Shaped (..)
)
where
import SDP.Linear
default ()
class Shaped s e
where
{-# MINIMAL reshape, (!!), slices, unslice #-}
defaultRebound :: (Index i, Index j, Bordered2 s i e) => s i e -> s j e
defaultRebound s i e
es = s i e
es s i e -> (j, j) -> s j e
forall (s :: * -> * -> *) e i j.
(Shaped s e, Index i, Index j) =>
s i e -> (j, j) -> s j e
`reshape` Int -> (j, j)
forall i. Index i => Int -> (i, i)
defaultBounds (s i e -> Int
forall b i. Bordered b i => b -> Int
sizeOf s i e
es)
rebound :: (Index i) => s i e -> (i, i) -> s i e
rebound = s i e -> (i, i) -> s i e
forall (s :: * -> * -> *) e i j.
(Shaped s e, Index i, Index j) =>
s i e -> (j, j) -> s j e
reshape
reshape :: (Index i, Index j) => s i e -> (j, j) -> s j e
(!!) :: (SubIndex i j) => s i e -> i :|: j -> s j e
slices :: (SubIndex i j) => s i e -> [s j e]
unslice :: (Foldable f, SubIndex i j) => f (s j e) -> s i e