{-# LANGUAGE GADTs #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE LambdaCase #-}
{-# OPTIONS_GHC -fplugin GHC.TypeLits.KnownNat.Solver #-}
{-# OPTIONS_GHC -fplugin GHC.TypeLits.Normalise #-}
{-# OPTIONS_GHC -fplugin-opt GHC.TypeLits.Normalise:allow-negated-numbers #-}
module Math.Tensor (
IndList(..),
singletonInd, (+>), fromList, fromListUnsafe,
headInd, tailInd, sortInd, updateInd,
TMap,
Tensor(..),
Tensor2,
AbsTensor1, AbsTensor2, AbsTensor3, AbsTensor4, AbsTensor5, AbsTensor6, AbsTensor7, AbsTensor8,
STTens, ATens,
TIndex,
Ind3(..), Ind9(..), Ind20(..),
TAdd(..),
Prod(..),
SField(..),
AnsVar(..), AnsVarR,
shiftVarLabels,
shiftLabels1, shiftLabels2, shiftLabels3, shiftLabels4, shiftLabels5, shiftLabels6, shiftLabels7, shiftLabels8,
CFun(..), evalSec,
SSymbolic(..),
IndTuple1, IndTuple2, IndTuple3, IndTuple4, IndTuple5, IndTuple6, IndTuple7, IndTuple8,
IndTupleST, IndTupleAbs,
fromListT,
fromListT1, fromListT2, fromListT3, fromListT4, fromListT5, fromListT6, fromListT7, fromListT8,
fromListT',
fromListT1', fromListT2', fromListT3', fromListT4', fromListT5', fromListT6', fromListT7', fromListT8',
mapTo1, mapTo2, mapTo3, mapTo4, mapTo5, mapTo6, mapTo7, mapTo8,
(&+), negateTens, (&*), (&-), (&.),
tensorContr,
contrATens1, contrATens2, contrATens3, contrATens4,
tensorTrans,
tensorTrans1, tensorTrans2, tensorTrans3, tensorTrans4, tensorTrans5, tensorTrans6, tensorTrans7, tensorTrans8,
tensorBlockTrans,
tensorBlockTrans1, tensorBlockTrans2, tensorBlockTrans3, tensorBlockTrans4, tensorBlockTrans5, tensorBlockTrans6, tensorBlockTrans7, tensorBlockTrans8,
resortTens,
resortTens1, resortTens2, resortTens3, resortTens4, resortTens5, resortTens6, resortTens7, resortTens8,
symTens,
symATens1, symATens2, symATens3, symATens4, symATens5, symATens6, symATens7, symATens8,
symTensFac,
symATensFac1, symATensFac2, symATensFac3, symATensFac4, symATensFac5, symATensFac6, symATensFac7, symATensFac8,
aSymTens,
aSymATens1, aSymATens2, aSymATens3, aSymATens4, aSymATens5, aSymATens6, aSymATens7, aSymATens8,
aSymTensFac,
aSymATensFac1, aSymATensFac2, aSymATensFac3, aSymATensFac4, aSymATensFac5, aSymATensFac6, aSymATensFac7, aSymATensFac8,
symBlockTens,
symBlockATens1, symBlockATens2, symBlockATens3, symBlockATens4, symBlockATens5, symBlockATens6, symBlockATens7, symBlockATens8,
symBlockTensFac,
symBlockATensFac1, symBlockATensFac2, symBlockATensFac3, symBlockATensFac4, symBlockATensFac5, symBlockATensFac6, symBlockATensFac7, symBlockATensFac8,
aSymBlockTens,
aSymBlockATens1, aSymBlockATens2, aSymBlockATens3, aSymBlockATens4, aSymBlockATens5, aSymBlockATens6, aSymBlockATens7, aSymBlockATens8,
aSymBlockTensFac,
aSymBlockATensFac1, aSymBlockATensFac2, aSymBlockATensFac3, aSymBlockATensFac4, aSymBlockATensFac5, aSymBlockATensFac6, aSymBlockATensFac7, aSymBlockATensFac8,
cyclicSymTens,
cyclicSymATens1, cyclicSymATens2, cyclicSymATens3, cyclicSymATens4, cyclicSymATens5, cyclicSymATens6, cyclicSymATens7, cyclicSymATens8,
cyclicSymTensFac,
cyclicSymATensFac1, cyclicSymATensFac2, cyclicSymATensFac3, cyclicSymATensFac4, cyclicSymATensFac5, cyclicSymATensFac6, cyclicSymATensFac7, cyclicSymATensFac8,
cyclicASymTens,
cyclicASymATens1, cyclicASymATens2, cyclicASymATens3, cyclicASymATens4, cyclicASymATens5, cyclicASymATens6, cyclicASymATens7, cyclicASymATens8,
cyclicASymTensFac,
cyclicASymATensFac1, cyclicASymATensFac2, cyclicASymATensFac3, cyclicASymATensFac4, cyclicASymATensFac5, cyclicASymATensFac6, cyclicASymATensFac7, cyclicASymATensFac8,
cyclicBlockSymTens,
cyclicBlockSymATens1, cyclicBlockSymATens2, cyclicBlockSymATens3, cyclicBlockSymATens4, cyclicBlockSymATens5, cyclicBlockSymATens6, cyclicBlockSymATens7, cyclicBlockSymATens8,
cyclicBlockSymTensFac,
cyclicBlockSymATensFac1, cyclicBlockSymATensFac2, cyclicBlockSymATensFac3, cyclicBlockSymATensFac4, cyclicBlockSymATensFac5, cyclicBlockSymATensFac6, cyclicBlockSymATensFac7, cyclicBlockSymATensFac8,
TensList1(..), TensList2(..), TensList3(..), TensList4(..), TensList5(..), TensList6(..), TensList7(..), TensList8(..),
singletonTList1, singletonTList2, singletonTList3, singletonTList4, singletonTList5, singletonTList6, singletonTList7, singletonTList8,
(...>), (..&>), (.&.>), (.&&>), (&..>), (&.&>), (&&.>), (&&&>),
(...+), (..&+), (.&.+), (.&&+), (&..+), (&.&+), (&&.+), (&&&+),
toListT,
toListT1, toListT2, toListT3, toListT4, toListT5, toListT6, toListT7, toListT8,
toListT',
toListT1', toListT2', toListT3', toListT4', toListT5', toListT6', toListT7', toListT8',
toMatListT1', toMatListT2', toMatListT3', toMatListT4', toMatListT5', toMatListT6', toMatListT7', toMatListT8',
toMatrixT1', toMatrixT2', toMatrixT3', toMatrixT4', toMatrixT5', toMatrixT6', toMatrixT7', toMatrixT8',
toMatListT1, toMatListT2, toMatListT3, toMatListT4, toMatListT5, toMatListT6, toMatListT7, toMatListT8,
toMatrixT1, toMatrixT2, toMatrixT3, toMatrixT4, toMatrixT5, toMatrixT6, toMatrixT7, toMatrixT8,
removeZeros,
removeZeros1, removeZeros2, removeZeros3, removeZeros4, removeZeros5, removeZeros6, removeZeros7, removeZeros8,
evalTens,
evalTens1, evalTens2, evalTens3, evalTens4, evalTens5, evalTens6, evalTens7, evalTens8,
tensorRank1', tensorRank2', tensorRank3', tensorRank4', tensorRank5', tensorRank6', tensorRank7', tensorRank8',
tensorRank1, tensorRank2, tensorRank3, tensorRank4, tensorRank5, tensorRank6, tensorRank7, tensorRank8,
encodeTensor, decodeTensor,
partial, partialSymbolic
) where
import Data.Foldable (toList)
import Control.Applicative (liftA2)
import Data.List (sortOn, intersect)
import Data.Maybe (mapMaybe, fromMaybe)
import Data.Proxy
import Data.Type.Equality
import qualified Data.IntMap.Strict as I
import Numeric.Natural (Natural)
import qualified Numeric.AD.Rank1.Forward as AD
import GHC.TypeLits
import GHC.Generics (Generic(..))
import Control.DeepSeq (rnf, NFData(..))
import Data.Serialize (encodeLazy, decodeLazy, Serialize(..))
import Unsafe.Coerce (unsafeCoerce)
import qualified Data.ByteString.Lazy as BS (ByteString)
import Codec.Compression.GZip (compress, decompress)
import qualified Numeric.LinearAlgebra.Data as HM
import Numeric.LinearAlgebra (rank)
data IndList n a where
Empty :: IndList 0 a
Append :: a -> IndList (n-1) a -> IndList n a
infixr 5 +>
(+>) :: Enum a => Int -> IndList (n-1) a -> IndList n a
+> :: Int -> IndList (n - 1) a -> IndList n a
(+>) Int
i = a -> IndList (n - 1) a -> IndList n a
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (Int -> a
forall a. Enum a => Int -> a
toEnum Int
i)
singletonInd :: a -> IndList 1 a
singletonInd :: a -> IndList 1 a
singletonInd a
x = a -> IndList (1 - 1) a -> IndList 1 a
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append a
x IndList (1 - 1) a
forall a. IndList 0 a
Empty
data IsZero (n :: Nat) where
Zero :: (0 ~ n) => IsZero n
NonZero :: (1 <= n) => IsZero n
deriving instance Show (IsZero n)
isZero :: forall n. KnownNat n => Proxy n -> IsZero n
isZero :: Proxy n -> IsZero n
isZero Proxy n
_ = case Proxy n -> Proxy 0 -> Maybe (n :~: 0)
forall (a :: Nat) (b :: Nat).
(KnownNat a, KnownNat b) =>
Proxy a -> Proxy b -> Maybe (a :~: b)
sameNat (Proxy n
forall k (t :: k). Proxy t
Proxy @n) (Proxy 0
forall k (t :: k). Proxy t
Proxy @0)
of Maybe (n :~: 0)
Nothing -> IsZero 1 -> IsZero n
forall a b. a -> b
unsafeCoerce ((1 <= 1) => IsZero 1
forall (n :: Nat). (1 <= n) => IsZero n
NonZero @1)
Just n :~: 0
Refl -> IsZero n
forall (n :: Nat). (0 ~ n) => IsZero n
Zero
isZero' :: forall n. KnownNat n => IsZero n
isZero' :: IsZero n
isZero' = case Proxy n -> Proxy 0 -> Maybe (n :~: 0)
forall (a :: Nat) (b :: Nat).
(KnownNat a, KnownNat b) =>
Proxy a -> Proxy b -> Maybe (a :~: b)
sameNat (Proxy n
forall k (t :: k). Proxy t
Proxy @n) (Proxy 0
forall k (t :: k). Proxy t
Proxy @0)
of Maybe (n :~: 0)
Nothing -> IsZero 1 -> IsZero n
forall a b. a -> b
unsafeCoerce ((1 <= 1) => IsZero 1
forall (n :: Nat). (1 <= n) => IsZero n
NonZero @1)
Just n :~: 0
Refl -> IsZero n
forall (n :: Nat). (0 ~ n) => IsZero n
Zero
fromList :: forall n. KnownNat n => forall (a :: *). [a] -> Maybe (IndList n a)
fromList :: forall a. [a] -> Maybe (IndList n a)
fromList [a]
xs = case KnownNat n => IsZero n
forall (n :: Nat). KnownNat n => IsZero n
isZero' @n
of IsZero n
Zero -> case [a]
xs
of [] -> IndList 0 a -> Maybe (IndList 0 a)
forall a. a -> Maybe a
Just IndList 0 a
forall a. IndList 0 a
Empty
[a]
_ -> Maybe (IndList n a)
forall a. Maybe a
Nothing
IsZero n
NonZero -> case [a]
xs
of [] -> Maybe (IndList n a)
forall a. Maybe a
Nothing
a
x:[a]
xs' -> case [a] -> Maybe (IndList (n - 1) a)
forall (n :: Nat) a. KnownNat n => [a] -> Maybe (IndList n a)
fromList [a]
xs'
of Just IndList (n - 1) a
v -> IndList n a -> Maybe (IndList n a)
forall a. a -> Maybe a
Just (a
x a -> IndList (n - 1) a -> IndList n a
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
`Append` IndList (n - 1) a
v)
Maybe (IndList (n - 1) a)
Nothing -> Maybe (IndList n a)
forall a. Maybe a
Nothing
fromListUnsafe :: forall n.KnownNat n => forall (a :: *). [a] -> IndList n a
fromListUnsafe :: forall a. [a] -> IndList n a
fromListUnsafe [a]
xs = IndList n a -> Maybe (IndList n a) -> IndList n a
forall a. a -> Maybe a -> a
fromMaybe (String -> IndList n a
forall a. HasCallStack => String -> a
error String
errorString) ([a] -> Maybe (IndList n a)
forall (n :: Nat) a. KnownNat n => [a] -> Maybe (IndList n a)
fromList [a]
xs)
where
nVal :: Integer
nVal = Proxy n -> Integer
forall (n :: Nat) (proxy :: Nat -> *).
KnownNat n =>
proxy n -> Integer
natVal (Proxy n
forall a. HasCallStack => a
undefined :: Proxy n)
len :: Int
len = [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [a]
xs
errorString :: String
errorString = String
"Could not construct IndList " String -> ShowS
forall a. [a] -> [a] -> [a]
++ Integer -> String
forall a. Show a => a -> String
show Integer
nVal String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" from " String -> ShowS
forall a. [a] -> [a] -> [a]
++ Int -> String
forall a. Show a => a -> String
show Int
len String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" elements."
instance (KnownNat n, Generic a) => Generic (IndList n a) where
type Rep (IndList n a) = Rep [a]
to :: Rep (IndList n a) x -> IndList n a
to Rep (IndList n a) x
r = [a] -> IndList n a
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe ([a] -> IndList n a) -> [a] -> IndList n a
forall a b. (a -> b) -> a -> b
$ Rep [a] x -> [a]
forall a x. Generic a => Rep a x -> a
to Rep [a] x
Rep (IndList n a) x
r
from :: IndList n a -> Rep (IndList n a) x
from = [a]
-> D1
('MetaData "[]" "GHC.Types" "ghc-prim" 'False)
(C1 ('MetaCons "[]" 'PrefixI 'False) U1
:+: C1
('MetaCons ":" ('InfixI 'LeftAssociative 9) 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 a)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 [a])))
x
forall a x. Generic a => a -> Rep a x
from ([a]
-> D1
('MetaData "[]" "GHC.Types" "ghc-prim" 'False)
(C1 ('MetaCons "[]" 'PrefixI 'False) U1
:+: C1
('MetaCons ":" ('InfixI 'LeftAssociative 9) 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 a)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 [a])))
x)
-> (IndList n a -> [a])
-> IndList n a
-> D1
('MetaData "[]" "GHC.Types" "ghc-prim" 'False)
(C1 ('MetaCons "[]" 'PrefixI 'False) U1
:+: C1
('MetaCons ":" ('InfixI 'LeftAssociative 9) 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 a)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 [a])))
x
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IndList n a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList
deriving instance (KnownNat n, Generic a, Serialize a) => Serialize (IndList n a)
instance (NFData a) => NFData (IndList n a) where
rnf :: IndList n a -> ()
rnf IndList n a
Empty = ()
rnf (Append a
a IndList (n - 1) a
i) = a -> ()
forall a. NFData a => a -> ()
rnf a
a () -> () -> ()
`seq` IndList (n - 1) a -> ()
forall a. NFData a => a -> ()
rnf IndList (n - 1) a
i
deriving instance (Eq a) => Eq (IndList n a)
deriving instance (Ord a) => Ord (IndList n a)
deriving instance (Show a) => Show (IndList n a)
instance Functor (IndList n) where
fmap :: (a -> b) -> IndList n a -> IndList n b
fmap a -> b
_ IndList n a
Empty = IndList n b
forall a. IndList 0 a
Empty
fmap a -> b
f (Append a
x IndList (n - 1) a
xs) = b -> IndList (n - 1) b -> IndList n b
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (a -> b
f a
x) ((a -> b) -> IndList (n - 1) a -> IndList (n - 1) b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
f IndList (n - 1) a
xs)
instance Foldable (IndList n) where
foldr :: (a -> b -> b) -> b -> IndList n a -> b
foldr a -> b -> b
_ b
y IndList n a
Empty = b
y
foldr a -> b -> b
f b
y (Append a
x IndList (n - 1) a
xs) = a -> b -> b
f a
x ((a -> b -> b) -> b -> IndList (n - 1) a -> b
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr a -> b -> b
f b
y IndList (n - 1) a
xs)
insertSorted :: (Ord a, Eq a) => a -> IndList n a -> IndList (n+1) a
insertSorted :: a -> IndList n a -> IndList (n + 1) a
insertSorted a
y IndList n a
Empty = a -> IndList (1 - 1) a -> IndList 1 a
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append a
y IndList (1 - 1) a
forall a. IndList 0 a
Empty
insertSorted a
y (Append a
x IndList (n - 1) a
xs)
| a
y a -> a -> Bool
forall a. Ord a => a -> a -> Bool
<= a
x = a -> IndList ((n + 1) - 1) a -> IndList (n + 1) a
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append a
y (IndList ((n + 1) - 1) a -> IndList (n + 1) a)
-> IndList ((n + 1) - 1) a -> IndList (n + 1) a
forall a b. (a -> b) -> a -> b
$ a -> IndList (n - 1) a -> IndList n a
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append a
x IndList (n - 1) a
xs
| Bool
otherwise = a -> IndList ((n + 1) - 1) a -> IndList (n + 1) a
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append a
x (IndList ((n + 1) - 1) a -> IndList (n + 1) a)
-> IndList ((n + 1) - 1) a -> IndList (n + 1) a
forall a b. (a -> b) -> a -> b
$ a -> IndList (n - 1) a -> IndList ((n - 1) + 1) a
forall a (n :: Nat).
(Ord a, Eq a) =>
a -> IndList n a -> IndList (n + 1) a
insertSorted a
y IndList (n - 1) a
xs
sortInd :: (Ord a, Eq a) => IndList n a -> IndList n a
sortInd :: IndList n a -> IndList n a
sortInd IndList n a
Empty = IndList n a
forall a. IndList 0 a
Empty
sortInd (Append a
x IndList (n - 1) a
xs) = a -> IndList (n - 1) a -> IndList ((n - 1) + 1) a
forall a (n :: Nat).
(Ord a, Eq a) =>
a -> IndList n a -> IndList (n + 1) a
insertSorted a
x (IndList (n - 1) a -> IndList ((n - 1) + 1) a)
-> IndList (n - 1) a -> IndList ((n - 1) + 1) a
forall a b. (a -> b) -> a -> b
$ IndList (n - 1) a -> IndList (n - 1) a
forall a (n :: Nat). (Ord a, Eq a) => IndList n a -> IndList n a
sortInd IndList (n - 1) a
xs
headInd :: IndList n a -> a
headInd :: IndList n a -> a
headInd IndList n a
Empty = String -> a
forall a. HasCallStack => String -> a
error String
"head of empty IndList"
headInd (Append a
x IndList (n - 1) a
_) = a
x
tailInd :: IndList n a -> IndList (n-1) a
tailInd :: IndList n a -> IndList (n - 1) a
tailInd IndList n a
Empty = String -> IndList (0 - 1) a
forall a. HasCallStack => String -> a
error String
"tail of empty IndList"
tailInd (Append a
_ IndList (n - 1) a
xs) = IndList (n - 1) a
xs
indexInd :: Int -> IndList n a -> a
indexInd :: Int -> IndList n a -> a
indexInd Int
0 (Append a
x IndList (n - 1) a
_) = a
x
indexInd Int
i (Append a
_ IndList (n - 1) a
xs) = Int -> IndList (n - 1) a -> a
forall (n :: Nat) a. Int -> IndList n a -> a
indexInd (Int
iInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1) IndList (n - 1) a
xs
indexInd Int
_ IndList n a
_ = String -> a
forall a. HasCallStack => String -> a
error String
"Index is too large!"
updateInd :: Int -> a -> IndList n a -> IndList n a
updateInd :: Int -> a -> IndList n a -> IndList n a
updateInd Int
0 a
s (Append a
_ IndList (n - 1) a
xs) = a -> IndList (n - 1) a -> IndList n a
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append a
s IndList (n - 1) a
xs
updateInd Int
i a
s (Append a
x IndList (n - 1) a
xs) = a -> IndList (n - 1) a -> IndList n a
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append a
x (IndList (n - 1) a -> IndList n a)
-> IndList (n - 1) a -> IndList n a
forall a b. (a -> b) -> a -> b
$ Int -> a -> IndList (n - 1) a -> IndList (n - 1) a
forall a (n :: Nat). Int -> a -> IndList n a -> IndList n a
updateInd (Int
iInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1) a
s IndList (n - 1) a
xs
updateInd Int
_ a
_ IndList n a
_ = String -> IndList n a
forall a. HasCallStack => String -> a
error String
"Index is too large!"
swapHead :: Int -> IndList n b -> IndList n b
swapHead :: Int -> IndList n b -> IndList n b
swapHead Int
1 (Append b
x IndList (n - 1) b
xs) = b -> IndList (n - 1) b -> IndList n b
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (IndList (n - 1) b -> b
forall (n :: Nat) a. IndList n a -> a
headInd IndList (n - 1) b
xs) (IndList (n - 1) b -> IndList n b)
-> IndList (n - 1) b -> IndList n b
forall a b. (a -> b) -> a -> b
$ b -> IndList ((n - 1) - 1) b -> IndList (n - 1) b
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append b
x (IndList (n - 1) b -> IndList ((n - 1) - 1) b
forall (n :: Nat) a. IndList n a -> IndList (n - 1) a
tailInd IndList (n - 1) b
xs)
swapHead Int
i (Append b
x IndList (n - 1) b
xs) = b -> IndList (n - 1) b -> IndList n b
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append b
val IndList (n - 1) b
newL
where
val :: b
val = Int -> IndList (n - 1) b -> b
forall (n :: Nat) a. Int -> IndList n a -> a
indexInd (Int
iInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1) IndList (n - 1) b
xs
newL :: IndList (n - 1) b
newL = Int -> b -> IndList (n - 1) b -> IndList (n - 1) b
forall a (n :: Nat). Int -> a -> IndList n a -> IndList n a
updateInd (Int
iInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1) b
x IndList (n - 1) b
xs
swapHead Int
_ IndList n b
Empty = String -> IndList n b
forall a. HasCallStack => String -> a
error String
"cannot swap head of empty list"
removeContractionInd :: (Eq a) => Int -> a -> (IndList n a, c) -> Maybe (IndList (n-1) a,c)
removeContractionInd :: Int -> a -> (IndList n a, c) -> Maybe (IndList (n - 1) a, c)
removeContractionInd Int
0 a
ind1 (Append a
x IndList (n - 1) a
xs, c
t)
| a
ind1 a -> a -> Bool
forall a. Eq a => a -> a -> Bool
== a
x = (IndList (n - 1) a, c) -> Maybe (IndList (n - 1) a, c)
forall a. a -> Maybe a
Just (IndList (n - 1) a
xs,c
t)
| Bool
otherwise = Maybe (IndList (n - 1) a, c)
forall a. Maybe a
Nothing
removeContractionInd Int
i a
ind1 (Append a
x IndList (n - 1) a
xs,c
t) = (\(IndList ((n - 1) - 1) a
m,c
n) -> (a -> IndList ((n - 1) - 1) a -> IndList (n - 1) a
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append a
x IndList ((n - 1) - 1) a
m, c
n)) ((IndList ((n - 1) - 1) a, c) -> (IndList (n - 1) a, c))
-> Maybe (IndList ((n - 1) - 1) a, c)
-> Maybe (IndList (n - 1) a, c)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Int
-> a
-> (IndList (n - 1) a, c)
-> Maybe (IndList ((n - 1) - 1) a, c)
forall a (n :: Nat) c.
Eq a =>
Int -> a -> (IndList n a, c) -> Maybe (IndList (n - 1) a, c)
removeContractionInd (Int
iInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1) a
ind1 (IndList (n - 1) a
xs,c
t)
removeContractionInd Int
_ a
_ (IndList n a
Empty, c
_) = String -> Maybe (IndList (0 - 1) a, c)
forall a. HasCallStack => String -> a
error String
"cannot remove index from empty index list"
resortInd :: (KnownNat n, Ord a) => [Int] -> IndList n a -> IndList n a
resortInd :: [Int] -> IndList n a -> IndList n a
resortInd [Int]
perm IndList n a
indList = IndList n a
newindList
where
l' :: [a]
l' = IndList n a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList IndList n a
indList
l'' :: [(Int, a)]
l'' = if [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [a]
l' Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== [Int] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [Int]
perm then [Int] -> [a] -> [(Int, a)]
forall a b. [a] -> [b] -> [(a, b)]
zip [Int]
perm [a]
l' else String -> [(Int, a)]
forall a. HasCallStack => String -> a
error String
"permutation has wrong length"
lReSorted :: [(Int, a)]
lReSorted = ((Int, a) -> Int) -> [(Int, a)] -> [(Int, a)]
forall b a. Ord b => (a -> b) -> [a] -> [a]
sortOn (Int, a) -> Int
forall a b. (a, b) -> a
fst [(Int, a)]
l''
newindList :: IndList n a
newindList = [a] -> IndList n a
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe ([a] -> IndList n a) -> [a] -> IndList n a
forall a b. (a -> b) -> a -> b
$ ((Int, a) -> a) -> [(Int, a)] -> [a]
forall a b. (a -> b) -> [a] -> [b]
map (Int, a) -> a
forall a b. (a, b) -> b
snd [(Int, a)]
lReSorted
class (Eq a, Ord a, Enum a) => TIndex a where
newtype Ind3 = Ind3 {Ind3 -> Int
indVal3 :: Int}
deriving (Eq Ind3
Eq Ind3
-> (Ind3 -> Ind3 -> Ordering)
-> (Ind3 -> Ind3 -> Bool)
-> (Ind3 -> Ind3 -> Bool)
-> (Ind3 -> Ind3 -> Bool)
-> (Ind3 -> Ind3 -> Bool)
-> (Ind3 -> Ind3 -> Ind3)
-> (Ind3 -> Ind3 -> Ind3)
-> Ord Ind3
Ind3 -> Ind3 -> Bool
Ind3 -> Ind3 -> Ordering
Ind3 -> Ind3 -> Ind3
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Ind3 -> Ind3 -> Ind3
$cmin :: Ind3 -> Ind3 -> Ind3
max :: Ind3 -> Ind3 -> Ind3
$cmax :: Ind3 -> Ind3 -> Ind3
>= :: Ind3 -> Ind3 -> Bool
$c>= :: Ind3 -> Ind3 -> Bool
> :: Ind3 -> Ind3 -> Bool
$c> :: Ind3 -> Ind3 -> Bool
<= :: Ind3 -> Ind3 -> Bool
$c<= :: Ind3 -> Ind3 -> Bool
< :: Ind3 -> Ind3 -> Bool
$c< :: Ind3 -> Ind3 -> Bool
compare :: Ind3 -> Ind3 -> Ordering
$ccompare :: Ind3 -> Ind3 -> Ordering
$cp1Ord :: Eq Ind3
Ord, Ind3 -> Ind3 -> Bool
(Ind3 -> Ind3 -> Bool) -> (Ind3 -> Ind3 -> Bool) -> Eq Ind3
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Ind3 -> Ind3 -> Bool
$c/= :: Ind3 -> Ind3 -> Bool
== :: Ind3 -> Ind3 -> Bool
$c== :: Ind3 -> Ind3 -> Bool
Eq, Int -> Ind3 -> ShowS
[Ind3] -> ShowS
Ind3 -> String
(Int -> Ind3 -> ShowS)
-> (Ind3 -> String) -> ([Ind3] -> ShowS) -> Show Ind3
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Ind3] -> ShowS
$cshowList :: [Ind3] -> ShowS
show :: Ind3 -> String
$cshow :: Ind3 -> String
showsPrec :: Int -> Ind3 -> ShowS
$cshowsPrec :: Int -> Ind3 -> ShowS
Show, ReadPrec [Ind3]
ReadPrec Ind3
Int -> ReadS Ind3
ReadS [Ind3]
(Int -> ReadS Ind3)
-> ReadS [Ind3] -> ReadPrec Ind3 -> ReadPrec [Ind3] -> Read Ind3
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Ind3]
$creadListPrec :: ReadPrec [Ind3]
readPrec :: ReadPrec Ind3
$creadPrec :: ReadPrec Ind3
readList :: ReadS [Ind3]
$creadList :: ReadS [Ind3]
readsPrec :: Int -> ReadS Ind3
$creadsPrec :: Int -> ReadS Ind3
Read, (forall x. Ind3 -> Rep Ind3 x)
-> (forall x. Rep Ind3 x -> Ind3) -> Generic Ind3
forall x. Rep Ind3 x -> Ind3
forall x. Ind3 -> Rep Ind3 x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Ind3 x -> Ind3
$cfrom :: forall x. Ind3 -> Rep Ind3 x
Generic, Ind3 -> ()
(Ind3 -> ()) -> NFData Ind3
forall a. (a -> ()) -> NFData a
rnf :: Ind3 -> ()
$crnf :: Ind3 -> ()
NFData, Get Ind3
Putter Ind3
Putter Ind3 -> Get Ind3 -> Serialize Ind3
forall t. Putter t -> Get t -> Serialize t
get :: Get Ind3
$cget :: Get Ind3
put :: Putter Ind3
$cput :: Putter Ind3
Serialize)
instance TIndex Ind3 where
instance Enum Ind3 where
toEnum :: Int -> Ind3
toEnum = Int -> Ind3
Ind3
fromEnum :: Ind3 -> Int
fromEnum = Ind3 -> Int
indVal3
newtype Ind9 = Ind9 {Ind9 -> Int
indVal9 :: Int}
deriving (Eq Ind9
Eq Ind9
-> (Ind9 -> Ind9 -> Ordering)
-> (Ind9 -> Ind9 -> Bool)
-> (Ind9 -> Ind9 -> Bool)
-> (Ind9 -> Ind9 -> Bool)
-> (Ind9 -> Ind9 -> Bool)
-> (Ind9 -> Ind9 -> Ind9)
-> (Ind9 -> Ind9 -> Ind9)
-> Ord Ind9
Ind9 -> Ind9 -> Bool
Ind9 -> Ind9 -> Ordering
Ind9 -> Ind9 -> Ind9
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Ind9 -> Ind9 -> Ind9
$cmin :: Ind9 -> Ind9 -> Ind9
max :: Ind9 -> Ind9 -> Ind9
$cmax :: Ind9 -> Ind9 -> Ind9
>= :: Ind9 -> Ind9 -> Bool
$c>= :: Ind9 -> Ind9 -> Bool
> :: Ind9 -> Ind9 -> Bool
$c> :: Ind9 -> Ind9 -> Bool
<= :: Ind9 -> Ind9 -> Bool
$c<= :: Ind9 -> Ind9 -> Bool
< :: Ind9 -> Ind9 -> Bool
$c< :: Ind9 -> Ind9 -> Bool
compare :: Ind9 -> Ind9 -> Ordering
$ccompare :: Ind9 -> Ind9 -> Ordering
$cp1Ord :: Eq Ind9
Ord, Ind9 -> Ind9 -> Bool
(Ind9 -> Ind9 -> Bool) -> (Ind9 -> Ind9 -> Bool) -> Eq Ind9
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Ind9 -> Ind9 -> Bool
$c/= :: Ind9 -> Ind9 -> Bool
== :: Ind9 -> Ind9 -> Bool
$c== :: Ind9 -> Ind9 -> Bool
Eq, Int -> Ind9 -> ShowS
[Ind9] -> ShowS
Ind9 -> String
(Int -> Ind9 -> ShowS)
-> (Ind9 -> String) -> ([Ind9] -> ShowS) -> Show Ind9
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Ind9] -> ShowS
$cshowList :: [Ind9] -> ShowS
show :: Ind9 -> String
$cshow :: Ind9 -> String
showsPrec :: Int -> Ind9 -> ShowS
$cshowsPrec :: Int -> Ind9 -> ShowS
Show, ReadPrec [Ind9]
ReadPrec Ind9
Int -> ReadS Ind9
ReadS [Ind9]
(Int -> ReadS Ind9)
-> ReadS [Ind9] -> ReadPrec Ind9 -> ReadPrec [Ind9] -> Read Ind9
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Ind9]
$creadListPrec :: ReadPrec [Ind9]
readPrec :: ReadPrec Ind9
$creadPrec :: ReadPrec Ind9
readList :: ReadS [Ind9]
$creadList :: ReadS [Ind9]
readsPrec :: Int -> ReadS Ind9
$creadsPrec :: Int -> ReadS Ind9
Read, (forall x. Ind9 -> Rep Ind9 x)
-> (forall x. Rep Ind9 x -> Ind9) -> Generic Ind9
forall x. Rep Ind9 x -> Ind9
forall x. Ind9 -> Rep Ind9 x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Ind9 x -> Ind9
$cfrom :: forall x. Ind9 -> Rep Ind9 x
Generic, Ind9 -> ()
(Ind9 -> ()) -> NFData Ind9
forall a. (a -> ()) -> NFData a
rnf :: Ind9 -> ()
$crnf :: Ind9 -> ()
NFData, Get Ind9
Putter Ind9
Putter Ind9 -> Get Ind9 -> Serialize Ind9
forall t. Putter t -> Get t -> Serialize t
get :: Get Ind9
$cget :: Get Ind9
put :: Putter Ind9
$cput :: Putter Ind9
Serialize)
instance TIndex Ind9 where
instance Enum Ind9 where
toEnum :: Int -> Ind9
toEnum = Int -> Ind9
Ind9
fromEnum :: Ind9 -> Int
fromEnum = Ind9 -> Int
indVal9
newtype Ind20 = Ind20 {Ind20 -> Int
indVal20 :: Int}
deriving (Eq Ind20
Eq Ind20
-> (Ind20 -> Ind20 -> Ordering)
-> (Ind20 -> Ind20 -> Bool)
-> (Ind20 -> Ind20 -> Bool)
-> (Ind20 -> Ind20 -> Bool)
-> (Ind20 -> Ind20 -> Bool)
-> (Ind20 -> Ind20 -> Ind20)
-> (Ind20 -> Ind20 -> Ind20)
-> Ord Ind20
Ind20 -> Ind20 -> Bool
Ind20 -> Ind20 -> Ordering
Ind20 -> Ind20 -> Ind20
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Ind20 -> Ind20 -> Ind20
$cmin :: Ind20 -> Ind20 -> Ind20
max :: Ind20 -> Ind20 -> Ind20
$cmax :: Ind20 -> Ind20 -> Ind20
>= :: Ind20 -> Ind20 -> Bool
$c>= :: Ind20 -> Ind20 -> Bool
> :: Ind20 -> Ind20 -> Bool
$c> :: Ind20 -> Ind20 -> Bool
<= :: Ind20 -> Ind20 -> Bool
$c<= :: Ind20 -> Ind20 -> Bool
< :: Ind20 -> Ind20 -> Bool
$c< :: Ind20 -> Ind20 -> Bool
compare :: Ind20 -> Ind20 -> Ordering
$ccompare :: Ind20 -> Ind20 -> Ordering
$cp1Ord :: Eq Ind20
Ord, Ind20 -> Ind20 -> Bool
(Ind20 -> Ind20 -> Bool) -> (Ind20 -> Ind20 -> Bool) -> Eq Ind20
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Ind20 -> Ind20 -> Bool
$c/= :: Ind20 -> Ind20 -> Bool
== :: Ind20 -> Ind20 -> Bool
$c== :: Ind20 -> Ind20 -> Bool
Eq, Int -> Ind20 -> ShowS
[Ind20] -> ShowS
Ind20 -> String
(Int -> Ind20 -> ShowS)
-> (Ind20 -> String) -> ([Ind20] -> ShowS) -> Show Ind20
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Ind20] -> ShowS
$cshowList :: [Ind20] -> ShowS
show :: Ind20 -> String
$cshow :: Ind20 -> String
showsPrec :: Int -> Ind20 -> ShowS
$cshowsPrec :: Int -> Ind20 -> ShowS
Show, ReadPrec [Ind20]
ReadPrec Ind20
Int -> ReadS Ind20
ReadS [Ind20]
(Int -> ReadS Ind20)
-> ReadS [Ind20]
-> ReadPrec Ind20
-> ReadPrec [Ind20]
-> Read Ind20
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Ind20]
$creadListPrec :: ReadPrec [Ind20]
readPrec :: ReadPrec Ind20
$creadPrec :: ReadPrec Ind20
readList :: ReadS [Ind20]
$creadList :: ReadS [Ind20]
readsPrec :: Int -> ReadS Ind20
$creadsPrec :: Int -> ReadS Ind20
Read, (forall x. Ind20 -> Rep Ind20 x)
-> (forall x. Rep Ind20 x -> Ind20) -> Generic Ind20
forall x. Rep Ind20 x -> Ind20
forall x. Ind20 -> Rep Ind20 x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Ind20 x -> Ind20
$cfrom :: forall x. Ind20 -> Rep Ind20 x
Generic, Ind20 -> ()
(Ind20 -> ()) -> NFData Ind20
forall a. (a -> ()) -> NFData a
rnf :: Ind20 -> ()
$crnf :: Ind20 -> ()
NFData, Get Ind20
Putter Ind20
Putter Ind20 -> Get Ind20 -> Serialize Ind20
forall t. Putter t -> Get t -> Serialize t
get :: Get Ind20
$cget :: Get Ind20
put :: Putter Ind20
$cput :: Putter Ind20
Serialize)
instance TIndex Ind20 where
instance Enum Ind20 where
toEnum :: Int -> Ind20
toEnum = Int -> Ind20
Ind20
fromEnum :: Ind20 -> Int
fromEnum = Ind20 -> Int
indVal20
type IndTupleST n1 n2 = (IndList n1 Ind3, IndList n2 Ind3)
type IndTupleAbs n1 n2 n3 n4 n5 n6 = (IndList n1 Ind20, IndList n2 Ind20 , IndList n3 Ind9, IndList n4 Ind9, IndList n5 Ind3, IndList n6 Ind3)
class TAdd a where
scaleZero :: a -> Bool
addS :: a -> a -> a
negateS :: a -> a
subS :: a -> a -> a
subS a
a a
b = a
a a -> a -> a
forall a. TAdd a => a -> a -> a
`addS` a -> a
forall a. TAdd a => a -> a
negateS a
b
newtype SField a = SField a deriving (Int -> SField a -> ShowS
[SField a] -> ShowS
SField a -> String
(Int -> SField a -> ShowS)
-> (SField a -> String) -> ([SField a] -> ShowS) -> Show (SField a)
forall a. Show a => Int -> SField a -> ShowS
forall a. Show a => [SField a] -> ShowS
forall a. Show a => SField a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SField a] -> ShowS
$cshowList :: forall a. Show a => [SField a] -> ShowS
show :: SField a -> String
$cshow :: forall a. Show a => SField a -> String
showsPrec :: Int -> SField a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> SField a -> ShowS
Show, SField a -> SField a -> Bool
(SField a -> SField a -> Bool)
-> (SField a -> SField a -> Bool) -> Eq (SField a)
forall a. Eq a => SField a -> SField a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SField a -> SField a -> Bool
$c/= :: forall a. Eq a => SField a -> SField a -> Bool
== :: SField a -> SField a -> Bool
$c== :: forall a. Eq a => SField a -> SField a -> Bool
Eq, Eq (SField a)
Eq (SField a)
-> (SField a -> SField a -> Ordering)
-> (SField a -> SField a -> Bool)
-> (SField a -> SField a -> Bool)
-> (SField a -> SField a -> Bool)
-> (SField a -> SField a -> Bool)
-> (SField a -> SField a -> SField a)
-> (SField a -> SField a -> SField a)
-> Ord (SField a)
SField a -> SField a -> Bool
SField a -> SField a -> Ordering
SField a -> SField a -> SField a
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall a. Ord a => Eq (SField a)
forall a. Ord a => SField a -> SField a -> Bool
forall a. Ord a => SField a -> SField a -> Ordering
forall a. Ord a => SField a -> SField a -> SField a
min :: SField a -> SField a -> SField a
$cmin :: forall a. Ord a => SField a -> SField a -> SField a
max :: SField a -> SField a -> SField a
$cmax :: forall a. Ord a => SField a -> SField a -> SField a
>= :: SField a -> SField a -> Bool
$c>= :: forall a. Ord a => SField a -> SField a -> Bool
> :: SField a -> SField a -> Bool
$c> :: forall a. Ord a => SField a -> SField a -> Bool
<= :: SField a -> SField a -> Bool
$c<= :: forall a. Ord a => SField a -> SField a -> Bool
< :: SField a -> SField a -> Bool
$c< :: forall a. Ord a => SField a -> SField a -> Bool
compare :: SField a -> SField a -> Ordering
$ccompare :: forall a. Ord a => SField a -> SField a -> Ordering
$cp1Ord :: forall a. Ord a => Eq (SField a)
Ord, (forall x. SField a -> Rep (SField a) x)
-> (forall x. Rep (SField a) x -> SField a) -> Generic (SField a)
forall x. Rep (SField a) x -> SField a
forall x. SField a -> Rep (SField a) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (SField a) x -> SField a
forall a x. SField a -> Rep (SField a) x
$cto :: forall a x. Rep (SField a) x -> SField a
$cfrom :: forall a x. SField a -> Rep (SField a) x
Generic, Get (SField a)
Putter (SField a)
Putter (SField a) -> Get (SField a) -> Serialize (SField a)
forall a. Serialize a => Get (SField a)
forall a. Serialize a => Putter (SField a)
forall t. Putter t -> Get t -> Serialize t
get :: Get (SField a)
$cget :: forall a. Serialize a => Get (SField a)
put :: Putter (SField a)
$cput :: forall a. Serialize a => Putter (SField a)
Serialize)
instance Functor SField where
fmap :: (a -> b) -> SField a -> SField b
fmap a -> b
f (SField a
a) = b -> SField b
forall a. a -> SField a
SField (b -> SField b) -> b -> SField b
forall a b. (a -> b) -> a -> b
$ a -> b
f a
a
instance Applicative SField where
pure :: a -> SField a
pure = a -> SField a
forall a. a -> SField a
SField
<*> :: SField (a -> b) -> SField a -> SField b
(<*>) (SField a -> b
f) = (a -> b) -> SField a -> SField b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
f
instance Num a => Num (SField a) where
+ :: SField a -> SField a -> SField a
(+) = (a -> a -> a) -> SField a -> SField a -> SField a
forall (f :: * -> *) a b c.
Applicative f =>
(a -> b -> c) -> f a -> f b -> f c
liftA2 a -> a -> a
forall a. Num a => a -> a -> a
(+)
(-) = (a -> a -> a) -> SField a -> SField a -> SField a
forall (f :: * -> *) a b c.
Applicative f =>
(a -> b -> c) -> f a -> f b -> f c
liftA2 (-)
* :: SField a -> SField a -> SField a
(*) = (a -> a -> a) -> SField a -> SField a -> SField a
forall (f :: * -> *) a b c.
Applicative f =>
(a -> b -> c) -> f a -> f b -> f c
liftA2 a -> a -> a
forall a. Num a => a -> a -> a
(*)
negate :: SField a -> SField a
negate = (a -> a) -> SField a -> SField a
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> a
forall a. Num a => a -> a
negate
abs :: SField a -> SField a
abs = (a -> a) -> SField a -> SField a
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> a
forall a. Num a => a -> a
abs
signum :: SField a -> SField a
signum = (a -> a) -> SField a -> SField a
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> a
forall a. Num a => a -> a
signum
fromInteger :: Integer -> SField a
fromInteger = a -> SField a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (a -> SField a) -> (Integer -> a) -> Integer -> SField a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> a
forall a. Num a => Integer -> a
fromInteger
newtype SSymbolic = SSymbolic String deriving (Int -> SSymbolic -> ShowS
[SSymbolic] -> ShowS
SSymbolic -> String
(Int -> SSymbolic -> ShowS)
-> (SSymbolic -> String)
-> ([SSymbolic] -> ShowS)
-> Show SSymbolic
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SSymbolic] -> ShowS
$cshowList :: [SSymbolic] -> ShowS
show :: SSymbolic -> String
$cshow :: SSymbolic -> String
showsPrec :: Int -> SSymbolic -> ShowS
$cshowsPrec :: Int -> SSymbolic -> ShowS
Show, SSymbolic -> SSymbolic -> Bool
(SSymbolic -> SSymbolic -> Bool)
-> (SSymbolic -> SSymbolic -> Bool) -> Eq SSymbolic
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SSymbolic -> SSymbolic -> Bool
$c/= :: SSymbolic -> SSymbolic -> Bool
== :: SSymbolic -> SSymbolic -> Bool
$c== :: SSymbolic -> SSymbolic -> Bool
Eq, Eq SSymbolic
Eq SSymbolic
-> (SSymbolic -> SSymbolic -> Ordering)
-> (SSymbolic -> SSymbolic -> Bool)
-> (SSymbolic -> SSymbolic -> Bool)
-> (SSymbolic -> SSymbolic -> Bool)
-> (SSymbolic -> SSymbolic -> Bool)
-> (SSymbolic -> SSymbolic -> SSymbolic)
-> (SSymbolic -> SSymbolic -> SSymbolic)
-> Ord SSymbolic
SSymbolic -> SSymbolic -> Bool
SSymbolic -> SSymbolic -> Ordering
SSymbolic -> SSymbolic -> SSymbolic
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: SSymbolic -> SSymbolic -> SSymbolic
$cmin :: SSymbolic -> SSymbolic -> SSymbolic
max :: SSymbolic -> SSymbolic -> SSymbolic
$cmax :: SSymbolic -> SSymbolic -> SSymbolic
>= :: SSymbolic -> SSymbolic -> Bool
$c>= :: SSymbolic -> SSymbolic -> Bool
> :: SSymbolic -> SSymbolic -> Bool
$c> :: SSymbolic -> SSymbolic -> Bool
<= :: SSymbolic -> SSymbolic -> Bool
$c<= :: SSymbolic -> SSymbolic -> Bool
< :: SSymbolic -> SSymbolic -> Bool
$c< :: SSymbolic -> SSymbolic -> Bool
compare :: SSymbolic -> SSymbolic -> Ordering
$ccompare :: SSymbolic -> SSymbolic -> Ordering
$cp1Ord :: Eq SSymbolic
Ord, (forall x. SSymbolic -> Rep SSymbolic x)
-> (forall x. Rep SSymbolic x -> SSymbolic) -> Generic SSymbolic
forall x. Rep SSymbolic x -> SSymbolic
forall x. SSymbolic -> Rep SSymbolic x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SSymbolic x -> SSymbolic
$cfrom :: forall x. SSymbolic -> Rep SSymbolic x
Generic, Get SSymbolic
Putter SSymbolic
Putter SSymbolic -> Get SSymbolic -> Serialize SSymbolic
forall t. Putter t -> Get t -> Serialize t
get :: Get SSymbolic
$cget :: Get SSymbolic
put :: Putter SSymbolic
$cput :: Putter SSymbolic
Serialize)
instance Num SSymbolic where
SSymbolic String
s1 + :: SSymbolic -> SSymbolic -> SSymbolic
+ SSymbolic String
s2 = String -> SSymbolic
SSymbolic (String -> SSymbolic) -> String -> SSymbolic
forall a b. (a -> b) -> a -> b
$ String
"(" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s1 String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
")+(" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s2 String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
")"
SSymbolic String
s1 - :: SSymbolic -> SSymbolic -> SSymbolic
- SSymbolic String
s2 = String -> SSymbolic
SSymbolic (String -> SSymbolic) -> String -> SSymbolic
forall a b. (a -> b) -> a -> b
$ String
"(" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s1 String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
")-(" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s2 String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
")"
SSymbolic String
s1 * :: SSymbolic -> SSymbolic -> SSymbolic
* SSymbolic String
s2 = String -> SSymbolic
SSymbolic (String -> SSymbolic) -> String -> SSymbolic
forall a b. (a -> b) -> a -> b
$ String
"(" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s1 String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
")*(" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s2 String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
")"
negate :: SSymbolic -> SSymbolic
negate (SSymbolic String
s) = String -> SSymbolic
SSymbolic (String -> SSymbolic) -> String -> SSymbolic
forall a b. (a -> b) -> a -> b
$ String
"(-1)*(" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
")"
abs :: SSymbolic -> SSymbolic
abs (SSymbolic String
s) = String -> SSymbolic
SSymbolic (String -> SSymbolic) -> String -> SSymbolic
forall a b. (a -> b) -> a -> b
$ String
"abs(" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
")"
signum :: SSymbolic -> SSymbolic
signum (SSymbolic String
s) = String -> SSymbolic
SSymbolic (String -> SSymbolic) -> String -> SSymbolic
forall a b. (a -> b) -> a -> b
$ String
"signum(" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
")"
fromInteger :: Integer -> SSymbolic
fromInteger Integer
i = String -> SSymbolic
SSymbolic (String -> SSymbolic) -> String -> SSymbolic
forall a b. (a -> b) -> a -> b
$ String
"(" String -> ShowS
forall a. [a] -> [a] -> [a]
++ Integer -> String
forall a. Show a => a -> String
show Integer
i String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
")"
class Epsilon a where
nearZero :: a -> Bool
instance Epsilon Double where
nearZero :: Double -> Bool
nearZero Double
d = Double -> Double
forall a. Num a => a -> a
abs Double
d Double -> Double -> Bool
forall a. Ord a => a -> a -> Bool
< Double
1e-12
instance Epsilon Float where
nearZero :: Float -> Bool
nearZero Float
d = Float -> Float
forall a. Num a => a -> a
abs Float
d Float -> Float -> Bool
forall a. Ord a => a -> a -> Bool
< Float
1e-5
instance Epsilon Rational where
nearZero :: Rational -> Bool
nearZero Rational
r = Rational
r Rational -> Rational -> Bool
forall a. Eq a => a -> a -> Bool
== Rational
0
instance Epsilon Int where
nearZero :: Int -> Bool
nearZero Int
i = Int
i Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
0
instance Epsilon Integer where
nearZero :: Integer -> Bool
nearZero Integer
i = Integer
i Integer -> Integer -> Bool
forall a. Eq a => a -> a -> Bool
== Integer
0
instance (Num a, Eq a) => TAdd (SField a) where
addS :: SField a -> SField a -> SField a
addS (SField a
a) (SField a
b) = a -> SField a
forall a. a -> SField a
SField (a -> SField a) -> a -> SField a
forall a b. (a -> b) -> a -> b
$ a
a a -> a -> a
forall a. Num a => a -> a -> a
+ a
b
negateS :: SField a -> SField a
negateS (SField a
a) = a -> SField a
forall a. a -> SField a
SField (a -> SField a) -> a -> SField a
forall a b. (a -> b) -> a -> b
$ a -> a
forall a. Num a => a -> a
negate a
a
scaleZero :: SField a -> Bool
scaleZero (SField a
a) = a
a a -> a -> Bool
forall a. Eq a => a -> a -> Bool
== a
0
instance TAdd SSymbolic where
addS :: SSymbolic -> SSymbolic -> SSymbolic
addS = SSymbolic -> SSymbolic -> SSymbolic
forall a. Num a => a -> a -> a
(+)
negateS :: SSymbolic -> SSymbolic
negateS = SSymbolic -> SSymbolic
forall a. Num a => a -> a
negate
scaleZero :: SSymbolic -> Bool
scaleZero (SSymbolic String
a) = String -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null String
a
instance (TIndex k, TAdd v) => TAdd (Tensor n k v) where
addS :: Tensor n k v -> Tensor n k v -> Tensor n k v
addS = Tensor n k v -> Tensor n k v -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
Tensor n k v -> Tensor n k v -> Tensor n k v
(&+)
negateS :: Tensor n k v -> Tensor n k v
negateS = Tensor n k v -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
Tensor n k v -> Tensor n k v
negateTens
scaleZero :: Tensor n k v -> Bool
scaleZero = \case
Tensor n k v
ZeroTensor -> Bool
True
Tensor n k v
_ -> Bool
False
class Prod v v' where
type TProd v v' :: *
prod :: v -> v' -> TProd v v'
instance Num a => Prod (SField a) (SField a) where
type TProd (SField a) (SField a) = SField a
prod :: SField a -> SField a -> TProd (SField a) (SField a)
prod = SField a -> SField a -> TProd (SField a) (SField a)
forall a. Num a => a -> a -> a
(*)
instance Prod SSymbolic SSymbolic where
type TProd SSymbolic SSymbolic = SSymbolic
prod :: SSymbolic -> SSymbolic -> TProd SSymbolic SSymbolic
prod = SSymbolic -> SSymbolic -> TProd SSymbolic SSymbolic
forall a. Num a => a -> a -> a
(*)
instance Show a => Prod (SField a) SSymbolic where
type TProd (SField a) SSymbolic = SSymbolic
prod :: SField a -> SSymbolic -> TProd (SField a) SSymbolic
prod (SField a
s) = (String -> SSymbolic
SSymbolic (a -> String
forall a. Show a => a -> String
show a
s) SSymbolic -> SSymbolic -> SSymbolic
forall a. Num a => a -> a -> a
*)
instance Show a => Prod SSymbolic (SField a) where
type TProd SSymbolic (SField a) = SSymbolic
prod :: SSymbolic -> SField a -> TProd SSymbolic (SField a)
prod SSymbolic
a (SField a
s) = SSymbolic
a SSymbolic -> SSymbolic -> SSymbolic
forall a. Num a => a -> a -> a
* String -> SSymbolic
SSymbolic (a -> String
forall a. Show a => a -> String
show a
s)
instance (TIndex k, Prod (SField s) v) => Prod (SField s) (Tensor n k v) where
type TProd (SField s) (Tensor n k v) = Tensor n k (TProd (SField s) v)
prod :: SField s -> Tensor n k v -> TProd (SField s) (Tensor n k v)
prod = SField s -> Tensor n k v -> TProd (SField s) (Tensor n k v)
forall k s v (n :: Nat).
(TIndex k, Prod s v) =>
s -> Tensor n k v -> Tensor n k (TProd s v)
(&.)
instance (TIndex k, Prod (AnsVar s) v) => Prod (AnsVar s) (Tensor n k v) where
type TProd (AnsVar s) (Tensor n k v) = Tensor n k (TProd (AnsVar s) v)
prod :: AnsVar s -> Tensor n k v -> TProd (AnsVar s) (Tensor n k v)
prod = AnsVar s -> Tensor n k v -> TProd (AnsVar s) (Tensor n k v)
forall k s v (n :: Nat).
(TIndex k, Prod s v) =>
s -> Tensor n k v -> Tensor n k (TProd s v)
(&.)
instance (TIndex k, Prod SSymbolic v) => Prod SSymbolic (Tensor n k v) where
type TProd SSymbolic (Tensor n k v) = Tensor n k (TProd SSymbolic v)
prod :: SSymbolic -> Tensor n k v -> TProd SSymbolic (Tensor n k v)
prod = SSymbolic -> Tensor n k v -> TProd SSymbolic (Tensor n k v)
forall k s v (n :: Nat).
(TIndex k, Prod s v) =>
s -> Tensor n k v -> Tensor n k (TProd s v)
(&.)
instance (TIndex k, Prod v v') => Prod (Tensor n k v) (Tensor n' k v') where
type TProd (Tensor n k v) (Tensor n' k v') = Tensor (n+n') k (TProd v v')
prod :: Tensor n k v
-> Tensor n' k v' -> TProd (Tensor n k v) (Tensor n' k v')
prod = Tensor n k v
-> Tensor n' k v' -> TProd (Tensor n k v) (Tensor n' k v')
forall k v v' (n :: Nat) (n' :: Nat).
(TIndex k, Prod v v') =>
Tensor n k v
-> Tensor n' k v' -> TProd (Tensor n k v) (Tensor n' k v')
(&*)
newtype AnsVar a = AnsVar (I.IntMap a) deriving (Int -> AnsVar a -> ShowS
[AnsVar a] -> ShowS
AnsVar a -> String
(Int -> AnsVar a -> ShowS)
-> (AnsVar a -> String) -> ([AnsVar a] -> ShowS) -> Show (AnsVar a)
forall a. Show a => Int -> AnsVar a -> ShowS
forall a. Show a => [AnsVar a] -> ShowS
forall a. Show a => AnsVar a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AnsVar a] -> ShowS
$cshowList :: forall a. Show a => [AnsVar a] -> ShowS
show :: AnsVar a -> String
$cshow :: forall a. Show a => AnsVar a -> String
showsPrec :: Int -> AnsVar a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> AnsVar a -> ShowS
Show, AnsVar a -> AnsVar a -> Bool
(AnsVar a -> AnsVar a -> Bool)
-> (AnsVar a -> AnsVar a -> Bool) -> Eq (AnsVar a)
forall a. Eq a => AnsVar a -> AnsVar a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AnsVar a -> AnsVar a -> Bool
$c/= :: forall a. Eq a => AnsVar a -> AnsVar a -> Bool
== :: AnsVar a -> AnsVar a -> Bool
$c== :: forall a. Eq a => AnsVar a -> AnsVar a -> Bool
Eq, (forall x. AnsVar a -> Rep (AnsVar a) x)
-> (forall x. Rep (AnsVar a) x -> AnsVar a) -> Generic (AnsVar a)
forall x. Rep (AnsVar a) x -> AnsVar a
forall x. AnsVar a -> Rep (AnsVar a) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (AnsVar a) x -> AnsVar a
forall a x. AnsVar a -> Rep (AnsVar a) x
$cto :: forall a x. Rep (AnsVar a) x -> AnsVar a
$cfrom :: forall a x. AnsVar a -> Rep (AnsVar a) x
Generic, Get (AnsVar a)
Putter (AnsVar a)
Putter (AnsVar a) -> Get (AnsVar a) -> Serialize (AnsVar a)
forall a. Serialize a => Get (AnsVar a)
forall a. Serialize a => Putter (AnsVar a)
forall t. Putter t -> Get t -> Serialize t
get :: Get (AnsVar a)
$cget :: forall a. Serialize a => Get (AnsVar a)
put :: Putter (AnsVar a)
$cput :: forall a. Serialize a => Putter (AnsVar a)
Serialize)
type AnsVarR = AnsVar (SField Rational)
shiftVarLabels :: Int -> AnsVar a -> AnsVar a
shiftVarLabels :: Int -> AnsVar a -> AnsVar a
shiftVarLabels Int
s (AnsVar IntMap a
v) = IntMap a -> AnsVar a
forall a. IntMap a -> AnsVar a
AnsVar (IntMap a -> AnsVar a) -> IntMap a -> AnsVar a
forall a b. (a -> b) -> a -> b
$ (Int -> Int) -> IntMap a -> IntMap a
forall a. (Int -> Int) -> IntMap a -> IntMap a
I.mapKeys (Int
s Int -> Int -> Int
forall a. Num a => a -> a -> a
+) IntMap a
v
shiftLabels1 :: Int -> AbsTensor1 n1 k1 (AnsVar a) -> AbsTensor1 n1 k1 (AnsVar a)
shiftLabels1 :: Int -> AbsTensor1 n1 k1 (AnsVar a) -> AbsTensor1 n1 k1 (AnsVar a)
shiftLabels1 Int
s = (AnsVar a -> AnsVar a)
-> AbsTensor1 n1 k1 (AnsVar a) -> AbsTensor1 n1 k1 (AnsVar a)
forall v1 v2 (n1 :: Nat) k.
(v1 -> v2) -> Tensor n1 k v1 -> Tensor n1 k v2
mapTo1 (Int -> AnsVar a -> AnsVar a
forall a. Int -> AnsVar a -> AnsVar a
shiftVarLabels Int
s)
shiftLabels2 :: Int -> AbsTensor2 n1 n2 k1 (AnsVar a) -> AbsTensor2 n1 n2 k1 (AnsVar a)
shiftLabels2 :: Int
-> AbsTensor2 n1 n2 k1 (AnsVar a) -> AbsTensor2 n1 n2 k1 (AnsVar a)
shiftLabels2 Int
s = (AnsVar a -> AnsVar a)
-> AbsTensor2 n1 n2 k1 (AnsVar a) -> AbsTensor2 n1 n2 k1 (AnsVar a)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) k.
(v1 -> v2) -> Tensor2 n1 n2 k v1 -> Tensor2 n1 n2 k v2
mapTo2 (Int -> AnsVar a -> AnsVar a
forall a. Int -> AnsVar a -> AnsVar a
shiftVarLabels Int
s)
shiftLabels3 :: Int -> AbsTensor3 n1 n2 n3 k1 k2 (AnsVar a) -> AbsTensor3 n1 n2 n3 k1 k2 (AnsVar a)
shiftLabels3 :: Int
-> AbsTensor3 n1 n2 n3 k1 k2 (AnsVar a)
-> AbsTensor3 n1 n2 n3 k1 k2 (AnsVar a)
shiftLabels3 Int
s = (AnsVar a -> AnsVar a)
-> AbsTensor3 n1 n2 n3 k1 k2 (AnsVar a)
-> AbsTensor3 n1 n2 n3 k1 k2 (AnsVar a)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor3 n1 n2 n3 k1 k2 v1 -> AbsTensor3 n1 n2 n3 k1 k2 v2
mapTo3 (Int -> AnsVar a -> AnsVar a
forall a. Int -> AnsVar a -> AnsVar a
shiftVarLabels Int
s)
shiftLabels4 :: Int -> AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar a) -> AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar a)
shiftLabels4 :: Int
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar a)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar a)
shiftLabels4 Int
s = (AnsVar a -> AnsVar a)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar a)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar a)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v1
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v2
mapTo4 (Int -> AnsVar a -> AnsVar a
forall a. Int -> AnsVar a -> AnsVar a
shiftVarLabels Int
s)
shiftLabels5 :: Int -> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar a) -> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar a)
shiftLabels5 :: Int
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar a)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar a)
shiftLabels5 Int
s = (AnsVar a -> AnsVar a)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar a)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar a)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v1
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v2
mapTo5 (Int -> AnsVar a -> AnsVar a
forall a. Int -> AnsVar a -> AnsVar a
shiftVarLabels Int
s)
shiftLabels6 :: Int -> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar a) -> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar a)
shiftLabels6 :: Int
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar a)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar a)
shiftLabels6 Int
s = (AnsVar a -> AnsVar a)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar a)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar a)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v1
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v2
mapTo6 (Int -> AnsVar a -> AnsVar a
forall a. Int -> AnsVar a -> AnsVar a
shiftVarLabels Int
s)
shiftLabels7 :: Int -> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar a) -> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar a)
shiftLabels7 :: Int
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar a)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar a)
shiftLabels7 Int
s = (AnsVar a -> AnsVar a)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar a)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar a)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) (n7 :: Nat) k1 k2 k3 k4.
(v1 -> v2)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v1
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v2
mapTo7 (Int -> AnsVar a -> AnsVar a
forall a. Int -> AnsVar a -> AnsVar a
shiftVarLabels Int
s)
shiftLabels8 :: Int -> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar a) -> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar a)
shiftLabels8 :: Int
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar a)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar a)
shiftLabels8 Int
s = (AnsVar a -> AnsVar a)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar a)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar a)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) (n7 :: Nat) (n8 :: Nat) k1 k2 k3 k4.
(v1 -> v2)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v1
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v2
mapTo8 (Int -> AnsVar a -> AnsVar a
forall a. Int -> AnsVar a -> AnsVar a
shiftVarLabels Int
s)
instance TAdd a => TAdd (AnsVar a) where
addS :: AnsVar a -> AnsVar a -> AnsVar a
addS (AnsVar IntMap a
v1) (AnsVar IntMap a
v2) = IntMap a -> AnsVar a
forall a. IntMap a -> AnsVar a
AnsVar (IntMap a -> AnsVar a) -> IntMap a -> AnsVar a
forall a b. (a -> b) -> a -> b
$ (a -> Bool) -> IntMap a -> IntMap a
forall a. (a -> Bool) -> IntMap a -> IntMap a
I.filter (Bool -> Bool
not (Bool -> Bool) -> (a -> Bool) -> a -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> Bool
forall a. TAdd a => a -> Bool
scaleZero) (IntMap a -> IntMap a) -> IntMap a -> IntMap a
forall a b. (a -> b) -> a -> b
$ (a -> a -> a) -> IntMap a -> IntMap a -> IntMap a
forall a. (a -> a -> a) -> IntMap a -> IntMap a -> IntMap a
I.unionWith a -> a -> a
forall a. TAdd a => a -> a -> a
addS IntMap a
v1 IntMap a
v2
negateS :: AnsVar a -> AnsVar a
negateS (AnsVar IntMap a
v1) = IntMap a -> AnsVar a
forall a. IntMap a -> AnsVar a
AnsVar (IntMap a -> AnsVar a) -> IntMap a -> AnsVar a
forall a b. (a -> b) -> a -> b
$ (a -> a) -> IntMap a -> IntMap a
forall a b. (a -> b) -> IntMap a -> IntMap b
I.map a -> a
forall a. TAdd a => a -> a
negateS IntMap a
v1
scaleZero :: AnsVar a -> Bool
scaleZero (AnsVar IntMap a
v) = IntMap a -> Bool
forall a. IntMap a -> Bool
I.null IntMap a
v
instance Prod (SField v) (SField v') => Prod (SField v) (AnsVar (SField v')) where
type TProd (SField v) (AnsVar (SField v')) = AnsVar (TProd (SField v) (SField v'))
prod :: SField v
-> AnsVar (SField v') -> TProd (SField v) (AnsVar (SField v'))
prod SField v
v (AnsVar IntMap (SField v')
v') = IntMap (TProd (SField v) (SField v'))
-> AnsVar (TProd (SField v) (SField v'))
forall a. IntMap a -> AnsVar a
AnsVar (IntMap (TProd (SField v) (SField v'))
-> AnsVar (TProd (SField v) (SField v')))
-> IntMap (TProd (SField v) (SField v'))
-> AnsVar (TProd (SField v) (SField v'))
forall a b. (a -> b) -> a -> b
$ (SField v' -> TProd (SField v) (SField v'))
-> IntMap (SField v') -> IntMap (TProd (SField v) (SField v'))
forall a b. (a -> b) -> IntMap a -> IntMap b
I.map (SField v -> SField v' -> TProd (SField v) (SField v')
forall v v'. Prod v v' => v -> v' -> TProd v v'
prod SField v
v) IntMap (SField v')
v'
instance Prod (SField v') (SField v) => Prod (AnsVar (SField v)) (SField v') where
type TProd (AnsVar (SField v)) (SField v') = AnsVar (TProd (SField v') (SField v))
prod :: AnsVar (SField v)
-> SField v' -> TProd (AnsVar (SField v)) (SField v')
prod (AnsVar IntMap (SField v)
v) SField v'
v' = IntMap (TProd (SField v') (SField v))
-> AnsVar (TProd (SField v') (SField v))
forall a. IntMap a -> AnsVar a
AnsVar (IntMap (TProd (SField v') (SField v))
-> AnsVar (TProd (SField v') (SField v)))
-> IntMap (TProd (SField v') (SField v))
-> AnsVar (TProd (SField v') (SField v))
forall a b. (a -> b) -> a -> b
$ (SField v -> TProd (SField v') (SField v))
-> IntMap (SField v) -> IntMap (TProd (SField v') (SField v))
forall a b. (a -> b) -> IntMap a -> IntMap b
I.map (SField v' -> SField v -> TProd (SField v') (SField v)
forall v v'. Prod v v' => v -> v' -> TProd v v'
prod SField v'
v') IntMap (SField v)
v
newtype CFun a b = CFun (a -> b)
instance Functor (CFun a) where
fmap :: (a -> b) -> CFun a a -> CFun a b
fmap a -> b
f (CFun a -> a
g) = (a -> b) -> CFun a b
forall a b. (a -> b) -> CFun a b
CFun ((a -> b) -> CFun a b) -> (a -> b) -> CFun a b
forall a b. (a -> b) -> a -> b
$ a -> b
f (a -> b) -> (a -> a) -> a -> b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> a
g
instance Applicative (CFun a) where
pure :: a -> CFun a a
pure = (a -> a) -> CFun a a
forall a b. (a -> b) -> CFun a b
CFun ((a -> a) -> CFun a a) -> (a -> a -> a) -> a -> CFun a a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> a -> a
forall a b. a -> b -> a
const
(CFun a -> a -> b
f) <*> :: CFun a (a -> b) -> CFun a a -> CFun a b
<*> (CFun a -> a
g) = (a -> b) -> CFun a b
forall a b. (a -> b) -> CFun a b
CFun ((a -> b) -> CFun a b) -> (a -> b) -> CFun a b
forall a b. (a -> b) -> a -> b
$ \a
x -> a -> a -> b
f a
x (a -> a
g a
x)
instance Num b => Num (CFun a b) where
+ :: CFun a b -> CFun a b -> CFun a b
(+) = (b -> b -> b) -> CFun a b -> CFun a b -> CFun a b
forall (f :: * -> *) a b c.
Applicative f =>
(a -> b -> c) -> f a -> f b -> f c
liftA2 b -> b -> b
forall a. Num a => a -> a -> a
(+)
* :: CFun a b -> CFun a b -> CFun a b
(*) = (b -> b -> b) -> CFun a b -> CFun a b -> CFun a b
forall (f :: * -> *) a b c.
Applicative f =>
(a -> b -> c) -> f a -> f b -> f c
liftA2 b -> b -> b
forall a. Num a => a -> a -> a
(*)
(-) = (b -> b -> b) -> CFun a b -> CFun a b -> CFun a b
forall (f :: * -> *) a b c.
Applicative f =>
(a -> b -> c) -> f a -> f b -> f c
liftA2 (-)
negate :: CFun a b -> CFun a b
negate = (b -> b) -> CFun a b -> CFun a b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap b -> b
forall a. Num a => a -> a
negate
abs :: CFun a b -> CFun a b
abs = (b -> b) -> CFun a b -> CFun a b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap b -> b
forall a. Num a => a -> a
abs
signum :: CFun a b -> CFun a b
signum = (b -> b) -> CFun a b -> CFun a b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap b -> b
forall a. Num a => a -> a
signum
fromInteger :: Integer -> CFun a b
fromInteger = (a -> b) -> CFun a b
forall a b. (a -> b) -> CFun a b
CFun ((a -> b) -> CFun a b)
-> (Integer -> a -> b) -> Integer -> CFun a b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. b -> a -> b
forall a b. a -> b -> a
const (b -> a -> b) -> (Integer -> b) -> Integer -> a -> b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> b
forall a. Num a => Integer -> a
fromInteger
instance Num b => TAdd (CFun a b) where
addS :: CFun a b -> CFun a b -> CFun a b
addS = CFun a b -> CFun a b -> CFun a b
forall a. Num a => a -> a -> a
(+)
negateS :: CFun a b -> CFun a b
negateS = CFun a b -> CFun a b
forall a. Num a => a -> a
negate
scaleZero :: CFun a b -> Bool
scaleZero = Bool -> CFun a b -> Bool
forall a b. a -> b -> a
const Bool
False
instance Num b => Prod (CFun a b) (CFun a b) where
type TProd (CFun a b) (CFun a b) = CFun a b
prod :: CFun a b -> CFun a b -> TProd (CFun a b) (CFun a b)
prod = CFun a b -> CFun a b -> TProd (CFun a b) (CFun a b)
forall a. Num a => a -> a -> a
(*)
instance Num b => Prod (SField b) (CFun a b) where
type TProd (SField b) (CFun a b) = CFun a b
prod :: SField b -> CFun a b -> TProd (SField b) (CFun a b)
prod (SField b
s) (CFun a -> b
f) = (a -> b) -> CFun a b
forall a b. (a -> b) -> CFun a b
CFun ((a -> b) -> CFun a b) -> (a -> b) -> CFun a b
forall a b. (a -> b) -> a -> b
$ (b -> b -> b
forall a. Num a => a -> a -> a
*b
s) (b -> b) -> (a -> b) -> a -> b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> b
f
evalSec :: (Num b, Eq b, Epsilon b) => STTens n1 n2 (CFun a b) -> a -> STTens n1 n2 (SField b)
evalSec :: STTens n1 n2 (CFun a b) -> a -> STTens n1 n2 (SField b)
evalSec STTens n1 n2 (CFun a b)
tens a
p = STTens n1 n2 (SField b)
tens'
where
tList :: [(IndTuple2 n1 n2 Ind3, CFun a b)]
tList = STTens n1 n2 (CFun a b) -> [(IndTuple2 n1 n2 Ind3, CFun a b)]
forall (n1 :: Nat) (n2 :: Nat) k1 v.
AbsTensor2 n1 n2 k1 v -> [(IndTuple2 n1 n2 k1, v)]
toListT2 STTens n1 n2 (CFun a b)
tens
tList' :: [(IndTuple2 n1 n2 Ind3, b)]
tList' = ((IndTuple2 n1 n2 Ind3, CFun a b) -> (IndTuple2 n1 n2 Ind3, b))
-> [(IndTuple2 n1 n2 Ind3, CFun a b)]
-> [(IndTuple2 n1 n2 Ind3, b)]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((CFun a b -> b)
-> (IndTuple2 n1 n2 Ind3, CFun a b) -> (IndTuple2 n1 n2 Ind3, b)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (\(CFun a -> b
f) -> a -> b
f a
p)) [(IndTuple2 n1 n2 Ind3, CFun a b)]
tList
tList'' :: [(IndTuple2 n1 n2 Ind3, b)]
tList'' = ((IndTuple2 n1 n2 Ind3, b) -> Bool)
-> [(IndTuple2 n1 n2 Ind3, b)] -> [(IndTuple2 n1 n2 Ind3, b)]
forall a. (a -> Bool) -> [a] -> [a]
filter (\(IndTuple2 n1 n2 Ind3
_, b
v) -> Bool -> Bool
not (Bool -> Bool) -> Bool -> Bool
forall a b. (a -> b) -> a -> b
$ b -> Bool
forall a. Epsilon a => a -> Bool
nearZero b
v) [(IndTuple2 n1 n2 Ind3, b)]
tList'
tList''' :: [(IndTuple2 n1 n2 Ind3, SField b)]
tList''' = ((IndTuple2 n1 n2 Ind3, b) -> (IndTuple2 n1 n2 Ind3, SField b))
-> [(IndTuple2 n1 n2 Ind3, b)]
-> [(IndTuple2 n1 n2 Ind3, SField b)]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((b -> SField b)
-> (IndTuple2 n1 n2 Ind3, b) -> (IndTuple2 n1 n2 Ind3, SField b)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap b -> SField b
forall a. a -> SField a
SField) [(IndTuple2 n1 n2 Ind3, b)]
tList''
tens' :: STTens n1 n2 (SField b)
tens' = [(IndTuple2 n1 n2 Ind3, SField b)] -> STTens n1 n2 (SField b)
forall k1 v (n1 :: Nat) (n2 :: Nat).
(TIndex k1, TAdd v) =>
[(IndTuple2 n1 n2 k1, v)] -> AbsTensor2 n1 n2 k1 v
fromListT2 [(IndTuple2 n1 n2 Ind3, SField b)]
tList'''
myGrad :: Num a => [Int] -> ([AD.Forward a] -> AD.Forward a) -> [(Int, [a] -> a)]
myGrad :: [Int] -> ([Forward a] -> Forward a) -> [(Int, [a] -> a)]
myGrad [Int]
is [Forward a] -> Forward a
f = (Int -> (Int, [a] -> a)) -> [Int] -> [(Int, [a] -> a)]
forall a b. (a -> b) -> [a] -> [b]
map (\Int
i -> (Int
i, ([a] -> Int -> a
forall a. [a] -> Int -> a
!!Int
i) ([a] -> a) -> ([a] -> [a]) -> [a] -> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [a] -> [a]
g)) [Int]
is
where
g :: [a] -> [a]
g = ([Forward a] -> Forward a) -> [a] -> [a]
forall (f :: * -> *) a.
(Traversable f, Num a) =>
(f (Forward a) -> Forward a) -> f a -> f a
AD.grad [Forward a] -> Forward a
f
type TMap k v = [(k,v)]
insertWithTMap :: (Ord k) => (v -> v -> v) -> k -> v -> TMap k v -> TMap k v
insertWithTMap :: (v -> v -> v) -> k -> v -> TMap k v -> TMap k v
insertWithTMap v -> v -> v
_ k
key v
val [] = [(k
key,v
val)]
insertWithTMap v -> v -> v
f k
key v
val ((k
k1,v
v1):TMap k v
xs)
| k
key k -> k -> Bool
forall a. Ord a => a -> a -> Bool
< k
k1 = (k
key,v
val) (k, v) -> TMap k v -> TMap k v
forall a. a -> [a] -> [a]
: ((k
k1,v
v1)(k, v) -> TMap k v -> TMap k v
forall a. a -> [a] -> [a]
:TMap k v
xs)
| k
key k -> k -> Bool
forall a. Eq a => a -> a -> Bool
== k
k1 = (k
k1,v -> v -> v
f v
val v
v1) (k, v) -> TMap k v -> TMap k v
forall a. a -> [a] -> [a]
: TMap k v
xs
| Bool
otherwise = (k
k1,v
v1) (k, v) -> TMap k v -> TMap k v
forall a. a -> [a] -> [a]
: (v -> v -> v) -> k -> v -> TMap k v -> TMap k v
forall k v.
Ord k =>
(v -> v -> v) -> k -> v -> TMap k v -> TMap k v
insertWithTMap v -> v -> v
f k
key v
val TMap k v
xs
addTMaps :: (Ord k) => (v -> v -> v) -> TMap k v -> TMap k v -> TMap k v
addTMaps :: (v -> v -> v) -> TMap k v -> TMap k v -> TMap k v
addTMaps v -> v -> v
_ TMap k v
m1 [] = TMap k v
m1
addTMaps v -> v -> v
_ [] TMap k v
m2 = TMap k v
m2
addTMaps v -> v -> v
f ((k
k1,v
v1):TMap k v
xs) ((k
k2,v
v2):TMap k v
ys)
| k
k1 k -> k -> Bool
forall a. Ord a => a -> a -> Bool
< k
k2 = (k
k1,v
v1) (k, v) -> TMap k v -> TMap k v
forall a. a -> [a] -> [a]
: (v -> v -> v) -> TMap k v -> TMap k v -> TMap k v
forall k v.
Ord k =>
(v -> v -> v) -> TMap k v -> TMap k v -> TMap k v
addTMaps v -> v -> v
f TMap k v
xs ((k
k2,v
v2)(k, v) -> TMap k v -> TMap k v
forall a. a -> [a] -> [a]
:TMap k v
ys)
| k
k2 k -> k -> Bool
forall a. Ord a => a -> a -> Bool
< k
k1 = (k
k2,v
v2) (k, v) -> TMap k v -> TMap k v
forall a. a -> [a] -> [a]
: (v -> v -> v) -> TMap k v -> TMap k v -> TMap k v
forall k v.
Ord k =>
(v -> v -> v) -> TMap k v -> TMap k v -> TMap k v
addTMaps v -> v -> v
f ((k
k1,v
v1)(k, v) -> TMap k v -> TMap k v
forall a. a -> [a] -> [a]
:TMap k v
xs) TMap k v
ys
| k
k1 k -> k -> Bool
forall a. Eq a => a -> a -> Bool
== k
k2 = (k
k1, v -> v -> v
f v
v1 v
v2) (k, v) -> TMap k v -> TMap k v
forall a. a -> [a] -> [a]
: (v -> v -> v) -> TMap k v -> TMap k v -> TMap k v
forall k v.
Ord k =>
(v -> v -> v) -> TMap k v -> TMap k v -> TMap k v
addTMaps v -> v -> v
f TMap k v
xs TMap k v
ys
mapTMap :: (v -> v') -> TMap k v -> TMap k v'
mapTMap :: (v -> v') -> TMap k v -> TMap k v'
mapTMap v -> v'
f = ((k, v) -> (k, v')) -> TMap k v -> TMap k v'
forall a b. (a -> b) -> [a] -> [b]
map (\(k
k,v
v) -> (k
k,v -> v'
f v
v))
filterTMap :: (v -> Bool) -> TMap k v -> TMap k v
filterTMap :: (v -> Bool) -> TMap k v -> TMap k v
filterTMap v -> Bool
f = ((k, v) -> Bool) -> TMap k v -> TMap k v
forall a. (a -> Bool) -> [a] -> [a]
filter (\(k
_,v
v) -> v -> Bool
f v
v)
data Tensor n k v where
Scalar :: v -> Tensor 0 k v
Tensor :: TMap k (Tensor n k v) -> Tensor (n+1) k v
ZeroTensor :: Tensor n k v
type Tensor2 n1 n2 k v = Tensor n1 k (Tensor n2 k v)
type AbsTensor1 n1 k1 v = Tensor n1 k1 v
type AbsTensor2 n1 n2 k1 v = Tensor2 n1 n2 k1 v
type AbsTensor3 n1 n2 n3 k1 k2 v = AbsTensor2 n1 n2 k1 (Tensor n3 k2 v)
type AbsTensor4 n1 n2 n3 n4 k1 k2 v = AbsTensor2 n1 n2 k1 (Tensor2 n3 n4 k2 v)
type AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v = AbsTensor4 n1 n2 n3 n4 k1 k2 (Tensor n5 k3 v)
type AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v = AbsTensor4 n1 n2 n3 n4 k1 k2 (Tensor2 n5 n6 k3 v)
type AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v = AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (Tensor n7 k4 v)
type AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v = AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (Tensor2 n7 n8 k4 v)
type STTens n1 n2 v = AbsTensor2 n1 n2 Ind3 v
type ATens n1 n2 n3 n4 n5 n6 v = AbsTensor6 n1 n2 n3 n4 n5 n6 Ind20 Ind9 Ind3 v
data TensorRep k v = ScalarR v | TensorR Natural (TMap k (TensorRep k v)) | ZeroR Natural deriving (Int -> TensorRep k v -> ShowS
[TensorRep k v] -> ShowS
TensorRep k v -> String
(Int -> TensorRep k v -> ShowS)
-> (TensorRep k v -> String)
-> ([TensorRep k v] -> ShowS)
-> Show (TensorRep k v)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall k v. (Show v, Show k) => Int -> TensorRep k v -> ShowS
forall k v. (Show v, Show k) => [TensorRep k v] -> ShowS
forall k v. (Show v, Show k) => TensorRep k v -> String
showList :: [TensorRep k v] -> ShowS
$cshowList :: forall k v. (Show v, Show k) => [TensorRep k v] -> ShowS
show :: TensorRep k v -> String
$cshow :: forall k v. (Show v, Show k) => TensorRep k v -> String
showsPrec :: Int -> TensorRep k v -> ShowS
$cshowsPrec :: forall k v. (Show v, Show k) => Int -> TensorRep k v -> ShowS
Show, (forall x. TensorRep k v -> Rep (TensorRep k v) x)
-> (forall x. Rep (TensorRep k v) x -> TensorRep k v)
-> Generic (TensorRep k v)
forall x. Rep (TensorRep k v) x -> TensorRep k v
forall x. TensorRep k v -> Rep (TensorRep k v) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall k v x. Rep (TensorRep k v) x -> TensorRep k v
forall k v x. TensorRep k v -> Rep (TensorRep k v) x
$cto :: forall k v x. Rep (TensorRep k v) x -> TensorRep k v
$cfrom :: forall k v x. TensorRep k v -> Rep (TensorRep k v) x
Generic, Get (TensorRep k v)
Putter (TensorRep k v)
Putter (TensorRep k v)
-> Get (TensorRep k v) -> Serialize (TensorRep k v)
forall t. Putter t -> Get t -> Serialize t
forall k v. (Serialize v, Serialize k) => Get (TensorRep k v)
forall k v. (Serialize v, Serialize k) => Putter (TensorRep k v)
get :: Get (TensorRep k v)
$cget :: forall k v. (Serialize v, Serialize k) => Get (TensorRep k v)
put :: Putter (TensorRep k v)
$cput :: forall k v. (Serialize v, Serialize k) => Putter (TensorRep k v)
Serialize)
toRep :: forall n k v. KnownNat n => Tensor n k v -> TensorRep k v
toRep :: Tensor n k v -> TensorRep k v
toRep (Scalar v
v) = v -> TensorRep k v
forall k v. v -> TensorRep k v
ScalarR v
v
toRep (Tensor TMap k (Tensor n k v)
m) = case Proxy n -> IsZero n
forall (n :: Nat). KnownNat n => Proxy n -> IsZero n
isZero (Proxy n
forall k (t :: k). Proxy t
Proxy @n) of
IsZero n
NonZero -> let r :: Natural
r = Integer -> Natural
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Integer -> Natural) -> Integer -> Natural
forall a b. (a -> b) -> a -> b
$ Proxy n -> Integer
forall (n :: Nat) (proxy :: Nat -> *).
KnownNat n =>
proxy n -> Integer
GHC.TypeLits.natVal (Proxy n
forall k (t :: k). Proxy t
Proxy @n)
in Natural -> TMap k (TensorRep k v) -> TensorRep k v
forall k v. Natural -> TMap k (TensorRep k v) -> TensorRep k v
TensorR Natural
r (TMap k (TensorRep k v) -> TensorRep k v)
-> TMap k (TensorRep k v) -> TensorRep k v
forall a b. (a -> b) -> a -> b
$ (Tensor n k v -> TensorRep k v)
-> TMap k (Tensor n k v) -> TMap k (TensorRep k v)
forall v v' k. (v -> v') -> TMap k v -> TMap k v'
mapTMap (\(t :: Tensor (n-1) k v) -> Tensor n k v -> TensorRep k v
forall (n :: Nat) k v. KnownNat n => Tensor n k v -> TensorRep k v
toRep Tensor n k v
Tensor (n - 1) k v
t) TMap k (Tensor n k v)
m
toRep Tensor n k v
ZeroTensor = let r :: Natural
r = Integer -> Natural
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Integer -> Natural) -> Integer -> Natural
forall a b. (a -> b) -> a -> b
$ Proxy n -> Integer
forall (n :: Nat) (proxy :: Nat -> *).
KnownNat n =>
proxy n -> Integer
GHC.TypeLits.natVal (Proxy n
forall k (t :: k). Proxy t
Proxy @n)
in Natural -> TensorRep k v
forall k v. Natural -> TensorRep k v
ZeroR Natural
r
fromRep :: forall n k v. KnownNat n => TensorRep k v -> Maybe (Tensor n k v)
fromRep :: TensorRep k v -> Maybe (Tensor n k v)
fromRep (ScalarR v
v) = case Proxy n -> IsZero n
forall (n :: Nat). KnownNat n => Proxy n -> IsZero n
isZero (Proxy n
forall k (t :: k). Proxy t
Proxy @n)
of IsZero n
Zero -> Tensor 0 k v -> Maybe (Tensor 0 k v)
forall a. a -> Maybe a
Just (v -> Tensor 0 k v
forall v k. v -> Tensor 0 k v
Scalar v
v)
IsZero n
NonZero -> Maybe (Tensor n k v)
forall a. Maybe a
Nothing
fromRep (TensorR Natural
r TMap k (TensorRep k v)
m) = case Integer -> Maybe SomeNat
someNatVal (Natural -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral Natural
r) of
Maybe SomeNat
Nothing -> Maybe (Tensor n k v)
forall a. Maybe a
Nothing
Just SomeNat
l -> case SomeNat
l of
SomeNat (Proxy n
x' :: Proxy x) ->
case Proxy n -> IsZero n
forall (n :: Nat). KnownNat n => Proxy n -> IsZero n
isZero Proxy n
x' of
IsZero n
Zero -> Maybe (Tensor n k v)
forall a. Maybe a
Nothing
IsZero n
NonZero -> case Proxy n -> Proxy n -> Maybe (n :~: n)
forall (a :: Nat) (b :: Nat).
(KnownNat a, KnownNat b) =>
Proxy a -> Proxy b -> Maybe (a :~: b)
sameNat Proxy n
x' (Proxy n
forall k (t :: k). Proxy t
Proxy @n) of
Maybe (n :~: n)
Nothing -> Maybe (Tensor n k v)
forall a. Maybe a
Nothing
Just n :~: n
Refl -> let tMap' :: TMap k (Maybe (Tensor (n - 1) k v))
tMap' = (TensorRep k v -> Maybe (Tensor (n - 1) k v))
-> TMap k (TensorRep k v) -> TMap k (Maybe (Tensor (n - 1) k v))
forall v v' k. (v -> v') -> TMap k v -> TMap k v'
mapTMap (\TensorRep k v
t -> TensorRep k v -> Maybe (Tensor (n - 1) k v)
forall (n :: Nat) k v.
KnownNat n =>
TensorRep k v -> Maybe (Tensor n k v)
fromRep TensorRep k v
t :: Maybe (Tensor (x-1) k v)) TMap k (TensorRep k v)
m
tMap'' :: TMap k (Maybe (Tensor (n - 1) k v))
tMap'' = (Maybe (Tensor (n - 1) k v) -> Bool)
-> TMap k (Maybe (Tensor (n - 1) k v))
-> TMap k (Maybe (Tensor (n - 1) k v))
forall v k. (v -> Bool) -> TMap k v -> TMap k v
filterTMap (\case Maybe (Tensor (n - 1) k v)
Nothing -> Bool
False
Maybe (Tensor (n - 1) k v)
_ -> Bool
True) TMap k (Maybe (Tensor (n - 1) k v))
tMap'
tMap''' :: TMap k (Tensor (n - 1) k v)
tMap''' = (Maybe (Tensor (n - 1) k v) -> Tensor (n - 1) k v)
-> TMap k (Maybe (Tensor (n - 1) k v))
-> TMap k (Tensor (n - 1) k v)
forall v v' k. (v -> v') -> TMap k v -> TMap k v'
mapTMap (\(Just Tensor (n - 1) k v
t) -> Tensor (n - 1) k v
t) TMap k (Maybe (Tensor (n - 1) k v))
tMap''
in case TMap k (Tensor (n - 1) k v)
tMap''' of
[] -> Maybe (Tensor n k v)
forall a. Maybe a
Nothing
TMap k (Tensor (n - 1) k v)
_ -> Tensor n k v -> Maybe (Tensor n k v)
forall a. a -> Maybe a
Just (Tensor n k v -> Maybe (Tensor n k v))
-> Tensor n k v -> Maybe (Tensor n k v)
forall a b. (a -> b) -> a -> b
$ TMap k (Tensor (n - 1) k v) -> Tensor ((n - 1) + 1) k v
forall k (n :: Nat) v. TMap k (Tensor n k v) -> Tensor (n + 1) k v
Tensor TMap k (Tensor (n - 1) k v)
tMap'''
fromRep (ZeroR Natural
r) = case Integer -> Maybe SomeNat
someNatVal (Natural -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral Natural
r)
of Just SomeNat
_ -> Tensor n k v -> Maybe (Tensor n k v)
forall a. a -> Maybe a
Just Tensor n k v
forall (n :: Nat) k v. Tensor n k v
ZeroTensor
Maybe SomeNat
Nothing -> Maybe (Tensor n k v)
forall a. Maybe a
Nothing
instance (NFData k, NFData v) => NFData (Tensor n k v) where
rnf :: Tensor n k v -> ()
rnf Tensor n k v
ZeroTensor = ()
rnf (Scalar v
v) = v
v v -> () -> ()
`seq` v -> ()
forall a. NFData a => a -> ()
rnf v
v
rnf (Tensor TMap k (Tensor n k v)
m) = TMap k (Tensor n k v)
m TMap k (Tensor n k v) -> () -> ()
`seq` TMap k (Tensor n k v) -> ()
forall a. NFData a => a -> ()
rnf TMap k (Tensor n k v)
m
instance KnownNat n => Generic (Tensor n k v) where
type Rep (Tensor n k v) = Rep (TensorRep k v)
from :: Tensor n k v -> Rep (Tensor n k v) x
from = TensorRep k v
-> D1
('MetaData
"TensorRep"
"Math.Tensor"
"sparse-tensor-0.2.1.5-3CdX3VcGAZ9BsyqgSOIuRL"
'False)
(C1
('MetaCons "ScalarR" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 v))
:+: (C1
('MetaCons "TensorR" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 Natural)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 (TMap k (TensorRep k v))))
:+: C1
('MetaCons "ZeroR" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 Natural))))
x
forall a x. Generic a => a -> Rep a x
from (TensorRep k v
-> D1
('MetaData
"TensorRep"
"Math.Tensor"
"sparse-tensor-0.2.1.5-3CdX3VcGAZ9BsyqgSOIuRL"
'False)
(C1
('MetaCons "ScalarR" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 v))
:+: (C1
('MetaCons "TensorR" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 Natural)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 (TMap k (TensorRep k v))))
:+: C1
('MetaCons "ZeroR" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 Natural))))
x)
-> (Tensor n k v -> TensorRep k v)
-> Tensor n k v
-> D1
('MetaData
"TensorRep"
"Math.Tensor"
"sparse-tensor-0.2.1.5-3CdX3VcGAZ9BsyqgSOIuRL"
'False)
(C1
('MetaCons "ScalarR" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 v))
:+: (C1
('MetaCons "TensorR" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 Natural)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 (TMap k (TensorRep k v))))
:+: C1
('MetaCons "ZeroR" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 Natural))))
x
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Tensor n k v -> TensorRep k v
forall (n :: Nat) k v. KnownNat n => Tensor n k v -> TensorRep k v
toRep
to :: Rep (Tensor n k v) x -> Tensor n k v
to = \case
Maybe (Tensor n k v)
Nothing -> String -> Tensor n k v
forall a. HasCallStack => String -> a
error String
"Could not reconstruct tensor from representation."
Just Tensor n k v
t -> Tensor n k v
t
(Maybe (Tensor n k v) -> Tensor n k v)
-> (M1
D
('MetaData
"TensorRep"
"Math.Tensor"
"sparse-tensor-0.2.1.5-3CdX3VcGAZ9BsyqgSOIuRL"
'False)
(C1
('MetaCons "ScalarR" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 v))
:+: (C1
('MetaCons "TensorR" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 Natural)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 (TMap k (TensorRep k v))))
:+: C1
('MetaCons "ZeroR" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 Natural))))
x
-> Maybe (Tensor n k v))
-> M1
D
('MetaData
"TensorRep"
"Math.Tensor"
"sparse-tensor-0.2.1.5-3CdX3VcGAZ9BsyqgSOIuRL"
'False)
(C1
('MetaCons "ScalarR" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 v))
:+: (C1
('MetaCons "TensorR" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 Natural)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 (TMap k (TensorRep k v))))
:+: C1
('MetaCons "ZeroR" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 Natural))))
x
-> Tensor n k v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TensorRep k v -> Maybe (Tensor n k v)
forall (n :: Nat) k v.
KnownNat n =>
TensorRep k v -> Maybe (Tensor n k v)
fromRep (TensorRep k v -> Maybe (Tensor n k v))
-> (M1
D
('MetaData
"TensorRep"
"Math.Tensor"
"sparse-tensor-0.2.1.5-3CdX3VcGAZ9BsyqgSOIuRL"
'False)
(C1
('MetaCons "ScalarR" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 v))
:+: (C1
('MetaCons "TensorR" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 Natural)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 (TMap k (TensorRep k v))))
:+: C1
('MetaCons "ZeroR" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 Natural))))
x
-> TensorRep k v)
-> M1
D
('MetaData
"TensorRep"
"Math.Tensor"
"sparse-tensor-0.2.1.5-3CdX3VcGAZ9BsyqgSOIuRL"
'False)
(C1
('MetaCons "ScalarR" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 v))
:+: (C1
('MetaCons "TensorR" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 Natural)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 (TMap k (TensorRep k v))))
:+: C1
('MetaCons "ZeroR" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 Natural))))
x
-> Maybe (Tensor n k v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. M1
D
('MetaData
"TensorRep"
"Math.Tensor"
"sparse-tensor-0.2.1.5-3CdX3VcGAZ9BsyqgSOIuRL"
'False)
(C1
('MetaCons "ScalarR" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 v))
:+: (C1
('MetaCons "TensorR" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 Natural)
:*: S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 (TMap k (TensorRep k v))))
:+: C1
('MetaCons "ZeroR" 'PrefixI 'False)
(S1
('MetaSel
'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
(Rec0 Natural))))
x
-> TensorRep k v
forall a x. Generic a => Rep a x -> a
to
deriving instance (KnownNat n, Ord k, Serialize k, Serialize v) => Serialize (Tensor n k v)
instance Functor (Tensor n k) where
fmap :: (a -> b) -> Tensor n k a -> Tensor n k b
fmap a -> b
f (Scalar a
x) = b -> Tensor 0 k b
forall v k. v -> Tensor 0 k v
Scalar (a -> b
f a
x)
fmap a -> b
f (Tensor TMap k (Tensor n k a)
m) = TMap k (Tensor n k b) -> Tensor (n + 1) k b
forall k (n :: Nat) v. TMap k (Tensor n k v) -> Tensor (n + 1) k v
Tensor ((Tensor n k a -> Tensor n k b)
-> TMap k (Tensor n k a) -> TMap k (Tensor n k b)
forall v v' k. (v -> v') -> TMap k v -> TMap k v'
mapTMap ((a -> b) -> Tensor n k a -> Tensor n k b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
f) TMap k (Tensor n k a)
m)
fmap a -> b
_ Tensor n k a
ZeroTensor = Tensor n k b
forall (n :: Nat) k v. Tensor n k v
ZeroTensor
deriving instance (Show a, Show k) => Show (Tensor n k a)
deriving instance (Eq a, Eq k) => Eq (Tensor n k a)
getTensorMap :: forall n k v.(1 <= n) => Tensor n k v -> TMap k (Tensor (n-1) k v)
getTensorMap :: Tensor n k v -> TMap k (Tensor (n - 1) k v)
getTensorMap (Tensor TMap k (Tensor n k v)
m) = TMap k (Tensor n k v)
TMap k (Tensor (n - 1) k v)
m
getTensorMap Tensor n k v
ZeroTensor = []
toMatListT1' :: (TIndex k1, TAdd a) => AbsTensor1 n1 k1 (AnsVar a) -> [((Int,Int),a)]
toMatListT1' :: AbsTensor1 n1 k1 (AnsVar a) -> [((Int, Int), a)]
toMatListT1' = [[(Int, a)]] -> [((Int, Int), a)]
forall a. [[(Int, a)]] -> [((Int, Int), a)]
collectMatList ([[(Int, a)]] -> [((Int, Int), a)])
-> (AbsTensor1 n1 k1 (AnsVar a) -> [[(Int, a)]])
-> AbsTensor1 n1 k1 (AnsVar a)
-> [((Int, Int), a)]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AbsTensor1 n1 k1 (AnsVar a) -> [[(Int, a)]]
forall k1 a (n1 :: Nat).
(TIndex k1, TAdd a) =>
AbsTensor1 n1 k1 (AnsVar a) -> [[(Int, a)]]
toMatList1'
toMatListT2' :: (TIndex k1, TAdd a) => AbsTensor2 n1 n2 k1 (AnsVar a) -> [((Int,Int),a)]
toMatListT2' :: AbsTensor2 n1 n2 k1 (AnsVar a) -> [((Int, Int), a)]
toMatListT2' = [[(Int, a)]] -> [((Int, Int), a)]
forall a. [[(Int, a)]] -> [((Int, Int), a)]
collectMatList ([[(Int, a)]] -> [((Int, Int), a)])
-> (AbsTensor2 n1 n2 k1 (AnsVar a) -> [[(Int, a)]])
-> AbsTensor2 n1 n2 k1 (AnsVar a)
-> [((Int, Int), a)]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AbsTensor2 n1 n2 k1 (AnsVar a) -> [[(Int, a)]]
forall k1 a (n1 :: Nat) (n2 :: Nat).
(TIndex k1, TAdd a) =>
AbsTensor2 n1 n2 k1 (AnsVar a) -> [[(Int, a)]]
toMatList2'
toMatListT3' :: (TIndex k1, TIndex k2, TAdd a) => AbsTensor3 n1 n2 n3 k1 k2 (AnsVar a) -> [((Int,Int),a)]
toMatListT3' :: AbsTensor3 n1 n2 n3 k1 k2 (AnsVar a) -> [((Int, Int), a)]
toMatListT3' = [[(Int, a)]] -> [((Int, Int), a)]
forall a. [[(Int, a)]] -> [((Int, Int), a)]
collectMatList ([[(Int, a)]] -> [((Int, Int), a)])
-> (AbsTensor3 n1 n2 n3 k1 k2 (AnsVar a) -> [[(Int, a)]])
-> AbsTensor3 n1 n2 n3 k1 k2 (AnsVar a)
-> [((Int, Int), a)]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AbsTensor3 n1 n2 n3 k1 k2 (AnsVar a) -> [[(Int, a)]]
forall k1 k2 a (n1 :: Nat) (n2 :: Nat) (n3 :: Nat).
(TIndex k1, TIndex k2, TAdd a) =>
AbsTensor3 n1 n2 n3 k1 k2 (AnsVar a) -> [[(Int, a)]]
toMatList3'
toMatListT4' :: (TIndex k1, TIndex k2, TAdd a) => AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar a) -> [((Int,Int),a)]
toMatListT4' :: AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar a) -> [((Int, Int), a)]
toMatListT4' = [[(Int, a)]] -> [((Int, Int), a)]
forall a. [[(Int, a)]] -> [((Int, Int), a)]
collectMatList ([[(Int, a)]] -> [((Int, Int), a)])
-> (AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar a) -> [[(Int, a)]])
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar a)
-> [((Int, Int), a)]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar a) -> [[(Int, a)]]
forall k1 k2 a (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat).
(TIndex k1, TIndex k2, TAdd a) =>
AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar a) -> [[(Int, a)]]
toMatList4'
toMatListT5' :: (TIndex k1, TIndex k2, TIndex k3, TAdd a) => AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar a) -> [((Int,Int),a)]
toMatListT5' :: AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar a) -> [((Int, Int), a)]
toMatListT5' = [[(Int, a)]] -> [((Int, Int), a)]
forall a. [[(Int, a)]] -> [((Int, Int), a)]
collectMatList ([[(Int, a)]] -> [((Int, Int), a)])
-> (AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar a) -> [[(Int, a)]])
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar a)
-> [((Int, Int), a)]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar a) -> [[(Int, a)]]
forall k1 k2 k3 a (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd a) =>
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar a) -> [[(Int, a)]]
toMatList5'
toMatListT6' :: (TIndex k1, TIndex k2, TIndex k3, TAdd a) => AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar a) -> [((Int,Int),a)]
toMatListT6' :: AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar a)
-> [((Int, Int), a)]
toMatListT6' = [[(Int, a)]] -> [((Int, Int), a)]
forall a. [[(Int, a)]] -> [((Int, Int), a)]
collectMatList ([[(Int, a)]] -> [((Int, Int), a)])
-> (AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar a)
-> [[(Int, a)]])
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar a)
-> [((Int, Int), a)]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar a) -> [[(Int, a)]]
forall k1 k2 k3 a (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd a) =>
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar a) -> [[(Int, a)]]
toMatList6'
toMatListT7' :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd a) => AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar a) -> [((Int,Int),a)]
toMatListT7' :: AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar a)
-> [((Int, Int), a)]
toMatListT7' = [[(Int, a)]] -> [((Int, Int), a)]
forall a. [[(Int, a)]] -> [((Int, Int), a)]
collectMatList ([[(Int, a)]] -> [((Int, Int), a)])
-> (AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar a)
-> [[(Int, a)]])
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar a)
-> [((Int, Int), a)]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar a)
-> [[(Int, a)]]
forall k1 k2 k3 k4 a (n1 :: Nat) (n2 :: Nat) (n3 :: Nat)
(n4 :: Nat) (n5 :: Nat) (n6 :: Nat) (n7 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd a) =>
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar a)
-> [[(Int, a)]]
toMatList7'
toMatListT8' :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd a) => AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar a) -> [((Int,Int),a)]
toMatListT8' :: AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar a)
-> [((Int, Int), a)]
toMatListT8' = [[(Int, a)]] -> [((Int, Int), a)]
forall a. [[(Int, a)]] -> [((Int, Int), a)]
collectMatList ([[(Int, a)]] -> [((Int, Int), a)])
-> (AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar a)
-> [[(Int, a)]])
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar a)
-> [((Int, Int), a)]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar a)
-> [[(Int, a)]]
forall k1 k2 k3 k4 a (n1 :: Nat) (n2 :: Nat) (n3 :: Nat)
(n4 :: Nat) (n5 :: Nat) (n6 :: Nat) (n7 :: Nat) (n8 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd a) =>
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar a)
-> [[(Int, a)]]
toMatList8'
toMatrixT1' :: (TIndex k1, Real a) => AbsTensor1 n1 k1 (AnsVar (SField a)) -> HM.Matrix Double
toMatrixT1' :: AbsTensor1 n1 k1 (AnsVar (SField a)) -> Matrix Double
toMatrixT1' = [((Int, Int), SField a)] -> Matrix Double
forall a. Real a => [((Int, Int), SField a)] -> Matrix Double
assocsToMatrix ([((Int, Int), SField a)] -> Matrix Double)
-> (AbsTensor1 n1 k1 (AnsVar (SField a))
-> [((Int, Int), SField a)])
-> AbsTensor1 n1 k1 (AnsVar (SField a))
-> Matrix Double
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AbsTensor1 n1 k1 (AnsVar (SField a)) -> [((Int, Int), SField a)]
forall k1 a (n1 :: Nat).
(TIndex k1, TAdd a) =>
AbsTensor1 n1 k1 (AnsVar a) -> [((Int, Int), a)]
toMatListT1'
toMatrixT2' :: (TIndex k1, Real a) => AbsTensor2 n1 n2 k1 (AnsVar (SField a)) -> HM.Matrix Double
toMatrixT2' :: AbsTensor2 n1 n2 k1 (AnsVar (SField a)) -> Matrix Double
toMatrixT2' = [((Int, Int), SField a)] -> Matrix Double
forall a. Real a => [((Int, Int), SField a)] -> Matrix Double
assocsToMatrix ([((Int, Int), SField a)] -> Matrix Double)
-> (AbsTensor2 n1 n2 k1 (AnsVar (SField a))
-> [((Int, Int), SField a)])
-> AbsTensor2 n1 n2 k1 (AnsVar (SField a))
-> Matrix Double
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AbsTensor2 n1 n2 k1 (AnsVar (SField a)) -> [((Int, Int), SField a)]
forall k1 a (n1 :: Nat) (n2 :: Nat).
(TIndex k1, TAdd a) =>
AbsTensor2 n1 n2 k1 (AnsVar a) -> [((Int, Int), a)]
toMatListT2'
toMatrixT3' :: (TIndex k1, TIndex k2, Real a) => AbsTensor3 n1 n2 n3 k1 k2 (AnsVar (SField a)) -> HM.Matrix Double
toMatrixT3' :: AbsTensor3 n1 n2 n3 k1 k2 (AnsVar (SField a)) -> Matrix Double
toMatrixT3' = [((Int, Int), SField a)] -> Matrix Double
forall a. Real a => [((Int, Int), SField a)] -> Matrix Double
assocsToMatrix ([((Int, Int), SField a)] -> Matrix Double)
-> (AbsTensor3 n1 n2 n3 k1 k2 (AnsVar (SField a))
-> [((Int, Int), SField a)])
-> AbsTensor3 n1 n2 n3 k1 k2 (AnsVar (SField a))
-> Matrix Double
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AbsTensor3 n1 n2 n3 k1 k2 (AnsVar (SField a))
-> [((Int, Int), SField a)]
forall k1 k2 a (n1 :: Nat) (n2 :: Nat) (n3 :: Nat).
(TIndex k1, TIndex k2, TAdd a) =>
AbsTensor3 n1 n2 n3 k1 k2 (AnsVar a) -> [((Int, Int), a)]
toMatListT3'
toMatrixT4' :: (TIndex k1, TIndex k2, Real a) => AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar (SField a)) -> HM.Matrix Double
toMatrixT4' :: AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar (SField a)) -> Matrix Double
toMatrixT4' = [((Int, Int), SField a)] -> Matrix Double
forall a. Real a => [((Int, Int), SField a)] -> Matrix Double
assocsToMatrix ([((Int, Int), SField a)] -> Matrix Double)
-> (AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar (SField a))
-> [((Int, Int), SField a)])
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar (SField a))
-> Matrix Double
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar (SField a))
-> [((Int, Int), SField a)]
forall k1 k2 a (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat).
(TIndex k1, TIndex k2, TAdd a) =>
AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar a) -> [((Int, Int), a)]
toMatListT4'
toMatrixT5' :: (TIndex k1, TIndex k2, TIndex k3, Real a) => AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar (SField a)) -> HM.Matrix Double
toMatrixT5' :: AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar (SField a))
-> Matrix Double
toMatrixT5' = [((Int, Int), SField a)] -> Matrix Double
forall a. Real a => [((Int, Int), SField a)] -> Matrix Double
assocsToMatrix ([((Int, Int), SField a)] -> Matrix Double)
-> (AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar (SField a))
-> [((Int, Int), SField a)])
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar (SField a))
-> Matrix Double
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar (SField a))
-> [((Int, Int), SField a)]
forall k1 k2 k3 a (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd a) =>
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar a) -> [((Int, Int), a)]
toMatListT5'
toMatrixT6' :: (TIndex k1, TIndex k2, TIndex k3, Real a) => AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar (SField a)) -> HM.Matrix Double
toMatrixT6' :: AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar (SField a))
-> Matrix Double
toMatrixT6' = [((Int, Int), SField a)] -> Matrix Double
forall a. Real a => [((Int, Int), SField a)] -> Matrix Double
assocsToMatrix ([((Int, Int), SField a)] -> Matrix Double)
-> (AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar (SField a))
-> [((Int, Int), SField a)])
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar (SField a))
-> Matrix Double
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar (SField a))
-> [((Int, Int), SField a)]
forall k1 k2 k3 a (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd a) =>
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar a)
-> [((Int, Int), a)]
toMatListT6'
toMatrixT7' :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, Real a) => AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar (SField a)) -> HM.Matrix Double
toMatrixT7' :: AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar (SField a))
-> Matrix Double
toMatrixT7' = [((Int, Int), SField a)] -> Matrix Double
forall a. Real a => [((Int, Int), SField a)] -> Matrix Double
assocsToMatrix ([((Int, Int), SField a)] -> Matrix Double)
-> (AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar (SField a))
-> [((Int, Int), SField a)])
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar (SField a))
-> Matrix Double
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar (SField a))
-> [((Int, Int), SField a)]
forall k1 k2 k3 k4 a (n1 :: Nat) (n2 :: Nat) (n3 :: Nat)
(n4 :: Nat) (n5 :: Nat) (n6 :: Nat) (n7 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd a) =>
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar a)
-> [((Int, Int), a)]
toMatListT7'
toMatrixT8' :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, Real a) => AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar (SField a)) -> HM.Matrix Double
toMatrixT8' :: AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar (SField a))
-> Matrix Double
toMatrixT8' = [((Int, Int), SField a)] -> Matrix Double
forall a. Real a => [((Int, Int), SField a)] -> Matrix Double
assocsToMatrix ([((Int, Int), SField a)] -> Matrix Double)
-> (AbsTensor8
n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar (SField a))
-> [((Int, Int), SField a)])
-> AbsTensor8
n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar (SField a))
-> Matrix Double
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar (SField a))
-> [((Int, Int), SField a)]
forall k1 k2 k3 k4 a (n1 :: Nat) (n2 :: Nat) (n3 :: Nat)
(n4 :: Nat) (n5 :: Nat) (n6 :: Nat) (n7 :: Nat) (n8 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd a) =>
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar a)
-> [((Int, Int), a)]
toMatListT8'
mkTens :: (IndList n k, v) -> Tensor n k v
mkTens :: (IndList n k, v) -> Tensor n k v
mkTens (IndList n k
Empty, v
a) = v -> Tensor 0 k v
forall v k. v -> Tensor 0 k v
Scalar v
a
mkTens (Append k
x IndList (n - 1) k
xs, v
a) = TMap k (Tensor (n - 1) k v) -> Tensor ((n - 1) + 1) k v
forall k (n :: Nat) v. TMap k (Tensor n k v) -> Tensor (n + 1) k v
Tensor [(k
x, (IndList (n - 1) k, v) -> Tensor (n - 1) k v
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList (n - 1) k
xs, v
a))]
fromListT :: (TIndex k, TAdd v) => [(IndList n k, v)] -> Tensor n k v
fromListT :: [(IndList n k, v)] -> Tensor n k v
fromListT [(IndList n k, v)
x] = (IndList n k, v) -> Tensor n k v
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n k, v)
x
fromListT ((IndList n k, v)
x:[(IndList n k, v)]
xs) = ((IndList n k, v) -> Tensor n k v -> Tensor n k v)
-> Tensor n k v -> [(IndList n k, v)] -> Tensor n k v
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr (IndList n k, v) -> Tensor n k v -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(IndList n k, v) -> Tensor n k v -> Tensor n k v
insertOrAdd ((IndList n k, v) -> Tensor n k v
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n k, v)
x) [(IndList n k, v)]
xs
fromListT [] = Tensor n k v
forall (n :: Nat) k v. Tensor n k v
ZeroTensor
fromListT' :: forall n k v. (TIndex k, TAdd v, KnownNat n) => [([k],v)] -> Tensor n k v
fromListT' :: [([k], v)] -> Tensor n k v
fromListT' [([k], v)]
l = [(IndList n k, v)] -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[(IndList n k, v)] -> Tensor n k v
fromListT [(IndList n k, v)]
indList
where
indList :: [(IndList n k, v)]
indList = (([k], v) -> (IndList n k, v)) -> [([k], v)] -> [(IndList n k, v)]
forall a b. (a -> b) -> [a] -> [b]
map (\([k]
x,v
y) -> ([k] -> IndList n k
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k]
x, v
y)) [([k], v)]
l
fromListT1 :: (TIndex k1, TAdd v) => [(IndTuple1 n1 k1, v)] -> AbsTensor1 n1 k1 v
fromListT1 :: [(IndTuple1 n1 k1, v)] -> AbsTensor1 n1 k1 v
fromListT1 = [(IndTuple1 n1 k1, v)] -> AbsTensor1 n1 k1 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[(IndList n k, v)] -> Tensor n k v
fromListT
fromListT1' :: forall n1 k1 v. (KnownNat n1, TIndex k1, TAdd v) => [([k1],v)] -> AbsTensor1 n1 k1 v
fromListT1' :: [([k1], v)] -> AbsTensor1 n1 k1 v
fromListT1' = [([k1], v)] -> AbsTensor1 n1 k1 v
forall (n :: Nat) k v.
(TIndex k, TAdd v, KnownNat n) =>
[([k], v)] -> Tensor n k v
fromListT'
fromListT2 :: (TIndex k1, TAdd v) => [(IndTuple2 n1 n2 k1, v)] -> AbsTensor2 n1 n2 k1 v
fromListT2 :: [(IndTuple2 n1 n2 k1, v)] -> AbsTensor2 n1 n2 k1 v
fromListT2 [(IndTuple2 n1 n2 k1, v)]
l = (AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v)
-> AbsTensor2 n1 n2 k1 v
-> [AbsTensor2 n1 n2 k1 v]
-> AbsTensor2 n1 n2 k1 v
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
Tensor n k v -> Tensor n k v -> Tensor n k v
(&+) AbsTensor2 n1 n2 k1 v
forall (n :: Nat) k v. Tensor n k v
ZeroTensor [AbsTensor2 n1 n2 k1 v]
tensList
where
tensList :: [AbsTensor2 n1 n2 k1 v]
tensList = ((IndTuple2 n1 n2 k1, v) -> AbsTensor2 n1 n2 k1 v)
-> [(IndTuple2 n1 n2 k1, v)] -> [AbsTensor2 n1 n2 k1 v]
forall a b. (a -> b) -> [a] -> [b]
map (IndTuple2 n1 n2 k1, v) -> AbsTensor2 n1 n2 k1 v
forall (n1 :: Nat) (n2 :: Nat) k1 v.
(IndTuple2 n1 n2 k1, v) -> AbsTensor2 n1 n2 k1 v
mkTens2 [(IndTuple2 n1 n2 k1, v)]
l
fromListT2' :: forall n1 n2 k1 v. (KnownNat n1, KnownNat n2, TIndex k1, TAdd v) => [(([k1],[k1]),v)] -> AbsTensor2 n1 n2 k1 v
fromListT2' :: [(([k1], [k1]), v)] -> AbsTensor2 n1 n2 k1 v
fromListT2' [(([k1], [k1]), v)]
l = [(IndTuple2 n1 n2 k1, v)] -> AbsTensor2 n1 n2 k1 v
forall k1 v (n1 :: Nat) (n2 :: Nat).
(TIndex k1, TAdd v) =>
[(IndTuple2 n1 n2 k1, v)] -> AbsTensor2 n1 n2 k1 v
fromListT2 [(IndTuple2 n1 n2 k1, v)]
indList
where
indList :: [(IndTuple2 n1 n2 k1, v)]
indList = ((([k1], [k1]), v) -> (IndTuple2 n1 n2 k1, v))
-> [(([k1], [k1]), v)] -> [(IndTuple2 n1 n2 k1, v)]
forall a b. (a -> b) -> [a] -> [b]
map (\(([k1]
x1,[k1]
x2),v
y) -> (([k1] -> IndList n1 k1
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k1]
x1, [k1] -> IndList n2 k1
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k1]
x2),v
y)) [(([k1], [k1]), v)]
l
fromListT3 :: (TIndex k1, TIndex k2, TAdd v) => [(IndTuple3 n1 n2 n3 k1 k2, v)] -> AbsTensor3 n1 n2 n3 k1 k2 v
fromListT3 :: [(IndTuple3 n1 n2 n3 k1 k2, v)] -> AbsTensor3 n1 n2 n3 k1 k2 v
fromListT3 [(IndTuple3 n1 n2 n3 k1 k2, v)]
l = (AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v)
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> [AbsTensor3 n1 n2 n3 k1 k2 v]
-> AbsTensor3 n1 n2 n3 k1 k2 v
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
Tensor n k v -> Tensor n k v -> Tensor n k v
(&+) AbsTensor3 n1 n2 n3 k1 k2 v
forall (n :: Nat) k v. Tensor n k v
ZeroTensor [AbsTensor3 n1 n2 n3 k1 k2 v]
tensList
where
tensList :: [AbsTensor3 n1 n2 n3 k1 k2 v]
tensList = ((IndTuple3 n1 n2 n3 k1 k2, v) -> AbsTensor3 n1 n2 n3 k1 k2 v)
-> [(IndTuple3 n1 n2 n3 k1 k2, v)] -> [AbsTensor3 n1 n2 n3 k1 k2 v]
forall a b. (a -> b) -> [a] -> [b]
map (IndTuple3 n1 n2 n3 k1 k2, v) -> AbsTensor3 n1 n2 n3 k1 k2 v
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2 v.
(IndTuple3 n1 n2 n3 k1 k2, v) -> AbsTensor3 n1 n2 n3 k1 k2 v
mkTens3 [(IndTuple3 n1 n2 n3 k1 k2, v)]
l
fromListT3' :: forall n1 n2 n3 k1 k2 v. (KnownNat n1, KnownNat n2, KnownNat n3, TIndex k1, TIndex k2, TAdd v) => [(([k1],[k1],[k2]),v)] -> AbsTensor3 n1 n2 n3 k1 k2 v
fromListT3' :: [(([k1], [k1], [k2]), v)] -> AbsTensor3 n1 n2 n3 k1 k2 v
fromListT3' [(([k1], [k1], [k2]), v)]
l = [(IndTuple3 n1 n2 n3 k1 k2, v)] -> AbsTensor3 n1 n2 n3 k1 k2 v
forall k1 k2 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat).
(TIndex k1, TIndex k2, TAdd v) =>
[(IndTuple3 n1 n2 n3 k1 k2, v)] -> AbsTensor3 n1 n2 n3 k1 k2 v
fromListT3 [(IndTuple3 n1 n2 n3 k1 k2, v)]
indList
where
indList :: [(IndTuple3 n1 n2 n3 k1 k2, v)]
indList = ((([k1], [k1], [k2]), v) -> (IndTuple3 n1 n2 n3 k1 k2, v))
-> [(([k1], [k1], [k2]), v)] -> [(IndTuple3 n1 n2 n3 k1 k2, v)]
forall a b. (a -> b) -> [a] -> [b]
map (\(([k1]
x1,[k1]
x2,[k2]
x3),v
y) -> (([k1] -> IndList n1 k1
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k1]
x1, [k1] -> IndList n2 k1
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k1]
x2, [k2] -> IndList n3 k2
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k2]
x3),v
y)) [(([k1], [k1], [k2]), v)]
l
fromListT4 :: (TIndex k1, TIndex k2, TAdd v) => [(IndTuple4 n1 n2 n3 n4 k1 k2, v)] -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
fromListT4 :: [(IndTuple4 n1 n2 n3 n4 k1 k2, v)]
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
fromListT4 [(IndTuple4 n1 n2 n3 n4 k1 k2, v)]
l = (AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> [AbsTensor4 n1 n2 n3 n4 k1 k2 v]
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
Tensor n k v -> Tensor n k v -> Tensor n k v
(&+) AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall (n :: Nat) k v. Tensor n k v
ZeroTensor [AbsTensor4 n1 n2 n3 n4 k1 k2 v]
tensList
where
tensList :: [AbsTensor4 n1 n2 n3 n4 k1 k2 v]
tensList = ((IndTuple4 n1 n2 n3 n4 k1 k2, v)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v)
-> [(IndTuple4 n1 n2 n3 n4 k1 k2, v)]
-> [AbsTensor4 n1 n2 n3 n4 k1 k2 v]
forall a b. (a -> b) -> [a] -> [b]
map (IndTuple4 n1 n2 n3 n4 k1 k2, v) -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2 v.
(IndTuple4 n1 n2 n3 n4 k1 k2, v) -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
mkTens4 [(IndTuple4 n1 n2 n3 n4 k1 k2, v)]
l
fromListT4' :: forall n1 n2 n3 n4 k1 k2 v. (KnownNat n1, KnownNat n2, KnownNat n3, KnownNat n4, TIndex k1, TIndex k2, TAdd v) => [(([k1],[k1],[k2],[k2]),v)] -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
fromListT4' :: [(([k1], [k1], [k2], [k2]), v)] -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
fromListT4' [(([k1], [k1], [k2], [k2]), v)]
l = [(IndTuple4 n1 n2 n3 n4 k1 k2, v)]
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall k1 k2 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat).
(TIndex k1, TIndex k2, TAdd v) =>
[(IndTuple4 n1 n2 n3 n4 k1 k2, v)]
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
fromListT4 [(IndTuple4 n1 n2 n3 n4 k1 k2, v)]
indList
where
indList :: [(IndTuple4 n1 n2 n3 n4 k1 k2, v)]
indList = ((([k1], [k1], [k2], [k2]), v) -> (IndTuple4 n1 n2 n3 n4 k1 k2, v))
-> [(([k1], [k1], [k2], [k2]), v)]
-> [(IndTuple4 n1 n2 n3 n4 k1 k2, v)]
forall a b. (a -> b) -> [a] -> [b]
map (\(([k1]
x1,[k1]
x2,[k2]
x3,[k2]
x4),v
y) -> (([k1] -> IndList n1 k1
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k1]
x1, [k1] -> IndList n2 k1
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k1]
x2, [k2] -> IndList n3 k2
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k2]
x3, [k2] -> IndList n4 k2
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k2]
x4),v
y)) [(([k1], [k1], [k2], [k2]), v)]
l
fromListT5 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v) => [(IndTuple5 n1 n2 n3 n4 n5 k1 k2 k3, v)] -> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
fromListT5 :: [(IndTuple5 n1 n2 n3 n4 n5 k1 k2 k3, v)]
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
fromListT5 [(IndTuple5 n1 n2 n3 n4 n5 k1 k2 k3, v)]
l = (AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> [AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v]
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
Tensor n k v -> Tensor n k v -> Tensor n k v
(&+) AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall (n :: Nat) k v. Tensor n k v
ZeroTensor [AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v]
tensList
where
tensList :: [AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v]
tensList = ((IndTuple5 n1 n2 n3 n4 n5 k1 k2 k3, v)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v)
-> [(IndTuple5 n1 n2 n3 n4 n5 k1 k2 k3, v)]
-> [AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v]
forall a b. (a -> b) -> [a] -> [b]
map (IndTuple5 n1 n2 n3 n4 n5 k1 k2 k3, v)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
k1 k2 k3 v.
(IndTuple5 n1 n2 n3 n4 n5 k1 k2 k3, v)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
mkTens5 [(IndTuple5 n1 n2 n3 n4 n5 k1 k2 k3, v)]
l
fromListT5' :: forall n1 n2 n3 n4 n5 k1 k2 k3 v. (KnownNat n1, KnownNat n2, KnownNat n3, KnownNat n4, KnownNat n5, TIndex k1, TIndex k2, TIndex k3, TAdd v) => [(([k1],[k1],[k2],[k2],[k3]),v)] -> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
fromListT5' :: [(([k1], [k1], [k2], [k2], [k3]), v)]
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
fromListT5' [(([k1], [k1], [k2], [k2], [k3]), v)]
l = [(IndTuple5 n1 n2 n3 n4 n5 k1 k2 k3, v)]
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[(IndTuple5 n1 n2 n3 n4 n5 k1 k2 k3, v)]
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
fromListT5 [(IndTuple5 n1 n2 n3 n4 n5 k1 k2 k3, v)]
indList
where
indList :: [(IndTuple5 n1 n2 n3 n4 n5 k1 k2 k3, v)]
indList = ((([k1], [k1], [k2], [k2], [k3]), v)
-> (IndTuple5 n1 n2 n3 n4 n5 k1 k2 k3, v))
-> [(([k1], [k1], [k2], [k2], [k3]), v)]
-> [(IndTuple5 n1 n2 n3 n4 n5 k1 k2 k3, v)]
forall a b. (a -> b) -> [a] -> [b]
map (\(([k1]
x1,[k1]
x2,[k2]
x3,[k2]
x4,[k3]
x5),v
y) -> (([k1] -> IndList n1 k1
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k1]
x1, [k1] -> IndList n2 k1
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k1]
x2, [k2] -> IndList n3 k2
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k2]
x3, [k2] -> IndList n4 k2
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k2]
x4, [k3] -> IndList n5 k3
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k3]
x5),v
y)) [(([k1], [k1], [k2], [k2], [k3]), v)]
l
fromListT6 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v) => [(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)] -> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 :: [(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 [(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
l = (AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> [AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
Tensor n k v -> Tensor n k v -> Tensor n k v
(&+) AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall (n :: Nat) k v. Tensor n k v
ZeroTensor [AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v]
tensList
where
tensList :: [AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v]
tensList = ((IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v)
-> [(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> [AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v]
forall a b. (a -> b) -> [a] -> [b]
map (IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) k1 k2 k3 v.
(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
mkTens6 [(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
l
fromListT6' :: forall n1 n2 n3 n4 n5 n6 k1 k2 k3 v. (KnownNat n1, KnownNat n2, KnownNat n3, KnownNat n4, KnownNat n5, KnownNat n6, TIndex k1, TIndex k2, TIndex k3, TAdd v) => [(([k1],[k1],[k2],[k2],[k3],[k3]),v)] -> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6' :: [(([k1], [k1], [k2], [k2], [k3], [k3]), v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6' [(([k1], [k1], [k2], [k2], [k3], [k3]), v)]
l = [(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 [(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
indList
where
indList :: [(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
indList = ((([k1], [k1], [k2], [k2], [k3], [k3]), v)
-> (IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v))
-> [(([k1], [k1], [k2], [k2], [k3], [k3]), v)]
-> [(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
forall a b. (a -> b) -> [a] -> [b]
map (\(([k1]
x1,[k1]
x2,[k2]
x3,[k2]
x4,[k3]
x5,[k3]
x6),v
y) -> (([k1] -> IndList n1 k1
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k1]
x1, [k1] -> IndList n2 k1
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k1]
x2, [k2] -> IndList n3 k2
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k2]
x3, [k2] -> IndList n4 k2
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k2]
x4, [k3] -> IndList n5 k3
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k3]
x5, [k3] -> IndList n6 k3
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k3]
x6),v
y)) [(([k1], [k1], [k2], [k2], [k3], [k3]), v)]
l
fromListT7 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) => [(IndTuple7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4, v)] -> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
fromListT7 :: [(IndTuple7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4, v)]
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
fromListT7 [(IndTuple7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4, v)]
l = (AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> [AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v]
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
Tensor n k v -> Tensor n k v -> Tensor n k v
(&+) AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall (n :: Nat) k v. Tensor n k v
ZeroTensor [AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v]
tensList
where
tensList :: [AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v]
tensList = ((IndTuple7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4, v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v)
-> [(IndTuple7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4, v)]
-> [AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v]
forall a b. (a -> b) -> [a] -> [b]
map (IndTuple7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4, v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat) k1 k2 k3 k4 v.
(IndTuple7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4, v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
mkTens7 [(IndTuple7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4, v)]
l
fromListT7' :: forall n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v. (KnownNat n1, KnownNat n2, KnownNat n3, KnownNat n4, KnownNat n5, KnownNat n6, KnownNat n7, TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) => [(([k1],[k1],[k2],[k2],[k3],[k3],[k4]),v)] -> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
fromListT7' :: [(([k1], [k1], [k2], [k2], [k3], [k3], [k4]), v)]
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
fromListT7' [(([k1], [k1], [k2], [k2], [k3], [k3], [k4]), v)]
l = [(IndTuple7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4, v)]
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall k1 k2 k3 k4 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat)
(n4 :: Nat) (n5 :: Nat) (n6 :: Nat) (n7 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) =>
[(IndTuple7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4, v)]
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
fromListT7 [(IndTuple7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4, v)]
indList
where
indList :: [(IndTuple7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4, v)]
indList = ((([k1], [k1], [k2], [k2], [k3], [k3], [k4]), v)
-> (IndTuple7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4, v))
-> [(([k1], [k1], [k2], [k2], [k3], [k3], [k4]), v)]
-> [(IndTuple7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4, v)]
forall a b. (a -> b) -> [a] -> [b]
map (\(([k1]
x1,[k1]
x2,[k2]
x3,[k2]
x4,[k3]
x5,[k3]
x6,[k4]
x7),v
y) -> (([k1] -> IndList n1 k1
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k1]
x1, [k1] -> IndList n2 k1
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k1]
x2, [k2] -> IndList n3 k2
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k2]
x3, [k2] -> IndList n4 k2
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k2]
x4, [k3] -> IndList n5 k3
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k3]
x5, [k3] -> IndList n6 k3
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k3]
x6, [k4] -> IndList n7 k4
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k4]
x7),v
y)) [(([k1], [k1], [k2], [k2], [k3], [k3], [k4]), v)]
l
fromListT8 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) => [(IndTuple8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4, v)] -> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
fromListT8 :: [(IndTuple8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4, v)]
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
fromListT8 [(IndTuple8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4, v)]
l = (AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> [AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v]
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
Tensor n k v -> Tensor n k v -> Tensor n k v
(&+) AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall (n :: Nat) k v. Tensor n k v
ZeroTensor [AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v]
tensList
where
tensList :: [AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v]
tensList = ((IndTuple8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4, v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v)
-> [(IndTuple8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4, v)]
-> [AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v]
forall a b. (a -> b) -> [a] -> [b]
map (IndTuple8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4, v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat) (n8 :: Nat) k1 k2 k3 k4 v.
(IndTuple8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4, v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
mkTens8 [(IndTuple8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4, v)]
l
fromListT8' :: forall n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v. (KnownNat n1, KnownNat n2, KnownNat n3, KnownNat n4, KnownNat n5, KnownNat n6, KnownNat n7, KnownNat n8, TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) => [(([k1],[k1],[k2],[k2],[k3],[k3],[k4],[k4]),v)] -> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
fromListT8' :: [(([k1], [k1], [k2], [k2], [k3], [k3], [k4], [k4]), v)]
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
fromListT8' [(([k1], [k1], [k2], [k2], [k3], [k3], [k4], [k4]), v)]
l = [(IndTuple8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4, v)]
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall k1 k2 k3 k4 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat)
(n4 :: Nat) (n5 :: Nat) (n6 :: Nat) (n7 :: Nat) (n8 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) =>
[(IndTuple8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4, v)]
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
fromListT8 [(IndTuple8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4, v)]
indList
where
indList :: [(IndTuple8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4, v)]
indList = ((([k1], [k1], [k2], [k2], [k3], [k3], [k4], [k4]), v)
-> (IndTuple8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4, v))
-> [(([k1], [k1], [k2], [k2], [k3], [k3], [k4], [k4]), v)]
-> [(IndTuple8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4, v)]
forall a b. (a -> b) -> [a] -> [b]
map (\(([k1]
x1,[k1]
x2,[k2]
x3,[k2]
x4,[k3]
x5,[k3]
x6,[k4]
x7,[k4]
x8),v
y) -> (([k1] -> IndList n1 k1
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k1]
x1, [k1] -> IndList n2 k1
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k1]
x2, [k2] -> IndList n3 k2
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k2]
x3, [k2] -> IndList n4 k2
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k2]
x4, [k3] -> IndList n5 k3
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k3]
x5, [k3] -> IndList n6 k3
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k3]
x6, [k4] -> IndList n7 k4
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k4]
x7, [k4] -> IndList n8 k4
forall (n :: Nat) a. KnownNat n => [a] -> IndList n a
fromListUnsafe [k4]
x8),v
y)) [(([k1], [k1], [k2], [k2], [k3], [k3], [k4], [k4]), v)]
l
insertOrAdd :: (TIndex k, TAdd v) => (IndList n k, v) -> Tensor n k v -> Tensor n k v
insertOrAdd :: (IndList n k, v) -> Tensor n k v -> Tensor n k v
insertOrAdd (IndList n k
Empty, v
a) (Scalar v
b) = v -> Tensor 0 k v
forall v k. v -> Tensor 0 k v
Scalar (v -> Tensor 0 k v) -> v -> Tensor 0 k v
forall a b. (a -> b) -> a -> b
$ v
a v -> v -> v
forall a. TAdd a => a -> a -> a
`addS` v
b
insertOrAdd (IndList n k
_, v
_) (Scalar v
_) = String -> Tensor n k v
forall a. HasCallStack => String -> a
error String
"cannot add key value pair to scalar"
insertOrAdd (Append k
x IndList (n - 1) k
xs, v
a) (Tensor TMap k (Tensor n k v)
m) = TMap k (Tensor n k v) -> Tensor (n + 1) k v
forall k (n :: Nat) v. TMap k (Tensor n k v) -> Tensor (n + 1) k v
Tensor (TMap k (Tensor n k v) -> Tensor (n + 1) k v)
-> TMap k (Tensor n k v) -> Tensor (n + 1) k v
forall a b. (a -> b) -> a -> b
$ (Tensor n k v -> Tensor n k v -> Tensor n k v)
-> k
-> Tensor n k v
-> TMap k (Tensor n k v)
-> TMap k (Tensor n k v)
forall k v.
Ord k =>
(v -> v -> v) -> k -> v -> TMap k v -> TMap k v
insertWithTMap (\Tensor n k v
_ Tensor n k v
o -> (IndList n k, v) -> Tensor n k v -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(IndList n k, v) -> Tensor n k v -> Tensor n k v
insertOrAdd (IndList n k
IndList (n - 1) k
xs, v
a) Tensor n k v
o) k
x Tensor n k v
indTens TMap k (Tensor n k v)
m
where
indTens :: Tensor n k v
indTens = (IndList n k, v) -> Tensor n k v
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n k
IndList (n - 1) k
xs, v
a)
insertOrAdd (IndList n k, v)
inds Tensor n k v
ZeroTensor = (IndList n k, v) -> Tensor n k v
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n k, v)
inds
infixl 6 &+
(&+) :: (TIndex k, TAdd v) => Tensor n k v -> Tensor n k v -> Tensor n k v
&+ :: Tensor n k v -> Tensor n k v -> Tensor n k v
(&+) (Scalar v
a) (Scalar v
b) = v -> Tensor 0 k v
forall v k. v -> Tensor 0 k v
Scalar (v -> Tensor 0 k v) -> v -> Tensor 0 k v
forall a b. (a -> b) -> a -> b
$ v
a v -> v -> v
forall a. TAdd a => a -> a -> a
`addS` v
b
(&+) (Tensor TMap k (Tensor n k v)
m1) (Tensor TMap k (Tensor n k v)
m2) = TMap k (Tensor n k v) -> Tensor (n + 1) k v
forall k (n :: Nat) v. TMap k (Tensor n k v) -> Tensor (n + 1) k v
Tensor (TMap k (Tensor n k v) -> Tensor (n + 1) k v)
-> TMap k (Tensor n k v) -> Tensor (n + 1) k v
forall a b. (a -> b) -> a -> b
$ (Tensor n k v -> Tensor n k v -> Tensor n k v)
-> TMap k (Tensor n k v)
-> TMap k (Tensor n k v)
-> TMap k (Tensor n k v)
forall k v.
Ord k =>
(v -> v -> v) -> TMap k v -> TMap k v -> TMap k v
addTMaps Tensor n k v -> Tensor n k v -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
Tensor n k v -> Tensor n k v -> Tensor n k v
(&+) TMap k (Tensor n k v)
m1 TMap k (Tensor n k v)
TMap k (Tensor n k v)
m2
(&+) Tensor n k v
t1 Tensor n k v
ZeroTensor = Tensor n k v
t1
(&+) Tensor n k v
ZeroTensor Tensor n k v
t2 = Tensor n k v
t2
(&+) Tensor n k v
_ Tensor n k v
_ = String -> Tensor n k v
forall a. HasCallStack => String -> a
error String
"incompatible combination of summands"
infix 8 &.
(&.) :: (TIndex k, Prod s v) => s -> Tensor n k v -> Tensor n k (TProd s v)
&. :: s -> Tensor n k v -> Tensor n k (TProd s v)
(&.) s
scalar = (v -> TProd s v) -> Tensor n k v -> Tensor n k (TProd s v)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (s -> v -> TProd s v
forall v v'. Prod v v' => v -> v' -> TProd v v'
prod s
scalar)
negateTens :: (TIndex k, TAdd v) => Tensor n k v -> Tensor n k v
negateTens :: Tensor n k v -> Tensor n k v
negateTens = (v -> v) -> Tensor n k v -> Tensor n k v
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap v -> v
forall a. TAdd a => a -> a
negateS
infixl 6 &-
(&-) :: (TIndex k, TAdd v) => Tensor n k v -> Tensor n k v -> Tensor n k v
&- :: Tensor n k v -> Tensor n k v -> Tensor n k v
(&-) (Scalar v
a) (Scalar v
b) = v -> Tensor 0 k v
forall v k. v -> Tensor 0 k v
Scalar (v -> Tensor 0 k v) -> v -> Tensor 0 k v
forall a b. (a -> b) -> a -> b
$ v -> v -> v
forall a. TAdd a => a -> a -> a
subS v
a v
b
(&-) t1 :: Tensor n k v
t1@(Tensor TMap k (Tensor n k v)
_) t2 :: Tensor n k v
t2@(Tensor TMap k (Tensor n k v)
_) = Tensor n k v
t1 Tensor n k v -> Tensor n k v -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
Tensor n k v -> Tensor n k v -> Tensor n k v
&+ (Tensor n k v -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
Tensor n k v -> Tensor n k v
negateTens Tensor n k v
t2)
(&-) Tensor n k v
t1 Tensor n k v
ZeroTensor = Tensor n k v
t1
(&-) Tensor n k v
ZeroTensor Tensor n k v
t2 = Tensor n k v -> Tensor n k v
forall a. TAdd a => a -> a
negateS Tensor n k v
t2
(&-) Tensor n k v
_ Tensor n k v
_ = String -> Tensor n k v
forall a. HasCallStack => String -> a
error String
"incompatible combination of summands"
infixl 7 &*
(&*) :: (TIndex k, Prod v v') => Tensor n k v -> Tensor m k v' -> TProd (Tensor n k v) (Tensor m k v')
&* :: Tensor n k v
-> Tensor m k v' -> TProd (Tensor n k v) (Tensor m k v')
(&*) (Scalar v
x) (Scalar v'
y) = TProd v v' -> Tensor 0 k (TProd v v')
forall v k. v -> Tensor 0 k v
Scalar (TProd v v' -> Tensor 0 k (TProd v v'))
-> TProd v v' -> Tensor 0 k (TProd v v')
forall a b. (a -> b) -> a -> b
$ v -> v' -> TProd v v'
forall v v'. Prod v v' => v -> v' -> TProd v v'
prod v
x v'
y
(&*) (Scalar v
x) Tensor m k v'
t2 = (v' -> TProd v v') -> Tensor m k v' -> Tensor m k (TProd v v')
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (v -> v' -> TProd v v'
forall v v'. Prod v v' => v -> v' -> TProd v v'
prod v
x) Tensor m k v'
t2
(&*) (Tensor TMap k (Tensor n k v)
m) Tensor m k v'
t2 = TMap k (Tensor (n + m) k (TProd v v'))
-> Tensor ((n + m) + 1) k (TProd v v')
forall k (n :: Nat) v. TMap k (Tensor n k v) -> Tensor (n + 1) k v
Tensor (TMap k (Tensor (n + m) k (TProd v v'))
-> Tensor ((n + m) + 1) k (TProd v v'))
-> TMap k (Tensor (n + m) k (TProd v v'))
-> Tensor ((n + m) + 1) k (TProd v v')
forall a b. (a -> b) -> a -> b
$ (Tensor n k v -> Tensor (n + m) k (TProd v v'))
-> TMap k (Tensor n k v) -> TMap k (Tensor (n + m) k (TProd v v'))
forall v v' k. (v -> v') -> TMap k v -> TMap k v'
mapTMap (Tensor n k v
-> Tensor m k v' -> TProd (Tensor n k v) (Tensor m k v')
forall k v v' (n :: Nat) (n' :: Nat).
(TIndex k, Prod v v') =>
Tensor n k v
-> Tensor n' k v' -> TProd (Tensor n k v) (Tensor n' k v')
&* Tensor m k v'
t2) TMap k (Tensor n k v)
m
(&*) Tensor n k v
_ Tensor m k v'
ZeroTensor = TProd (Tensor n k v) (Tensor m k v')
forall (n :: Nat) k v. Tensor n k v
ZeroTensor
(&*) Tensor n k v
ZeroTensor Tensor m k v'
_ = TProd (Tensor n k v) (Tensor m k v')
forall (n :: Nat) k v. Tensor n k v
ZeroTensor
encodeTensor :: (KnownNat n, Ord k, Serialize k, Serialize v) => Tensor n k v -> BS.ByteString
encodeTensor :: Tensor n k v -> ByteString
encodeTensor = ByteString -> ByteString
compress (ByteString -> ByteString)
-> (Tensor n k v -> ByteString) -> Tensor n k v -> ByteString
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Tensor n k v -> ByteString
forall a. Serialize a => a -> ByteString
encodeLazy
decodeTensor :: (KnownNat n, Ord k, Serialize k, Serialize v) => BS.ByteString -> Either String (Tensor n k v)
decodeTensor :: ByteString -> Either String (Tensor n k v)
decodeTensor ByteString
bs = ByteString -> Either String (Tensor n k v)
forall a. Serialize a => ByteString -> Either String a
decodeLazy (ByteString -> Either String (Tensor n k v))
-> ByteString -> Either String (Tensor n k v)
forall a b. (a -> b) -> a -> b
$ ByteString -> ByteString
decompress ByteString
bs
partial :: Num a => STTens n1 n2 (CFun [AD.Forward a] (AD.Forward a)) -> STTens n1 (n2+1) (CFun [a] a)
partial :: STTens n1 n2 (CFun [Forward a] (Forward a))
-> STTens n1 (n2 + 1) (CFun [a] a)
partial STTens n1 n2 (CFun [Forward a] (Forward a))
tens = STTens n1 (n2 + 1) (CFun [a] a)
tens'
where
tList :: [(IndTuple2 n1 n2 Ind3, CFun [Forward a] (Forward a))]
tList = STTens n1 n2 (CFun [Forward a] (Forward a))
-> [(IndTuple2 n1 n2 Ind3, CFun [Forward a] (Forward a))]
forall (n1 :: Nat) (n2 :: Nat) k1 v.
AbsTensor2 n1 n2 k1 v -> [(IndTuple2 n1 n2 k1, v)]
toListT2 STTens n1 n2 (CFun [Forward a] (Forward a))
tens
grads :: [(IndTuple2 n1 n2 Ind3, [(Int, [a] -> a)])]
grads = ((IndTuple2 n1 n2 Ind3, CFun [Forward a] (Forward a))
-> (IndTuple2 n1 n2 Ind3, [(Int, [a] -> a)]))
-> [(IndTuple2 n1 n2 Ind3, CFun [Forward a] (Forward a))]
-> [(IndTuple2 n1 n2 Ind3, [(Int, [a] -> a)])]
forall a b. (a -> b) -> [a] -> [b]
map (\(IndTuple2 n1 n2 Ind3
is, CFun [Forward a] -> Forward a
v) -> (IndTuple2 n1 n2 Ind3
is, [Int] -> ([Forward a] -> Forward a) -> [(Int, [a] -> a)]
forall a.
Num a =>
[Int] -> ([Forward a] -> Forward a) -> [(Int, [a] -> a)]
myGrad [Int
0..Int
3] [Forward a] -> Forward a
v)) [(IndTuple2 n1 n2 Ind3, CFun [Forward a] (Forward a))]
tList
tList' :: [((IndList n1 Ind3, IndList (n2 + 1) Ind3), CFun [a] a)]
tList' = ((IndTuple2 n1 n2 Ind3, [(Int, [a] -> a)])
-> [((IndList n1 Ind3, IndList (n2 + 1) Ind3), CFun [a] a)])
-> [(IndTuple2 n1 n2 Ind3, [(Int, [a] -> a)])]
-> [((IndList n1 Ind3, IndList (n2 + 1) Ind3), CFun [a] a)]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\((IndList n1 Ind3
i1, IndList n2 Ind3
i2), [(Int, [a] -> a)]
gs) -> ((Int, [a] -> a)
-> ((IndList n1 Ind3, IndList (n2 + 1) Ind3), CFun [a] a))
-> [(Int, [a] -> a)]
-> [((IndList n1 Ind3, IndList (n2 + 1) Ind3), CFun [a] a)]
forall a b. (a -> b) -> [a] -> [b]
map (\(Int
ig, [a] -> a
g) -> ((IndList n1 Ind3
i1, Int -> Ind3
Ind3 Int
ig Ind3 -> IndList ((n2 + 1) - 1) Ind3 -> IndList (n2 + 1) Ind3
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
`Append` IndList n2 Ind3
IndList ((n2 + 1) - 1) Ind3
i2), ([a] -> a) -> CFun [a] a
forall a b. (a -> b) -> CFun a b
CFun [a] -> a
g)) [(Int, [a] -> a)]
gs) [(IndTuple2 n1 n2 Ind3, [(Int, [a] -> a)])]
grads
tens' :: STTens n1 (n2 + 1) (CFun [a] a)
tens' = [((IndList n1 Ind3, IndList (n2 + 1) Ind3), CFun [a] a)]
-> STTens n1 (n2 + 1) (CFun [a] a)
forall k1 v (n1 :: Nat) (n2 :: Nat).
(TIndex k1, TAdd v) =>
[(IndTuple2 n1 n2 k1, v)] -> AbsTensor2 n1 n2 k1 v
fromListT2 [((IndList n1 Ind3, IndList (n2 + 1) Ind3), CFun [a] a)]
tList'
partialSymbolic :: [String] -> STTens n1 n2 SSymbolic -> STTens n1 (n2+1) SSymbolic
partialSymbolic :: [String] -> STTens n1 n2 SSymbolic -> STTens n1 (n2 + 1) SSymbolic
partialSymbolic [String]
vars STTens n1 n2 SSymbolic
tens = STTens n1 (n2 + 1) SSymbolic
tens'
where
tList :: [(IndTuple2 n1 n2 Ind3, SSymbolic)]
tList = STTens n1 n2 SSymbolic -> [(IndTuple2 n1 n2 Ind3, SSymbolic)]
forall (n1 :: Nat) (n2 :: Nat) k1 v.
AbsTensor2 n1 n2 k1 v -> [(IndTuple2 n1 n2 k1, v)]
toListT2 STTens n1 n2 SSymbolic
tens
grads :: [(IndTuple2 n1 n2 Ind3, [(Int, SSymbolic)])]
grads = ((IndTuple2 n1 n2 Ind3, SSymbolic)
-> (IndTuple2 n1 n2 Ind3, [(Int, SSymbolic)]))
-> [(IndTuple2 n1 n2 Ind3, SSymbolic)]
-> [(IndTuple2 n1 n2 Ind3, [(Int, SSymbolic)])]
forall a b. (a -> b) -> [a] -> [b]
map (\(IndTuple2 n1 n2 Ind3
is, SSymbolic String
v) -> (IndTuple2 n1 n2 Ind3
is, ((Int, String) -> (Int, SSymbolic))
-> [(Int, String)] -> [(Int, SSymbolic)]
forall a b. (a -> b) -> [a] -> [b]
map (\(Int
i, String
var) -> (Int
i, String -> SSymbolic
SSymbolic (String -> SSymbolic) -> String -> SSymbolic
forall a b. (a -> b) -> a -> b
$ String
"diff(" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
v String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
", " String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
var String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
")")) ([(Int, String)] -> [(Int, SSymbolic)])
-> [(Int, String)] -> [(Int, SSymbolic)]
forall a b. (a -> b) -> a -> b
$ [Int] -> [String] -> [(Int, String)]
forall a b. [a] -> [b] -> [(a, b)]
zip [Int
0..] [String]
vars)) [(IndTuple2 n1 n2 Ind3, SSymbolic)]
tList
tList' :: [((IndList n1 Ind3, IndList (n2 + 1) Ind3), SSymbolic)]
tList' = ((IndTuple2 n1 n2 Ind3, [(Int, SSymbolic)])
-> [((IndList n1 Ind3, IndList (n2 + 1) Ind3), SSymbolic)])
-> [(IndTuple2 n1 n2 Ind3, [(Int, SSymbolic)])]
-> [((IndList n1 Ind3, IndList (n2 + 1) Ind3), SSymbolic)]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\((IndList n1 Ind3
i1, IndList n2 Ind3
i2), [(Int, SSymbolic)]
gs) -> ((Int, SSymbolic)
-> ((IndList n1 Ind3, IndList (n2 + 1) Ind3), SSymbolic))
-> [(Int, SSymbolic)]
-> [((IndList n1 Ind3, IndList (n2 + 1) Ind3), SSymbolic)]
forall a b. (a -> b) -> [a] -> [b]
map (\(Int
ig, SSymbolic
g) -> ((IndList n1 Ind3
i1, Int -> Ind3
Ind3 Int
ig Ind3 -> IndList ((n2 + 1) - 1) Ind3 -> IndList (n2 + 1) Ind3
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
`Append` IndList n2 Ind3
IndList ((n2 + 1) - 1) Ind3
i2), SSymbolic
g)) [(Int, SSymbolic)]
gs) [(IndTuple2 n1 n2 Ind3, [(Int, SSymbolic)])]
grads
tens' :: STTens n1 (n2 + 1) SSymbolic
tens' = [((IndList n1 Ind3, IndList (n2 + 1) Ind3), SSymbolic)]
-> STTens n1 (n2 + 1) SSymbolic
forall k1 v (n1 :: Nat) (n2 :: Nat).
(TIndex k1, TAdd v) =>
[(IndTuple2 n1 n2 k1, v)] -> AbsTensor2 n1 n2 k1 v
fromListT2 [((IndList n1 Ind3, IndList (n2 + 1) Ind3), SSymbolic)]
tList'
mapTo1 :: (v1 -> v2) -> Tensor n1 k v1 -> Tensor n1 k v2
mapTo1 :: (v1 -> v2) -> Tensor n1 k v1 -> Tensor n1 k v2
mapTo1 = (v1 -> v2) -> Tensor n1 k v1 -> Tensor n1 k v2
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap
mapTo2 :: (v1 -> v2) -> Tensor2 n1 n2 k v1 -> Tensor2 n1 n2 k v2
mapTo2 :: (v1 -> v2) -> Tensor2 n1 n2 k v1 -> Tensor2 n1 n2 k v2
mapTo2 = (Tensor n2 k v1 -> Tensor n2 k v2)
-> Tensor2 n1 n2 k v1 -> Tensor2 n1 n2 k v2
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Tensor n2 k v1 -> Tensor n2 k v2)
-> Tensor2 n1 n2 k v1 -> Tensor2 n1 n2 k v2)
-> ((v1 -> v2) -> Tensor n2 k v1 -> Tensor n2 k v2)
-> (v1 -> v2)
-> Tensor2 n1 n2 k v1
-> Tensor2 n1 n2 k v2
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (v1 -> v2) -> Tensor n2 k v1 -> Tensor n2 k v2
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap
mapTo3 :: (v1 -> v2) -> AbsTensor3 n1 n2 n3 k1 k2 v1 -> AbsTensor3 n1 n2 n3 k1 k2 v2
mapTo3 :: (v1 -> v2)
-> AbsTensor3 n1 n2 n3 k1 k2 v1 -> AbsTensor3 n1 n2 n3 k1 k2 v2
mapTo3 = (Tensor n2 k1 (Tensor n3 k2 v1) -> Tensor n2 k1 (Tensor n3 k2 v2))
-> AbsTensor3 n1 n2 n3 k1 k2 v1 -> AbsTensor3 n1 n2 n3 k1 k2 v2
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Tensor n2 k1 (Tensor n3 k2 v1) -> Tensor n2 k1 (Tensor n3 k2 v2))
-> AbsTensor3 n1 n2 n3 k1 k2 v1 -> AbsTensor3 n1 n2 n3 k1 k2 v2)
-> ((v1 -> v2)
-> Tensor n2 k1 (Tensor n3 k2 v1)
-> Tensor n2 k1 (Tensor n3 k2 v2))
-> (v1 -> v2)
-> AbsTensor3 n1 n2 n3 k1 k2 v1
-> AbsTensor3 n1 n2 n3 k1 k2 v2
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n3 k2 v1 -> Tensor n3 k2 v2)
-> Tensor n2 k1 (Tensor n3 k2 v1) -> Tensor n2 k1 (Tensor n3 k2 v2)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Tensor n3 k2 v1 -> Tensor n3 k2 v2)
-> Tensor n2 k1 (Tensor n3 k2 v1)
-> Tensor n2 k1 (Tensor n3 k2 v2))
-> ((v1 -> v2) -> Tensor n3 k2 v1 -> Tensor n3 k2 v2)
-> (v1 -> v2)
-> Tensor n2 k1 (Tensor n3 k2 v1)
-> Tensor n2 k1 (Tensor n3 k2 v2)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (v1 -> v2) -> Tensor n3 k2 v1 -> Tensor n3 k2 v2
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap
mapTo4 :: (v1 -> v2) -> AbsTensor4 n1 n2 n3 n4 k1 k2 v1 -> AbsTensor4 n1 n2 n3 n4 k1 k2 v2
mapTo4 :: (v1 -> v2)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v1
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v2
mapTo4 = (Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 v1))
-> Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 v2)))
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v1
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v2
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 v1))
-> Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 v2)))
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v1
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v2)
-> ((v1 -> v2)
-> Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 v1))
-> Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 v2)))
-> (v1 -> v2)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v1
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v2
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n3 k2 (Tensor n4 k2 v1) -> Tensor n3 k2 (Tensor n4 k2 v2))
-> Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 v1))
-> Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 v2))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Tensor n3 k2 (Tensor n4 k2 v1) -> Tensor n3 k2 (Tensor n4 k2 v2))
-> Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 v1))
-> Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 v2)))
-> ((v1 -> v2)
-> Tensor n3 k2 (Tensor n4 k2 v1)
-> Tensor n3 k2 (Tensor n4 k2 v2))
-> (v1 -> v2)
-> Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 v1))
-> Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 v2))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n4 k2 v1 -> Tensor n4 k2 v2)
-> Tensor n3 k2 (Tensor n4 k2 v1) -> Tensor n3 k2 (Tensor n4 k2 v2)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Tensor n4 k2 v1 -> Tensor n4 k2 v2)
-> Tensor n3 k2 (Tensor n4 k2 v1)
-> Tensor n3 k2 (Tensor n4 k2 v2))
-> ((v1 -> v2) -> Tensor n4 k2 v1 -> Tensor n4 k2 v2)
-> (v1 -> v2)
-> Tensor n3 k2 (Tensor n4 k2 v1)
-> Tensor n3 k2 (Tensor n4 k2 v2)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (v1 -> v2) -> Tensor n4 k2 v1 -> Tensor n4 k2 v2
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap
mapTo5 :: (v1 -> v2) -> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v1 -> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v2
mapTo5 :: (v1 -> v2)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v1
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v2
mapTo5 = (Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v1)))
-> Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v2))))
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v1
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v2
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v1)))
-> Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v2))))
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v1
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v2)
-> ((v1 -> v2)
-> Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v1)))
-> Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v2))))
-> (v1 -> v2)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v1
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v2
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v1))
-> Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v2)))
-> Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v1)))
-> Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v2)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v1))
-> Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v2)))
-> Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v1)))
-> Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v2))))
-> ((v1 -> v2)
-> Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v1))
-> Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v2)))
-> (v1 -> v2)
-> Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v1)))
-> Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v2)))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n4 k2 (Tensor n5 k3 v1) -> Tensor n4 k2 (Tensor n5 k3 v2))
-> Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v1))
-> Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v2))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Tensor n4 k2 (Tensor n5 k3 v1) -> Tensor n4 k2 (Tensor n5 k3 v2))
-> Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v1))
-> Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v2)))
-> ((v1 -> v2)
-> Tensor n4 k2 (Tensor n5 k3 v1)
-> Tensor n4 k2 (Tensor n5 k3 v2))
-> (v1 -> v2)
-> Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v1))
-> Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v2))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n5 k3 v1 -> Tensor n5 k3 v2)
-> Tensor n4 k2 (Tensor n5 k3 v1) -> Tensor n4 k2 (Tensor n5 k3 v2)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Tensor n5 k3 v1 -> Tensor n5 k3 v2)
-> Tensor n4 k2 (Tensor n5 k3 v1)
-> Tensor n4 k2 (Tensor n5 k3 v2))
-> ((v1 -> v2) -> Tensor n5 k3 v1 -> Tensor n5 k3 v2)
-> (v1 -> v2)
-> Tensor n4 k2 (Tensor n5 k3 v1)
-> Tensor n4 k2 (Tensor n5 k3 v2)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (v1 -> v2) -> Tensor n5 k3 v1 -> Tensor n5 k3 v2
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap
mapTo6 :: (v1 -> v2) -> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v1 -> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v2
mapTo6 :: (v1 -> v2)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v1
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v2
mapTo6 = (Tensor
n2
k1
(Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v1))))
-> Tensor
n2
k1
(Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v2)))))
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v1
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v2
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Tensor
n2
k1
(Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v1))))
-> Tensor
n2
k1
(Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v2)))))
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v1
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v2)
-> ((v1 -> v2)
-> Tensor
n2
k1
(Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v1))))
-> Tensor
n2
k1
(Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v2)))))
-> (v1 -> v2)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v1
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v2
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v1)))
-> Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v2))))
-> Tensor
n2
k1
(Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v1))))
-> Tensor
n2
k1
(Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v2))))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v1)))
-> Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v2))))
-> Tensor
n2
k1
(Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v1))))
-> Tensor
n2
k1
(Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v2)))))
-> ((v1 -> v2)
-> Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v1)))
-> Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v2))))
-> (v1 -> v2)
-> Tensor
n2
k1
(Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v1))))
-> Tensor
n2
k1
(Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v2))))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v1))
-> Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v2)))
-> Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v1)))
-> Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v2)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v1))
-> Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v2)))
-> Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v1)))
-> Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v2))))
-> ((v1 -> v2)
-> Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v1))
-> Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v2)))
-> (v1 -> v2)
-> Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v1)))
-> Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v2)))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n5 k3 (Tensor n6 k3 v1) -> Tensor n5 k3 (Tensor n6 k3 v2))
-> Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v1))
-> Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v2))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Tensor n5 k3 (Tensor n6 k3 v1) -> Tensor n5 k3 (Tensor n6 k3 v2))
-> Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v1))
-> Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v2)))
-> ((v1 -> v2)
-> Tensor n5 k3 (Tensor n6 k3 v1)
-> Tensor n5 k3 (Tensor n6 k3 v2))
-> (v1 -> v2)
-> Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v1))
-> Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v2))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n6 k3 v1 -> Tensor n6 k3 v2)
-> Tensor n5 k3 (Tensor n6 k3 v1) -> Tensor n5 k3 (Tensor n6 k3 v2)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Tensor n6 k3 v1 -> Tensor n6 k3 v2)
-> Tensor n5 k3 (Tensor n6 k3 v1)
-> Tensor n5 k3 (Tensor n6 k3 v2))
-> ((v1 -> v2) -> Tensor n6 k3 v1 -> Tensor n6 k3 v2)
-> (v1 -> v2)
-> Tensor n5 k3 (Tensor n6 k3 v1)
-> Tensor n5 k3 (Tensor n6 k3 v2)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (v1 -> v2) -> Tensor n6 k3 v1 -> Tensor n6 k3 v2
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap
mapTo7 :: (v1 -> v2) -> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v1 -> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v2
mapTo7 :: (v1 -> v2)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v1
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v2
mapTo7 = (Tensor
n2
k1
(Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v1)))))
-> Tensor
n2
k1
(Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v2))))))
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v1
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v2
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Tensor
n2
k1
(Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v1)))))
-> Tensor
n2
k1
(Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v2))))))
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v1
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v2)
-> ((v1 -> v2)
-> Tensor
n2
k1
(Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v1)))))
-> Tensor
n2
k1
(Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v2))))))
-> (v1 -> v2)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v1
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v2
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v1))))
-> Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v2)))))
-> Tensor
n2
k1
(Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v1)))))
-> Tensor
n2
k1
(Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v2)))))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v1))))
-> Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v2)))))
-> Tensor
n2
k1
(Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v1)))))
-> Tensor
n2
k1
(Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v2))))))
-> ((v1 -> v2)
-> Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v1))))
-> Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v2)))))
-> (v1 -> v2)
-> Tensor
n2
k1
(Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v1)))))
-> Tensor
n2
k1
(Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v2)))))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v1)))
-> Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v2))))
-> Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v1))))
-> Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v2))))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v1)))
-> Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v2))))
-> Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v1))))
-> Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v2)))))
-> ((v1 -> v2)
-> Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v1)))
-> Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v2))))
-> (v1 -> v2)
-> Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v1))))
-> Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v2))))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v1))
-> Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v2)))
-> Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v1)))
-> Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v2)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v1))
-> Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v2)))
-> Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v1)))
-> Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v2))))
-> ((v1 -> v2)
-> Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v1))
-> Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v2)))
-> (v1 -> v2)
-> Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v1)))
-> Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v2)))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n6 k3 (Tensor n7 k4 v1) -> Tensor n6 k3 (Tensor n7 k4 v2))
-> Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v1))
-> Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v2))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Tensor n6 k3 (Tensor n7 k4 v1) -> Tensor n6 k3 (Tensor n7 k4 v2))
-> Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v1))
-> Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v2)))
-> ((v1 -> v2)
-> Tensor n6 k3 (Tensor n7 k4 v1)
-> Tensor n6 k3 (Tensor n7 k4 v2))
-> (v1 -> v2)
-> Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v1))
-> Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v2))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n7 k4 v1 -> Tensor n7 k4 v2)
-> Tensor n6 k3 (Tensor n7 k4 v1) -> Tensor n6 k3 (Tensor n7 k4 v2)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Tensor n7 k4 v1 -> Tensor n7 k4 v2)
-> Tensor n6 k3 (Tensor n7 k4 v1)
-> Tensor n6 k3 (Tensor n7 k4 v2))
-> ((v1 -> v2) -> Tensor n7 k4 v1 -> Tensor n7 k4 v2)
-> (v1 -> v2)
-> Tensor n6 k3 (Tensor n7 k4 v1)
-> Tensor n6 k3 (Tensor n7 k4 v2)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (v1 -> v2) -> Tensor n7 k4 v1 -> Tensor n7 k4 v2
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap
mapTo8 :: (v1 -> v2) -> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v1 -> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v2
mapTo8 :: (v1 -> v2)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v1
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v2
mapTo8 = (Tensor
n2
k1
(Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v1))))))
-> Tensor
n2
k1
(Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v2)))))))
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v1
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v2
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Tensor
n2
k1
(Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v1))))))
-> Tensor
n2
k1
(Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v2)))))))
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v1
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v2)
-> ((v1 -> v2)
-> Tensor
n2
k1
(Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v1))))))
-> Tensor
n2
k1
(Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v2)))))))
-> (v1 -> v2)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v1
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v2
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v1)))))
-> Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v2))))))
-> Tensor
n2
k1
(Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v1))))))
-> Tensor
n2
k1
(Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v2))))))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v1)))))
-> Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v2))))))
-> Tensor
n2
k1
(Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v1))))))
-> Tensor
n2
k1
(Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v2)))))))
-> ((v1 -> v2)
-> Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v1)))))
-> Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v2))))))
-> (v1 -> v2)
-> Tensor
n2
k1
(Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v1))))))
-> Tensor
n2
k1
(Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v2))))))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v1))))
-> Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v2)))))
-> Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v1)))))
-> Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v2)))))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v1))))
-> Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v2)))))
-> Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v1)))))
-> Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v2))))))
-> ((v1 -> v2)
-> Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v1))))
-> Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v2)))))
-> (v1 -> v2)
-> Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v1)))))
-> Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v2)))))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v1)))
-> Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v2))))
-> Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v1))))
-> Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v2))))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v1)))
-> Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v2))))
-> Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v1))))
-> Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v2)))))
-> ((v1 -> v2)
-> Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v1)))
-> Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v2))))
-> (v1 -> v2)
-> Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v1))))
-> Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v2))))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v1))
-> Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v2)))
-> Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v1)))
-> Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v2)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v1))
-> Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v2)))
-> Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v1)))
-> Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v2))))
-> ((v1 -> v2)
-> Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v1))
-> Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v2)))
-> (v1 -> v2)
-> Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v1)))
-> Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v2)))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n7 k4 (Tensor n8 k4 v1) -> Tensor n7 k4 (Tensor n8 k4 v2))
-> Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v1))
-> Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v2))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Tensor n7 k4 (Tensor n8 k4 v1) -> Tensor n7 k4 (Tensor n8 k4 v2))
-> Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v1))
-> Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v2)))
-> ((v1 -> v2)
-> Tensor n7 k4 (Tensor n8 k4 v1)
-> Tensor n7 k4 (Tensor n8 k4 v2))
-> (v1 -> v2)
-> Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v1))
-> Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v2))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n8 k4 v1 -> Tensor n8 k4 v2)
-> Tensor n7 k4 (Tensor n8 k4 v1) -> Tensor n7 k4 (Tensor n8 k4 v2)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Tensor n8 k4 v1 -> Tensor n8 k4 v2)
-> Tensor n7 k4 (Tensor n8 k4 v1)
-> Tensor n7 k4 (Tensor n8 k4 v2))
-> ((v1 -> v2) -> Tensor n8 k4 v1 -> Tensor n8 k4 v2)
-> (v1 -> v2)
-> Tensor n7 k4 (Tensor n8 k4 v1)
-> Tensor n7 k4 (Tensor n8 k4 v2)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (v1 -> v2) -> Tensor n8 k4 v1 -> Tensor n8 k4 v2
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap
removeZeros :: TAdd v => Tensor n k v -> Tensor n k v
removeZeros :: Tensor n k v -> Tensor n k v
removeZeros (Scalar v
x) = if v -> Bool
forall a. TAdd a => a -> Bool
scaleZero v
x then Tensor n k v
forall (n :: Nat) k v. Tensor n k v
ZeroTensor else v -> Tensor 0 k v
forall v k. v -> Tensor 0 k v
Scalar v
x
removeZeros (Tensor TMap k (Tensor n k v)
m) = let newMap :: TMap k (Tensor n k v)
newMap = (Tensor n k v -> Bool)
-> TMap k (Tensor n k v) -> TMap k (Tensor n k v)
forall v k. (v -> Bool) -> TMap k v -> TMap k v
filterTMap
(\case
Tensor n k v
ZeroTensor -> Bool
False
Tensor n k v
_ -> Bool
True) (TMap k (Tensor n k v) -> TMap k (Tensor n k v))
-> TMap k (Tensor n k v) -> TMap k (Tensor n k v)
forall a b. (a -> b) -> a -> b
$ (Tensor n k v -> Tensor n k v)
-> TMap k (Tensor n k v) -> TMap k (Tensor n k v)
forall v v' k. (v -> v') -> TMap k v -> TMap k v'
mapTMap Tensor n k v -> Tensor n k v
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros TMap k (Tensor n k v)
m in if TMap k (Tensor n k v) -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null TMap k (Tensor n k v)
newMap then Tensor n k v
forall (n :: Nat) k v. Tensor n k v
ZeroTensor else TMap k (Tensor n k v) -> Tensor (n + 1) k v
forall k (n :: Nat) v. TMap k (Tensor n k v) -> Tensor (n + 1) k v
Tensor TMap k (Tensor n k v)
newMap
removeZeros Tensor n k v
ZeroTensor = Tensor n k v
forall (n :: Nat) k v. Tensor n k v
ZeroTensor
removeZeros1 :: (TAdd v, TIndex k) => AbsTensor1 n1 k v -> AbsTensor1 n1 k v
removeZeros1 :: AbsTensor1 n1 k v -> AbsTensor1 n1 k v
removeZeros1 = AbsTensor1 n1 k v -> AbsTensor1 n1 k v
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros
removeZeros2 :: (TAdd v, TIndex k) => AbsTensor2 n1 n2 k v -> AbsTensor2 n1 n2 k v
removeZeros2 :: AbsTensor2 n1 n2 k v -> AbsTensor2 n1 n2 k v
removeZeros2 = AbsTensor2 n1 n2 k v -> AbsTensor2 n1 n2 k v
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros (AbsTensor2 n1 n2 k v -> AbsTensor2 n1 n2 k v)
-> (AbsTensor2 n1 n2 k v -> AbsTensor2 n1 n2 k v)
-> AbsTensor2 n1 n2 k v
-> AbsTensor2 n1 n2 k v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n2 k v -> Tensor n2 k v)
-> AbsTensor2 n1 n2 k v -> AbsTensor2 n1 n2 k v
forall v1 v2 (n1 :: Nat) k.
(v1 -> v2) -> Tensor n1 k v1 -> Tensor n1 k v2
mapTo1 Tensor n2 k v -> Tensor n2 k v
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros
removeZeros3 :: (TAdd v, TIndex k1, TIndex k2) => AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v
removeZeros3 :: AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v
removeZeros3 = AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros (AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v)
-> (AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v)
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n2 k1 (Tensor n3 k2 v) -> Tensor n2 k1 (Tensor n3 k2 v))
-> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v
forall v1 v2 (n1 :: Nat) k.
(v1 -> v2) -> Tensor n1 k v1 -> Tensor n1 k v2
mapTo1 Tensor n2 k1 (Tensor n3 k2 v) -> Tensor n2 k1 (Tensor n3 k2 v)
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros (AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v)
-> (AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v)
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n3 k2 v -> Tensor n3 k2 v)
-> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) k.
(v1 -> v2) -> Tensor2 n1 n2 k v1 -> Tensor2 n1 n2 k v2
mapTo2 Tensor n3 k2 v -> Tensor n3 k2 v
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros
removeZeros4 :: (TAdd v, TIndex k1, TIndex k2) => AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
removeZeros4 :: AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
removeZeros4 = AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros (AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v)
-> (AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 v))
-> Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 v)))
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall v1 v2 (n1 :: Nat) k.
(v1 -> v2) -> Tensor n1 k v1 -> Tensor n1 k v2
mapTo1 Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 v))
-> Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 v))
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros (AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v)
-> (AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n3 k2 (Tensor n4 k2 v) -> Tensor n3 k2 (Tensor n4 k2 v))
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) k.
(v1 -> v2) -> Tensor2 n1 n2 k v1 -> Tensor2 n1 n2 k v2
mapTo2 Tensor n3 k2 (Tensor n4 k2 v) -> Tensor n3 k2 (Tensor n4 k2 v)
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros (AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v)
-> (AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n4 k2 v -> Tensor n4 k2 v)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor3 n1 n2 n3 k1 k2 v1 -> AbsTensor3 n1 n2 n3 k1 k2 v2
mapTo3 Tensor n4 k2 v -> Tensor n4 k2 v
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros
removeZeros5 :: (TAdd v, TIndex k1, TIndex k2, TIndex k3) => AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v -> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
removeZeros5 :: AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
removeZeros5 = AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros (AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v)
-> (AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v)))
-> Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v))))
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) k.
(v1 -> v2) -> Tensor n1 k v1 -> Tensor n1 k v2
mapTo1 Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v)))
-> Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v)))
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros (AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v)
-> (AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v))
-> Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v)))
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) k.
(v1 -> v2) -> Tensor2 n1 n2 k v1 -> Tensor2 n1 n2 k v2
mapTo2 Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v))
-> Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v))
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros (AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v)
-> (AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n4 k2 (Tensor n5 k3 v) -> Tensor n4 k2 (Tensor n5 k3 v))
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor3 n1 n2 n3 k1 k2 v1 -> AbsTensor3 n1 n2 n3 k1 k2 v2
mapTo3 Tensor n4 k2 (Tensor n5 k3 v) -> Tensor n4 k2 (Tensor n5 k3 v)
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros (AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v)
-> (AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n5 k3 v -> Tensor n5 k3 v)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v1
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v2
mapTo4 Tensor n5 k3 v -> Tensor n5 k3 v
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros
removeZeros6 :: (TAdd v, TIndex k1, TIndex k2, TIndex k3) => AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v -> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
removeZeros6 :: AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
removeZeros6 = AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros (AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v)
-> (AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor
n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v))))
-> Tensor
n2
k1
(Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v)))))
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) k.
(v1 -> v2) -> Tensor n1 k v1 -> Tensor n1 k v2
mapTo1 Tensor
n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v))))
-> Tensor
n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v))))
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros (AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v)
-> (AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v)))
-> Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v))))
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) k.
(v1 -> v2) -> Tensor2 n1 n2 k v1 -> Tensor2 n1 n2 k v2
mapTo2 Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v)))
-> Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v)))
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros (AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v)
-> (AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v))
-> Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v)))
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor3 n1 n2 n3 k1 k2 v1 -> AbsTensor3 n1 n2 n3 k1 k2 v2
mapTo3 Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v))
-> Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v))
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros (AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v)
-> (AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n5 k3 (Tensor n6 k3 v) -> Tensor n5 k3 (Tensor n6 k3 v))
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v1
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v2
mapTo4 Tensor n5 k3 (Tensor n6 k3 v) -> Tensor n5 k3 (Tensor n6 k3 v)
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros (AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v)
-> (AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n6 k3 v -> Tensor n6 k3 v)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v1
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v2
mapTo5 Tensor n6 k3 v -> Tensor n6 k3 v
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros
removeZeros7 :: (TAdd v, TIndex k1, TIndex k2, TIndex k3, TIndex k4) => AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v -> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
removeZeros7 :: AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
removeZeros7 = AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros (AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v)
-> (AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor
n2
k1
(Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))))
-> Tensor
n2
k1
(Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))))))
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) k.
(v1 -> v2) -> Tensor n1 k v1 -> Tensor n1 k v2
mapTo1 Tensor
n2
k1
(Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))))
-> Tensor
n2
k1
(Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))))
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros (AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v)
-> (AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor
n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))))
-> Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))))
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) k.
(v1 -> v2) -> Tensor2 n1 n2 k v1 -> Tensor2 n1 n2 k v2
mapTo2 Tensor
n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))))
-> Tensor
n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))))
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros (AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v)
-> (AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))
-> Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))))
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor3 n1 n2 n3 k1 k2 v1 -> AbsTensor3 n1 n2 n3 k1 k2 v2
mapTo3 Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))
-> Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros (AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v)
-> (AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))
-> Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v1
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v2
mapTo4 Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))
-> Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros (AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v)
-> (AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n6 k3 (Tensor n7 k4 v) -> Tensor n6 k3 (Tensor n7 k4 v))
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v1
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v2
mapTo5 Tensor n6 k3 (Tensor n7 k4 v) -> Tensor n6 k3 (Tensor n7 k4 v)
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros (AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v)
-> (AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n7 k4 v -> Tensor n7 k4 v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v1
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v2
mapTo6 Tensor n7 k4 v -> Tensor n7 k4 v
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros
removeZeros8 :: (TAdd v, TIndex k1, TIndex k2, TIndex k3, TIndex k4) => AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v -> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
removeZeros8 :: AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
removeZeros8 = AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros (AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v)
-> (AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor
n2
k1
(Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))))
-> Tensor
n2
k1
(Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))))))
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) k.
(v1 -> v2) -> Tensor n1 k v1 -> Tensor n1 k v2
mapTo1 Tensor
n2
k1
(Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))))
-> Tensor
n2
k1
(Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))))
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros (AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v)
-> (AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))))
-> Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))))
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) k.
(v1 -> v2) -> Tensor2 n1 n2 k v1 -> Tensor2 n1 n2 k v2
mapTo2 Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))))
-> Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))))
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros (AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v)
-> (AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor
n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))
-> Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))))
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor3 n1 n2 n3 k1 k2 v1 -> AbsTensor3 n1 n2 n3 k1 k2 v2
mapTo3 Tensor
n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))
-> Tensor
n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros (AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v)
-> (AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))
-> Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v1
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v2
mapTo4 Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))
-> Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros (AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v)
-> (AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))
-> Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v1
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v2
mapTo5 Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))
-> Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros (AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v)
-> (AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n7 k4 (Tensor n8 k4 v) -> Tensor n7 k4 (Tensor n8 k4 v))
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v1
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v2
mapTo6 Tensor n7 k4 (Tensor n8 k4 v) -> Tensor n7 k4 (Tensor n8 k4 v)
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros (AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v)
-> (AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Tensor n8 k4 v -> Tensor n8 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) (n7 :: Nat) k1 k2 k3 k4.
(v1 -> v2)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v1
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v2
mapTo7 Tensor n8 k4 v -> Tensor n8 k4 v
forall v (n :: Nat) k. TAdd v => Tensor n k v -> Tensor n k v
removeZeros
tensorTrans :: (TIndex k, TAdd v) => (Int,Int) -> Tensor n k v -> Tensor n k v
tensorTrans :: (Int, Int) -> Tensor n k v -> Tensor n k v
tensorTrans (Int
0, Int
j) Tensor n k v
t = [(IndList n k, v)] -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[(IndList n k, v)] -> Tensor n k v
fromListT [(IndList n k, v)]
l
where
l :: [(IndList n k, v)]
l = ((IndList n k, v) -> (IndList n k, v))
-> [(IndList n k, v)] -> [(IndList n k, v)]
forall a b. (a -> b) -> [a] -> [b]
map (\(IndList n k
x,v
y) -> (Int -> IndList n k -> IndList n k
forall (n :: Nat) b. Int -> IndList n b -> IndList n b
swapHead Int
j IndList n k
x, v
y)) ([(IndList n k, v)] -> [(IndList n k, v)])
-> [(IndList n k, v)] -> [(IndList n k, v)]
forall a b. (a -> b) -> a -> b
$ Tensor n k v -> [(IndList n k, v)]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor n k v
t
tensorTrans (Int
i, Int
j) (Tensor TMap k (Tensor n k v)
m) = TMap k (Tensor n k v) -> Tensor (n + 1) k v
forall k (n :: Nat) v. TMap k (Tensor n k v) -> Tensor (n + 1) k v
Tensor (TMap k (Tensor n k v) -> Tensor (n + 1) k v)
-> TMap k (Tensor n k v) -> Tensor (n + 1) k v
forall a b. (a -> b) -> a -> b
$ (Tensor n k v -> Tensor n k v)
-> TMap k (Tensor n k v) -> TMap k (Tensor n k v)
forall v v' k. (v -> v') -> TMap k v -> TMap k v'
mapTMap ((Int, Int) -> Tensor n k v -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
tensorTrans (Int
iInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1, Int
jInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1)) TMap k (Tensor n k v)
m
tensorTrans (Int, Int)
_ Tensor n k v
ZeroTensor = Tensor n k v
forall (n :: Nat) k v. Tensor n k v
ZeroTensor
tensorTrans (Int, Int)
_ (Scalar v
_) = String -> Tensor n k v
forall a. HasCallStack => String -> a
error String
"attempt to transpose using a non-existing index"
tensorTrans1 :: (TIndex k1, TAdd v) => (Int,Int) -> AbsTensor1 n1 k1 v -> AbsTensor1 n1 k1 v
tensorTrans1 :: (Int, Int) -> AbsTensor1 n1 k1 v -> AbsTensor1 n1 k1 v
tensorTrans1 = (Int, Int) -> AbsTensor1 n1 k1 v -> AbsTensor1 n1 k1 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
tensorTrans
tensorTrans2 :: (TIndex k1, TAdd v) => (Int,Int) -> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v
tensorTrans2 :: (Int, Int) -> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v
tensorTrans2 = (Tensor n2 k1 v -> Tensor n2 k1 v)
-> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v
forall v1 v2 (n1 :: Nat) k.
(v1 -> v2) -> Tensor n1 k v1 -> Tensor n1 k v2
mapTo1 ((Tensor n2 k1 v -> Tensor n2 k1 v)
-> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v)
-> ((Int, Int) -> Tensor n2 k1 v -> Tensor n2 k1 v)
-> (Int, Int)
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int) -> Tensor n2 k1 v -> Tensor n2 k1 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
tensorTrans
tensorTrans3 :: (TIndex k1, TIndex k2, TAdd v) => (Int,Int) -> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v
tensorTrans3 :: (Int, Int)
-> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v
tensorTrans3 = (Tensor n3 k2 v -> Tensor n3 k2 v)
-> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) k.
(v1 -> v2) -> Tensor2 n1 n2 k v1 -> Tensor2 n1 n2 k v2
mapTo2 ((Tensor n3 k2 v -> Tensor n3 k2 v)
-> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v)
-> ((Int, Int) -> Tensor n3 k2 v -> Tensor n3 k2 v)
-> (Int, Int)
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int) -> Tensor n3 k2 v -> Tensor n3 k2 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
tensorTrans
tensorTrans4 :: (TIndex k1, TIndex k2, TAdd v) => (Int,Int) -> AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
tensorTrans4 :: (Int, Int)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
tensorTrans4 = (Tensor n4 k2 v -> Tensor n4 k2 v)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor3 n1 n2 n3 k1 k2 v1 -> AbsTensor3 n1 n2 n3 k1 k2 v2
mapTo3 ((Tensor n4 k2 v -> Tensor n4 k2 v)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v)
-> ((Int, Int) -> Tensor n4 k2 v -> Tensor n4 k2 v)
-> (Int, Int)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int) -> Tensor n4 k2 v -> Tensor n4 k2 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
tensorTrans
tensorTrans5 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v) => (Int,Int) -> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v -> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
tensorTrans5 :: (Int, Int)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
tensorTrans5 = (Tensor n5 k3 v -> Tensor n5 k3 v)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v1
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v2
mapTo4 ((Tensor n5 k3 v -> Tensor n5 k3 v)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v)
-> ((Int, Int) -> Tensor n5 k3 v -> Tensor n5 k3 v)
-> (Int, Int)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int) -> Tensor n5 k3 v -> Tensor n5 k3 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
tensorTrans
tensorTrans6 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v) => (Int,Int) -> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v -> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
tensorTrans6 :: (Int, Int)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
tensorTrans6 = (Tensor n6 k3 v -> Tensor n6 k3 v)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v1
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v2
mapTo5 ((Tensor n6 k3 v -> Tensor n6 k3 v)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v)
-> ((Int, Int) -> Tensor n6 k3 v -> Tensor n6 k3 v)
-> (Int, Int)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int) -> Tensor n6 k3 v -> Tensor n6 k3 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
tensorTrans
tensorTrans7 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) => (Int,Int) -> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v -> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
tensorTrans7 :: (Int, Int)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
tensorTrans7 = (Tensor n7 k4 v -> Tensor n7 k4 v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v1
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v2
mapTo6 ((Tensor n7 k4 v -> Tensor n7 k4 v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v)
-> ((Int, Int) -> Tensor n7 k4 v -> Tensor n7 k4 v)
-> (Int, Int)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int) -> Tensor n7 k4 v -> Tensor n7 k4 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
tensorTrans
tensorTrans8 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) => (Int,Int) -> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v -> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
tensorTrans8 :: (Int, Int)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
tensorTrans8 = (Tensor n8 k4 v -> Tensor n8 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) (n7 :: Nat) k1 k2 k3 k4.
(v1 -> v2)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v1
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v2
mapTo7 ((Tensor n8 k4 v -> Tensor n8 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v)
-> ((Int, Int) -> Tensor n8 k4 v -> Tensor n8 k4 v)
-> (Int, Int)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int) -> Tensor n8 k4 v -> Tensor n8 k4 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
tensorTrans
tensorBlockTrans :: (TIndex k, TAdd v) => ([Int],[Int]) -> Tensor n k v -> Tensor n k v
tensorBlockTrans :: ([Int], [Int]) -> Tensor n k v -> Tensor n k v
tensorBlockTrans ([Int]
l1,[Int]
l2) Tensor n k v
t = ((Int, Int) -> Tensor n k v -> Tensor n k v)
-> Tensor n k v -> [(Int, Int)] -> Tensor n k v
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr (Int, Int) -> Tensor n k v -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
tensorTrans Tensor n k v
t [(Int, Int)]
indList
where
indList :: [(Int, Int)]
indList = if [Int] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null ([Int] -> Bool) -> [Int] -> Bool
forall a b. (a -> b) -> a -> b
$ [Int] -> [Int] -> [Int]
forall a. Eq a => [a] -> [a] -> [a]
intersect [Int]
l1 [Int]
l2 then [Int] -> [Int] -> [(Int, Int)]
forall a b. [a] -> [b] -> [(a, b)]
zip [Int]
l1 [Int]
l2 else String -> [(Int, Int)]
forall a. HasCallStack => String -> a
error String
"at least one index in the list occurs several times"
tensorBlockTrans1 :: (TIndex k1, TAdd v) => ([Int],[Int]) -> AbsTensor1 n1 k1 v -> AbsTensor1 n1 k1 v
tensorBlockTrans1 :: ([Int], [Int]) -> AbsTensor1 n1 k1 v -> AbsTensor1 n1 k1 v
tensorBlockTrans1 = ([Int], [Int]) -> AbsTensor1 n1 k1 v -> AbsTensor1 n1 k1 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
([Int], [Int]) -> Tensor n k v -> Tensor n k v
tensorBlockTrans
tensorBlockTrans2 :: (TIndex k1, TAdd v) => ([Int],[Int]) -> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v
tensorBlockTrans2 :: ([Int], [Int]) -> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v
tensorBlockTrans2 = (Tensor n2 k1 v -> Tensor n2 k1 v)
-> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v
forall v1 v2 (n1 :: Nat) k.
(v1 -> v2) -> Tensor n1 k v1 -> Tensor n1 k v2
mapTo1 ((Tensor n2 k1 v -> Tensor n2 k1 v)
-> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v)
-> (([Int], [Int]) -> Tensor n2 k1 v -> Tensor n2 k1 v)
-> ([Int], [Int])
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int]) -> Tensor n2 k1 v -> Tensor n2 k1 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
([Int], [Int]) -> Tensor n k v -> Tensor n k v
tensorBlockTrans
tensorBlockTrans3 :: (TIndex k1, TIndex k2, TAdd v) => ([Int],[Int]) -> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v
tensorBlockTrans3 :: ([Int], [Int])
-> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v
tensorBlockTrans3 = (Tensor n3 k2 v -> Tensor n3 k2 v)
-> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) k.
(v1 -> v2) -> Tensor2 n1 n2 k v1 -> Tensor2 n1 n2 k v2
mapTo2 ((Tensor n3 k2 v -> Tensor n3 k2 v)
-> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v)
-> (([Int], [Int]) -> Tensor n3 k2 v -> Tensor n3 k2 v)
-> ([Int], [Int])
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int]) -> Tensor n3 k2 v -> Tensor n3 k2 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
([Int], [Int]) -> Tensor n k v -> Tensor n k v
tensorBlockTrans
tensorBlockTrans4 :: (TIndex k1, TIndex k2, TAdd v) => ([Int],[Int]) -> AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
tensorBlockTrans4 :: ([Int], [Int])
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
tensorBlockTrans4 = (Tensor n4 k2 v -> Tensor n4 k2 v)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor3 n1 n2 n3 k1 k2 v1 -> AbsTensor3 n1 n2 n3 k1 k2 v2
mapTo3 ((Tensor n4 k2 v -> Tensor n4 k2 v)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v)
-> (([Int], [Int]) -> Tensor n4 k2 v -> Tensor n4 k2 v)
-> ([Int], [Int])
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int]) -> Tensor n4 k2 v -> Tensor n4 k2 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
([Int], [Int]) -> Tensor n k v -> Tensor n k v
tensorBlockTrans
tensorBlockTrans5 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v) => ([Int],[Int]) -> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v -> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
tensorBlockTrans5 :: ([Int], [Int])
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
tensorBlockTrans5 = (Tensor n5 k3 v -> Tensor n5 k3 v)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v1
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v2
mapTo4 ((Tensor n5 k3 v -> Tensor n5 k3 v)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v)
-> (([Int], [Int]) -> Tensor n5 k3 v -> Tensor n5 k3 v)
-> ([Int], [Int])
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int]) -> Tensor n5 k3 v -> Tensor n5 k3 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
([Int], [Int]) -> Tensor n k v -> Tensor n k v
tensorBlockTrans
tensorBlockTrans6 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v) => ([Int],[Int]) -> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v -> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
tensorBlockTrans6 :: ([Int], [Int])
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
tensorBlockTrans6 = (Tensor n6 k3 v -> Tensor n6 k3 v)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v1
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v2
mapTo5 ((Tensor n6 k3 v -> Tensor n6 k3 v)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v)
-> (([Int], [Int]) -> Tensor n6 k3 v -> Tensor n6 k3 v)
-> ([Int], [Int])
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int]) -> Tensor n6 k3 v -> Tensor n6 k3 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
([Int], [Int]) -> Tensor n k v -> Tensor n k v
tensorBlockTrans
tensorBlockTrans7 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) => ([Int],[Int]) -> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v -> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
tensorBlockTrans7 :: ([Int], [Int])
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
tensorBlockTrans7 = (Tensor n7 k4 v -> Tensor n7 k4 v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v1
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v2
mapTo6 ((Tensor n7 k4 v -> Tensor n7 k4 v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v)
-> (([Int], [Int]) -> Tensor n7 k4 v -> Tensor n7 k4 v)
-> ([Int], [Int])
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int]) -> Tensor n7 k4 v -> Tensor n7 k4 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
([Int], [Int]) -> Tensor n k v -> Tensor n k v
tensorBlockTrans
tensorBlockTrans8 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) => ([Int],[Int]) -> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v -> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
tensorBlockTrans8 :: ([Int], [Int])
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
tensorBlockTrans8 = (Tensor n8 k4 v -> Tensor n8 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) (n7 :: Nat) k1 k2 k3 k4.
(v1 -> v2)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v1
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v2
mapTo7 ((Tensor n8 k4 v -> Tensor n8 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v)
-> (([Int], [Int]) -> Tensor n8 k4 v -> Tensor n8 k4 v)
-> ([Int], [Int])
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int]) -> Tensor n8 k4 v -> Tensor n8 k4 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
([Int], [Int]) -> Tensor n k v -> Tensor n k v
tensorBlockTrans
resortTens :: (KnownNat n, TIndex k, TAdd v) => [Int] -> Tensor n k v -> Tensor n k v
resortTens :: [Int] -> Tensor n k v -> Tensor n k v
resortTens [Int]
perm Tensor n k v
t = [(IndList n k, v)] -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[(IndList n k, v)] -> Tensor n k v
fromListT ([(IndList n k, v)] -> Tensor n k v)
-> [(IndList n k, v)] -> Tensor n k v
forall a b. (a -> b) -> a -> b
$ ((IndList n k, v) -> (IndList n k, v))
-> [(IndList n k, v)] -> [(IndList n k, v)]
forall a b. (a -> b) -> [a] -> [b]
map (\(IndList n k
x,v
y) -> ([Int] -> IndList n k -> IndList n k
forall (n :: Nat) a.
(KnownNat n, Ord a) =>
[Int] -> IndList n a -> IndList n a
resortInd [Int]
perm IndList n k
x, v
y)) ([(IndList n k, v)] -> [(IndList n k, v)])
-> [(IndList n k, v)] -> [(IndList n k, v)]
forall a b. (a -> b) -> a -> b
$ Tensor n k v -> [(IndList n k, v)]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor n k v
t
resortTens1 :: (KnownNat n1, TIndex k1, TAdd v) => [Int] -> AbsTensor1 n1 k1 v -> AbsTensor1 n1 k1 v
resortTens1 :: [Int] -> AbsTensor1 n1 k1 v -> AbsTensor1 n1 k1 v
resortTens1 = [Int] -> AbsTensor1 n1 k1 v -> AbsTensor1 n1 k1 v
forall (n :: Nat) k v.
(KnownNat n, TIndex k, TAdd v) =>
[Int] -> Tensor n k v -> Tensor n k v
resortTens
resortTens2 :: (KnownNat n2, TIndex k1, TAdd v) => [Int] -> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v
resortTens2 :: [Int] -> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v
resortTens2 = (Tensor n2 k1 v -> Tensor n2 k1 v)
-> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v
forall v1 v2 (n1 :: Nat) k.
(v1 -> v2) -> Tensor n1 k v1 -> Tensor n1 k v2
mapTo1 ((Tensor n2 k1 v -> Tensor n2 k1 v)
-> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v)
-> ([Int] -> Tensor n2 k1 v -> Tensor n2 k1 v)
-> [Int]
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n2 k1 v -> Tensor n2 k1 v
forall (n :: Nat) k v.
(KnownNat n, TIndex k, TAdd v) =>
[Int] -> Tensor n k v -> Tensor n k v
resortTens
resortTens3 :: (KnownNat n3, TIndex k1, TIndex k2, TAdd v) => [Int] -> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v
resortTens3 :: [Int] -> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v
resortTens3 = (Tensor n3 k2 v -> Tensor n3 k2 v)
-> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) k.
(v1 -> v2) -> Tensor2 n1 n2 k v1 -> Tensor2 n1 n2 k v2
mapTo2 ((Tensor n3 k2 v -> Tensor n3 k2 v)
-> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v)
-> ([Int] -> Tensor n3 k2 v -> Tensor n3 k2 v)
-> [Int]
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n3 k2 v -> Tensor n3 k2 v
forall (n :: Nat) k v.
(KnownNat n, TIndex k, TAdd v) =>
[Int] -> Tensor n k v -> Tensor n k v
resortTens
resortTens4 :: (KnownNat n4, TIndex k1, TIndex k2, TAdd v) => [Int] -> AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
resortTens4 :: [Int]
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
resortTens4 = (Tensor n4 k2 v -> Tensor n4 k2 v)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor3 n1 n2 n3 k1 k2 v1 -> AbsTensor3 n1 n2 n3 k1 k2 v2
mapTo3 ((Tensor n4 k2 v -> Tensor n4 k2 v)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v)
-> ([Int] -> Tensor n4 k2 v -> Tensor n4 k2 v)
-> [Int]
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n4 k2 v -> Tensor n4 k2 v
forall (n :: Nat) k v.
(KnownNat n, TIndex k, TAdd v) =>
[Int] -> Tensor n k v -> Tensor n k v
resortTens
resortTens5 :: (KnownNat n5, TIndex k1, TIndex k2, TIndex k3, TAdd v) => [Int] -> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v -> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
resortTens5 :: [Int]
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
resortTens5 = (Tensor n5 k3 v -> Tensor n5 k3 v)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v1
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v2
mapTo4 ((Tensor n5 k3 v -> Tensor n5 k3 v)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v)
-> ([Int] -> Tensor n5 k3 v -> Tensor n5 k3 v)
-> [Int]
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n5 k3 v -> Tensor n5 k3 v
forall (n :: Nat) k v.
(KnownNat n, TIndex k, TAdd v) =>
[Int] -> Tensor n k v -> Tensor n k v
resortTens
resortTens6 :: (KnownNat n6, TIndex k1, TIndex k2, TIndex k3, TAdd v) => [Int] -> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v -> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
resortTens6 :: [Int]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
resortTens6 = (Tensor n6 k3 v -> Tensor n6 k3 v)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v1
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v2
mapTo5 ((Tensor n6 k3 v -> Tensor n6 k3 v)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v)
-> ([Int] -> Tensor n6 k3 v -> Tensor n6 k3 v)
-> [Int]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n6 k3 v -> Tensor n6 k3 v
forall (n :: Nat) k v.
(KnownNat n, TIndex k, TAdd v) =>
[Int] -> Tensor n k v -> Tensor n k v
resortTens
resortTens7 :: (KnownNat n7, TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) => [Int] -> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v -> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
resortTens7 :: [Int]
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
resortTens7 = (Tensor n7 k4 v -> Tensor n7 k4 v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v1
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v2
mapTo6 ((Tensor n7 k4 v -> Tensor n7 k4 v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v)
-> ([Int] -> Tensor n7 k4 v -> Tensor n7 k4 v)
-> [Int]
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n7 k4 v -> Tensor n7 k4 v
forall (n :: Nat) k v.
(KnownNat n, TIndex k, TAdd v) =>
[Int] -> Tensor n k v -> Tensor n k v
resortTens
resortTens8 :: (KnownNat n8, TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) => [Int] -> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v -> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
resortTens8 :: [Int]
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
resortTens8 = (Tensor n8 k4 v -> Tensor n8 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) (n7 :: Nat) k1 k2 k3 k4.
(v1 -> v2)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v1
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v2
mapTo7 ((Tensor n8 k4 v -> Tensor n8 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v)
-> ([Int] -> Tensor n8 k4 v -> Tensor n8 k4 v)
-> [Int]
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n8 k4 v -> Tensor n8 k4 v
forall (n :: Nat) k v.
(KnownNat n, TIndex k, TAdd v) =>
[Int] -> Tensor n k v -> Tensor n k v
resortTens
evalTens :: (KnownNat n, 1<=n, TIndex k, TAdd v) => Int -> k -> Tensor n k v -> Tensor (n-1) k v
evalTens :: Int -> k -> Tensor n k v -> Tensor (n - 1) k v
evalTens Int
ind k
indVal (Tensor TMap k (Tensor n k v)
m)
| Int
ind Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
> Int
size Int -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1 Bool -> Bool -> Bool
|| Int
ind Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
< Int
0 = String -> Tensor (n - 1) k v
forall a. HasCallStack => String -> a
error String
"wrong index to evaluate"
| Int
ind Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
0 = Tensor n k v -> Maybe (Tensor n k v) -> Tensor n k v
forall a. a -> Maybe a -> a
fromMaybe Tensor n k v
forall (n :: Nat) k v. Tensor n k v
ZeroTensor (Maybe (Tensor n k v) -> Tensor n k v)
-> Maybe (Tensor n k v) -> Tensor n k v
forall a b. (a -> b) -> a -> b
$ k -> TMap k (Tensor n k v) -> Maybe (Tensor n k v)
forall a b. Eq a => a -> [(a, b)] -> Maybe b
lookup k
indVal TMap k (Tensor n k v)
m
| Bool
otherwise = Tensor n k v -> Maybe (Tensor n k v) -> Tensor n k v
forall a. a -> Maybe a -> a
fromMaybe Tensor n k v
forall (n :: Nat) k v. Tensor n k v
ZeroTensor (Maybe (Tensor n k v) -> Tensor n k v)
-> Maybe (Tensor n k v) -> Tensor n k v
forall a b. (a -> b) -> a -> b
$ k -> TMap k (Tensor n k v) -> Maybe (Tensor n k v)
forall a b. Eq a => a -> [(a, b)] -> Maybe b
lookup k
indVal (Tensor n k v -> TMap k (Tensor (n - 1) k v)
forall (n :: Nat) k v.
(1 <= n) =>
Tensor n k v -> TMap k (Tensor (n - 1) k v)
getTensorMap Tensor n k v
newTens)
where
size :: Int
size = [Int] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length ([Int] -> Int) -> [Int] -> Int
forall a b. (a -> b) -> a -> b
$ ([Int], v) -> [Int]
forall a b. (a, b) -> a
fst (([Int], v) -> [Int]) -> ([Int], v) -> [Int]
forall a b. (a -> b) -> a -> b
$ [([Int], v)] -> ([Int], v)
forall a. [a] -> a
head ([([Int], v)] -> ([Int], v)) -> [([Int], v)] -> ([Int], v)
forall a b. (a -> b) -> a -> b
$ Tensor n k v -> [([Int], v)]
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
Tensor n k v -> [([Int], v)]
toListT' (TMap k (Tensor n k v) -> Tensor (n + 1) k v
forall k (n :: Nat) v. TMap k (Tensor n k v) -> Tensor (n + 1) k v
Tensor TMap k (Tensor n k v)
m)
l :: [Int]
l = [Int
1..Int
ind] [Int] -> [Int] -> [Int]
forall a. [a] -> [a] -> [a]
++ Int
0 Int -> [Int] -> [Int]
forall a. a -> [a] -> [a]
: [Int
indInt -> Int -> Int
forall a. Num a => a -> a -> a
+Int
1..Int
size Int -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1]
newTens :: Tensor n k v
newTens = [Int] -> Tensor n k v -> Tensor n k v
forall (n :: Nat) k v.
(KnownNat n, TIndex k, TAdd v) =>
[Int] -> Tensor n k v -> Tensor n k v
resortTens [Int]
l (TMap k (Tensor n k v) -> Tensor (n + 1) k v
forall k (n :: Nat) v. TMap k (Tensor n k v) -> Tensor (n + 1) k v
Tensor TMap k (Tensor n k v)
m)
evalTens Int
_ k
_ Tensor n k v
ZeroTensor = Tensor (n - 1) k v
forall (n :: Nat) k v. Tensor n k v
ZeroTensor
evalTens1 :: (KnownNat n1, TIndex k1, TAdd v) => Int -> k1 -> AbsTensor1 (n1+1) k1 v -> AbsTensor1 n1 k1 v
evalTens1 :: Int -> k1 -> AbsTensor1 (n1 + 1) k1 v -> AbsTensor1 n1 k1 v
evalTens1 = Int -> k1 -> AbsTensor1 (n1 + 1) k1 v -> AbsTensor1 n1 k1 v
forall (n :: Nat) k v.
(KnownNat n, 1 <= n, TIndex k, TAdd v) =>
Int -> k -> Tensor n k v -> Tensor (n - 1) k v
evalTens
evalTens2 :: (KnownNat n2, TIndex k1, TAdd v) => Int -> k1 -> AbsTensor2 n1 (n2+1) k1 v -> AbsTensor2 n1 n2 k1 v
evalTens2 :: Int -> k1 -> AbsTensor2 n1 (n2 + 1) k1 v -> AbsTensor2 n1 n2 k1 v
evalTens2 Int
ind k1
indVal = (Tensor (n2 + 1) k1 v -> Tensor n2 k1 v)
-> AbsTensor2 n1 (n2 + 1) k1 v -> AbsTensor2 n1 n2 k1 v
forall v1 v2 (n1 :: Nat) k.
(v1 -> v2) -> Tensor n1 k v1 -> Tensor n1 k v2
mapTo1 (Int -> k1 -> Tensor (n2 + 1) k1 v -> Tensor ((n2 + 1) - 1) k1 v
forall (n :: Nat) k v.
(KnownNat n, 1 <= n, TIndex k, TAdd v) =>
Int -> k -> Tensor n k v -> Tensor (n - 1) k v
evalTens Int
ind k1
indVal)
evalTens3 :: (KnownNat n3, TIndex k1, TIndex k2, TAdd v) => Int -> k2 -> AbsTensor3 n1 n2 (n3+1) k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v
evalTens3 :: Int
-> k2
-> AbsTensor3 n1 n2 (n3 + 1) k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 v
evalTens3 Int
ind k2
indVal = (Tensor (n3 + 1) k2 v -> Tensor n3 k2 v)
-> AbsTensor3 n1 n2 (n3 + 1) k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) k.
(v1 -> v2) -> Tensor2 n1 n2 k v1 -> Tensor2 n1 n2 k v2
mapTo2 (Int -> k2 -> Tensor (n3 + 1) k2 v -> Tensor ((n3 + 1) - 1) k2 v
forall (n :: Nat) k v.
(KnownNat n, 1 <= n, TIndex k, TAdd v) =>
Int -> k -> Tensor n k v -> Tensor (n - 1) k v
evalTens Int
ind k2
indVal)
evalTens4 :: (KnownNat n4, TIndex k1, TIndex k2, TAdd v) => Int -> k2 -> AbsTensor4 n1 n2 n3 (n4+1) k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
evalTens4 :: Int
-> k2
-> AbsTensor4 n1 n2 n3 (n4 + 1) k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
evalTens4 Int
ind k2
indVal = (Tensor (n4 + 1) k2 v -> Tensor n4 k2 v)
-> AbsTensor4 n1 n2 n3 (n4 + 1) k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor3 n1 n2 n3 k1 k2 v1 -> AbsTensor3 n1 n2 n3 k1 k2 v2
mapTo3 (Int -> k2 -> Tensor (n4 + 1) k2 v -> Tensor ((n4 + 1) - 1) k2 v
forall (n :: Nat) k v.
(KnownNat n, 1 <= n, TIndex k, TAdd v) =>
Int -> k -> Tensor n k v -> Tensor (n - 1) k v
evalTens Int
ind k2
indVal)
evalTens5 :: (KnownNat n5, TIndex k1, TIndex k2, TIndex k3, TAdd v) => Int -> k3 -> AbsTensor5 n1 n2 n3 n4 (n5+1) k1 k2 k3 v -> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
evalTens5 :: Int
-> k3
-> AbsTensor5 n1 n2 n3 n4 (n5 + 1) k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
evalTens5 Int
ind k3
indVal = (Tensor (n5 + 1) k3 v -> Tensor n5 k3 v)
-> AbsTensor5 n1 n2 n3 n4 (n5 + 1) k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v1
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v2
mapTo4 (Int -> k3 -> Tensor (n5 + 1) k3 v -> Tensor ((n5 + 1) - 1) k3 v
forall (n :: Nat) k v.
(KnownNat n, 1 <= n, TIndex k, TAdd v) =>
Int -> k -> Tensor n k v -> Tensor (n - 1) k v
evalTens Int
ind k3
indVal)
evalTens6 :: (KnownNat n6, TIndex k1, TIndex k2, TIndex k3, TAdd v) => Int -> k3 -> AbsTensor6 n1 n2 n3 n4 n5 (n6+1) k1 k2 k3 v -> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
evalTens6 :: Int
-> k3
-> AbsTensor6 n1 n2 n3 n4 n5 (n6 + 1) k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
evalTens6 Int
ind k3
indVal = (Tensor (n6 + 1) k3 v -> Tensor n6 k3 v)
-> AbsTensor6 n1 n2 n3 n4 n5 (n6 + 1) k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v1
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v2
mapTo5 (Int -> k3 -> Tensor (n6 + 1) k3 v -> Tensor ((n6 + 1) - 1) k3 v
forall (n :: Nat) k v.
(KnownNat n, 1 <= n, TIndex k, TAdd v) =>
Int -> k -> Tensor n k v -> Tensor (n - 1) k v
evalTens Int
ind k3
indVal)
evalTens7 :: (KnownNat n7, TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) => Int -> k4 -> AbsTensor7 n1 n2 n3 n4 n5 n6 (n7+1) k1 k2 k3 k4 v -> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
evalTens7 :: Int
-> k4
-> AbsTensor7 n1 n2 n3 n4 n5 n6 (n7 + 1) k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
evalTens7 Int
ind k4
indVal = (Tensor (n7 + 1) k4 v -> Tensor n7 k4 v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 (n7 + 1) k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v1
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v2
mapTo6 (Int -> k4 -> Tensor (n7 + 1) k4 v -> Tensor ((n7 + 1) - 1) k4 v
forall (n :: Nat) k v.
(KnownNat n, 1 <= n, TIndex k, TAdd v) =>
Int -> k -> Tensor n k v -> Tensor (n - 1) k v
evalTens Int
ind k4
indVal)
evalTens8 :: (KnownNat n8, TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) => Int -> k4 -> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 (n8+1) k1 k2 k3 k4 v -> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
evalTens8 :: Int
-> k4
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 (n8 + 1) k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
evalTens8 Int
ind k4
indVal = (Tensor (n8 + 1) k4 v -> Tensor n8 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 (n8 + 1) k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) (n7 :: Nat) k1 k2 k3 k4.
(v1 -> v2)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v1
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v2
mapTo7 (Int -> k4 -> Tensor (n8 + 1) k4 v -> Tensor ((n8 + 1) - 1) k4 v
forall (n :: Nat) k v.
(KnownNat n, 1 <= n, TIndex k, TAdd v) =>
Int -> k -> Tensor n k v -> Tensor (n - 1) k v
evalTens Int
ind k4
indVal)
symTens :: (TIndex k, TAdd v) => (Int,Int) -> Tensor n k v -> Tensor n k v
symTens :: (Int, Int) -> Tensor n k v -> Tensor n k v
symTens (Int, Int)
inds Tensor n k v
t = Tensor n k v
t Tensor n k v -> Tensor n k v -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
Tensor n k v -> Tensor n k v -> Tensor n k v
&+ (Int, Int) -> Tensor n k v -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
tensorTrans (Int, Int)
inds Tensor n k v
t
symATens1 :: (TIndex k1, TAdd v) =>
(Int,Int) ->
AbsTensor1 n1 k1 v ->
AbsTensor1 n1 k1 v
symATens1 :: (Int, Int) -> AbsTensor1 n1 k1 v -> AbsTensor1 n1 k1 v
symATens1 = (Int, Int) -> AbsTensor1 n1 k1 v -> AbsTensor1 n1 k1 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
symTens
symATens2 :: (TIndex k1, TAdd v) =>
(Int,Int) ->
AbsTensor2 n1 n2 k1 v ->
AbsTensor2 n1 n2 k1 v
symATens2 :: (Int, Int) -> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v
symATens2 = (Tensor n2 k1 v -> Tensor n2 k1 v)
-> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v
forall v1 v2 (n1 :: Nat) k.
(v1 -> v2) -> Tensor n1 k v1 -> Tensor n1 k v2
mapTo1 ((Tensor n2 k1 v -> Tensor n2 k1 v)
-> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v)
-> ((Int, Int) -> Tensor n2 k1 v -> Tensor n2 k1 v)
-> (Int, Int)
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int) -> Tensor n2 k1 v -> Tensor n2 k1 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
symTens
symATens3 :: (TIndex k1, TIndex k2, TAdd v) =>
(Int,Int) ->
AbsTensor3 n1 n2 n3 k1 k2 v ->
AbsTensor3 n1 n2 n3 k1 k2 v
symATens3 :: (Int, Int)
-> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v
symATens3 = (Tensor n3 k2 v -> Tensor n3 k2 v)
-> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) k.
(v1 -> v2) -> Tensor2 n1 n2 k v1 -> Tensor2 n1 n2 k v2
mapTo2 ((Tensor n3 k2 v -> Tensor n3 k2 v)
-> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v)
-> ((Int, Int) -> Tensor n3 k2 v -> Tensor n3 k2 v)
-> (Int, Int)
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int) -> Tensor n3 k2 v -> Tensor n3 k2 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
symTens
symATens4 :: (TIndex k1, TIndex k2, TAdd v) =>
(Int,Int) ->
AbsTensor4 n1 n2 n3 n4 k1 k2 v ->
AbsTensor4 n1 n2 n3 n4 k1 k2 v
symATens4 :: (Int, Int)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
symATens4 = (Tensor n4 k2 v -> Tensor n4 k2 v)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor3 n1 n2 n3 k1 k2 v1 -> AbsTensor3 n1 n2 n3 k1 k2 v2
mapTo3 ((Tensor n4 k2 v -> Tensor n4 k2 v)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v)
-> ((Int, Int) -> Tensor n4 k2 v -> Tensor n4 k2 v)
-> (Int, Int)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int) -> Tensor n4 k2 v -> Tensor n4 k2 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
symTens
symATens5 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
(Int,Int) ->
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v ->
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
symATens5 :: (Int, Int)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
symATens5 = (Tensor n5 k3 v -> Tensor n5 k3 v)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v1
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v2
mapTo4 ((Tensor n5 k3 v -> Tensor n5 k3 v)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v)
-> ((Int, Int) -> Tensor n5 k3 v -> Tensor n5 k3 v)
-> (Int, Int)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int) -> Tensor n5 k3 v -> Tensor n5 k3 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
symTens
symATens6 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
(Int,Int) ->
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v ->
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
symATens6 :: (Int, Int)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
symATens6 = (Tensor n6 k3 v -> Tensor n6 k3 v)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v1
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v2
mapTo5 ((Tensor n6 k3 v -> Tensor n6 k3 v)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v)
-> ((Int, Int) -> Tensor n6 k3 v -> Tensor n6 k3 v)
-> (Int, Int)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int) -> Tensor n6 k3 v -> Tensor n6 k3 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
symTens
symATens7 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) =>
(Int,Int) ->
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v ->
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
symATens7 :: (Int, Int)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
symATens7 = (Tensor n7 k4 v -> Tensor n7 k4 v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v1
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v2
mapTo6 ((Tensor n7 k4 v -> Tensor n7 k4 v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v)
-> ((Int, Int) -> Tensor n7 k4 v -> Tensor n7 k4 v)
-> (Int, Int)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int) -> Tensor n7 k4 v -> Tensor n7 k4 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
symTens
symATens8 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) =>
(Int,Int) ->
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v ->
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
symATens8 :: (Int, Int)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
symATens8 = (Tensor n8 k4 v -> Tensor n8 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) (n7 :: Nat) k1 k2 k3 k4.
(v1 -> v2)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v1
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v2
mapTo7 ((Tensor n8 k4 v -> Tensor n8 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v)
-> ((Int, Int) -> Tensor n8 k4 v -> Tensor n8 k4 v)
-> (Int, Int)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int) -> Tensor n8 k4 v -> Tensor n8 k4 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
symTens
symTensFac :: (TIndex k, TAdd v, Prod (SField Rational) v) => (Int,Int) -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
symTensFac :: (Int, Int)
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
symTensFac (Int, Int)
inds Tensor n k v
t = Rational -> SField Rational
forall a. a -> SField a
SField (Rational
1Rational -> Rational -> Rational
forall a. Fractional a => a -> a -> a
/Rational
2 :: Rational) SField Rational
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
forall k s v (n :: Nat).
(TIndex k, Prod s v) =>
s -> Tensor n k v -> Tensor n k (TProd s v)
&. (Int, Int) -> Tensor n k v -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
symTens (Int, Int)
inds Tensor n k v
t
symATensFac1 :: (TIndex k1, TAdd v, Prod (SField Rational) v) =>
(Int,Int) ->
AbsTensor1 n1 k1 v ->
AbsTensor1 n1 k1 (TProd (SField Rational) v)
symATensFac1 :: (Int, Int)
-> AbsTensor1 n1 k1 v
-> AbsTensor1 n1 k1 (TProd (SField Rational) v)
symATensFac1 = (Int, Int)
-> AbsTensor1 n1 k1 v
-> AbsTensor1 n1 k1 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
(Int, Int)
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
symTensFac
symATensFac2 :: (TIndex k1, TAdd v, Prod (SField Rational) v) =>
(Int,Int) ->
AbsTensor2 n1 n2 k1 v ->
AbsTensor2 n1 n2 k1 (TProd (SField Rational) v)
symATensFac2 :: (Int, Int)
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 (TProd (SField Rational) v)
symATensFac2 = (Tensor n2 k1 v -> Tensor n2 k1 (TProd (SField Rational) v))
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) k.
(v1 -> v2) -> Tensor n1 k v1 -> Tensor n1 k v2
mapTo1 ((Tensor n2 k1 v -> Tensor n2 k1 (TProd (SField Rational) v))
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 (TProd (SField Rational) v))
-> ((Int, Int)
-> Tensor n2 k1 v -> Tensor n2 k1 (TProd (SField Rational) v))
-> (Int, Int)
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int)
-> Tensor n2 k1 v -> Tensor n2 k1 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
(Int, Int)
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
symTensFac
symATensFac3 :: (TIndex k1,TIndex k2, TAdd v, Prod (SField Rational) v) =>
(Int,Int) ->
AbsTensor3 n1 n2 n3 k1 k2 v ->
AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v)
symATensFac3 :: (Int, Int)
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v)
symATensFac3 = (Tensor n3 k2 v -> Tensor n3 k2 (TProd (SField Rational) v))
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) k.
(v1 -> v2) -> Tensor2 n1 n2 k v1 -> Tensor2 n1 n2 k v2
mapTo2 ((Tensor n3 k2 v -> Tensor n3 k2 (TProd (SField Rational) v))
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v))
-> ((Int, Int)
-> Tensor n3 k2 v -> Tensor n3 k2 (TProd (SField Rational) v))
-> (Int, Int)
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int)
-> Tensor n3 k2 v -> Tensor n3 k2 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
(Int, Int)
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
symTensFac
symATensFac4 :: (TIndex k1, TIndex k2, TAdd v, Prod (SField Rational) v) =>
(Int,Int) ->
AbsTensor4 n1 n2 n3 n4 k1 k2 v ->
AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v)
symATensFac4 :: (Int, Int)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v)
symATensFac4 = (Tensor n4 k2 v -> Tensor n4 k2 (TProd (SField Rational) v))
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor3 n1 n2 n3 k1 k2 v1 -> AbsTensor3 n1 n2 n3 k1 k2 v2
mapTo3 ((Tensor n4 k2 v -> Tensor n4 k2 (TProd (SField Rational) v))
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v))
-> ((Int, Int)
-> Tensor n4 k2 v -> Tensor n4 k2 (TProd (SField Rational) v))
-> (Int, Int)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int)
-> Tensor n4 k2 v -> Tensor n4 k2 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
(Int, Int)
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
symTensFac
symATensFac5 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v, Prod (SField Rational) v) =>
(Int,Int) ->
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v ->
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v)
symATensFac5 :: (Int, Int)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v)
symATensFac5 = (Tensor n5 k3 v -> Tensor n5 k3 (TProd (SField Rational) v))
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v1
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v2
mapTo4 ((Tensor n5 k3 v -> Tensor n5 k3 (TProd (SField Rational) v))
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v))
-> ((Int, Int)
-> Tensor n5 k3 v -> Tensor n5 k3 (TProd (SField Rational) v))
-> (Int, Int)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int)
-> Tensor n5 k3 v -> Tensor n5 k3 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
(Int, Int)
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
symTensFac
symATensFac6 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v, Prod (SField Rational) v) =>
(Int,Int) ->
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v ->
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v)
symATensFac6 :: (Int, Int)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6
n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v)
symATensFac6 = (Tensor n6 k3 v -> Tensor n6 k3 (TProd (SField Rational) v))
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6
n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v1
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v2
mapTo5 ((Tensor n6 k3 v -> Tensor n6 k3 (TProd (SField Rational) v))
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6
n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v))
-> ((Int, Int)
-> Tensor n6 k3 v -> Tensor n6 k3 (TProd (SField Rational) v))
-> (Int, Int)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6
n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int)
-> Tensor n6 k3 v -> Tensor n6 k3 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
(Int, Int)
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
symTensFac
symATensFac7 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v, Prod (SField Rational) v) =>
(Int,Int) ->
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v ->
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v)
symATensFac7 :: (Int, Int)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7
n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v)
symATensFac7 = (Tensor n7 k4 v -> Tensor n7 k4 (TProd (SField Rational) v))
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7
n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v1
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v2
mapTo6 ((Tensor n7 k4 v -> Tensor n7 k4 (TProd (SField Rational) v))
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7
n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v))
-> ((Int, Int)
-> Tensor n7 k4 v -> Tensor n7 k4 (TProd (SField Rational) v))
-> (Int, Int)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7
n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int)
-> Tensor n7 k4 v -> Tensor n7 k4 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
(Int, Int)
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
symTensFac
symATensFac8 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v, Prod (SField Rational) v) =>
(Int,Int) ->
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v ->
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v)
symATensFac8 :: (Int, Int)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8
n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v)
symATensFac8 = (Tensor n8 k4 v -> Tensor n8 k4 (TProd (SField Rational) v))
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8
n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) (n7 :: Nat) k1 k2 k3 k4.
(v1 -> v2)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v1
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v2
mapTo7 ((Tensor n8 k4 v -> Tensor n8 k4 (TProd (SField Rational) v))
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8
n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v))
-> ((Int, Int)
-> Tensor n8 k4 v -> Tensor n8 k4 (TProd (SField Rational) v))
-> (Int, Int)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8
n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int)
-> Tensor n8 k4 v -> Tensor n8 k4 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
(Int, Int)
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
symTensFac
aSymTens :: (TIndex k, TAdd v) => (Int,Int) -> Tensor n k v -> Tensor n k v
aSymTens :: (Int, Int) -> Tensor n k v -> Tensor n k v
aSymTens (Int, Int)
inds Tensor n k v
t = Tensor n k v
t Tensor n k v -> Tensor n k v -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
Tensor n k v -> Tensor n k v -> Tensor n k v
&- (Int, Int) -> Tensor n k v -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
tensorTrans (Int, Int)
inds Tensor n k v
t
aSymATens1 :: (TIndex k1, TAdd v) =>
(Int,Int) ->
AbsTensor1 n1 k1 v ->
AbsTensor1 n1 k1 v
aSymATens1 :: (Int, Int) -> AbsTensor1 n1 k1 v -> AbsTensor1 n1 k1 v
aSymATens1 = (Int, Int) -> AbsTensor1 n1 k1 v -> AbsTensor1 n1 k1 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
aSymTens
aSymATens2 :: (TIndex k1, TAdd v) =>
(Int,Int) ->
AbsTensor2 n1 n2 k1 v ->
AbsTensor2 n1 n2 k1 v
aSymATens2 :: (Int, Int) -> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v
aSymATens2 = (Tensor n2 k1 v -> Tensor n2 k1 v)
-> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v
forall v1 v2 (n1 :: Nat) k.
(v1 -> v2) -> Tensor n1 k v1 -> Tensor n1 k v2
mapTo1 ((Tensor n2 k1 v -> Tensor n2 k1 v)
-> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v)
-> ((Int, Int) -> Tensor n2 k1 v -> Tensor n2 k1 v)
-> (Int, Int)
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int) -> Tensor n2 k1 v -> Tensor n2 k1 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
aSymTens
aSymATens3 :: (TIndex k1, TIndex k2, TAdd v) =>
(Int,Int) ->
AbsTensor3 n1 n2 n3 k1 k2 v ->
AbsTensor3 n1 n2 n3 k1 k2 v
aSymATens3 :: (Int, Int)
-> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v
aSymATens3 = (Tensor n3 k2 v -> Tensor n3 k2 v)
-> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) k.
(v1 -> v2) -> Tensor2 n1 n2 k v1 -> Tensor2 n1 n2 k v2
mapTo2 ((Tensor n3 k2 v -> Tensor n3 k2 v)
-> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v)
-> ((Int, Int) -> Tensor n3 k2 v -> Tensor n3 k2 v)
-> (Int, Int)
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int) -> Tensor n3 k2 v -> Tensor n3 k2 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
aSymTens
aSymATens4 :: (TIndex k1, TIndex k2, TAdd v) =>
(Int,Int) ->
AbsTensor4 n1 n2 n3 n4 k1 k2 v ->
AbsTensor4 n1 n2 n3 n4 k1 k2 v
aSymATens4 :: (Int, Int)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
aSymATens4 = (Tensor n4 k2 v -> Tensor n4 k2 v)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor3 n1 n2 n3 k1 k2 v1 -> AbsTensor3 n1 n2 n3 k1 k2 v2
mapTo3 ((Tensor n4 k2 v -> Tensor n4 k2 v)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v)
-> ((Int, Int) -> Tensor n4 k2 v -> Tensor n4 k2 v)
-> (Int, Int)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int) -> Tensor n4 k2 v -> Tensor n4 k2 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
aSymTens
aSymATens5 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
(Int,Int) ->
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v ->
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
aSymATens5 :: (Int, Int)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
aSymATens5 = (Tensor n5 k3 v -> Tensor n5 k3 v)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v1
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v2
mapTo4 ((Tensor n5 k3 v -> Tensor n5 k3 v)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v)
-> ((Int, Int) -> Tensor n5 k3 v -> Tensor n5 k3 v)
-> (Int, Int)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int) -> Tensor n5 k3 v -> Tensor n5 k3 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
aSymTens
aSymATens6 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
(Int,Int) ->
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v ->
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
aSymATens6 :: (Int, Int)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
aSymATens6 = (Tensor n6 k3 v -> Tensor n6 k3 v)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v1
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v2
mapTo5 ((Tensor n6 k3 v -> Tensor n6 k3 v)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v)
-> ((Int, Int) -> Tensor n6 k3 v -> Tensor n6 k3 v)
-> (Int, Int)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int) -> Tensor n6 k3 v -> Tensor n6 k3 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
aSymTens
aSymATens7 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) =>
(Int,Int) ->
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v ->
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
aSymATens7 :: (Int, Int)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
aSymATens7 = (Tensor n7 k4 v -> Tensor n7 k4 v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v1
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v2
mapTo6 ((Tensor n7 k4 v -> Tensor n7 k4 v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v)
-> ((Int, Int) -> Tensor n7 k4 v -> Tensor n7 k4 v)
-> (Int, Int)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int) -> Tensor n7 k4 v -> Tensor n7 k4 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
aSymTens
aSymATens8 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) =>
(Int,Int) ->
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v ->
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
aSymATens8 :: (Int, Int)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
aSymATens8 = (Tensor n8 k4 v -> Tensor n8 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) (n7 :: Nat) k1 k2 k3 k4.
(v1 -> v2)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v1
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v2
mapTo7 ((Tensor n8 k4 v -> Tensor n8 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v)
-> ((Int, Int) -> Tensor n8 k4 v -> Tensor n8 k4 v)
-> (Int, Int)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int) -> Tensor n8 k4 v -> Tensor n8 k4 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
aSymTens
aSymTensFac :: (TIndex k, TAdd v, Prod (SField Rational) v) => (Int,Int) -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
aSymTensFac :: (Int, Int)
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
aSymTensFac (Int, Int)
inds Tensor n k v
t = Rational -> SField Rational
forall a. a -> SField a
SField (Rational
1Rational -> Rational -> Rational
forall a. Fractional a => a -> a -> a
/Rational
2 :: Rational) SField Rational
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
forall k s v (n :: Nat).
(TIndex k, Prod s v) =>
s -> Tensor n k v -> Tensor n k (TProd s v)
&. (Int, Int) -> Tensor n k v -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
aSymTens (Int, Int)
inds Tensor n k v
t
aSymATensFac1 :: (TIndex k1, TAdd v, Prod (SField Rational) v) =>
(Int,Int) ->
AbsTensor1 n1 k1 v ->
AbsTensor1 n1 k1 (TProd (SField Rational) v)
aSymATensFac1 :: (Int, Int)
-> AbsTensor1 n1 k1 v
-> AbsTensor1 n1 k1 (TProd (SField Rational) v)
aSymATensFac1 = (Int, Int)
-> AbsTensor1 n1 k1 v
-> AbsTensor1 n1 k1 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
(Int, Int)
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
aSymTensFac
aSymATensFac2 :: (TIndex k1, TAdd v, Prod (SField Rational) v) =>
(Int,Int) ->
AbsTensor2 n1 n2 k1 v ->
AbsTensor2 n1 n2 k1 (TProd (SField Rational) v)
aSymATensFac2 :: (Int, Int)
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 (TProd (SField Rational) v)
aSymATensFac2 = (Tensor n2 k1 v -> Tensor n2 k1 (TProd (SField Rational) v))
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) k.
(v1 -> v2) -> Tensor n1 k v1 -> Tensor n1 k v2
mapTo1 ((Tensor n2 k1 v -> Tensor n2 k1 (TProd (SField Rational) v))
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 (TProd (SField Rational) v))
-> ((Int, Int)
-> Tensor n2 k1 v -> Tensor n2 k1 (TProd (SField Rational) v))
-> (Int, Int)
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int)
-> Tensor n2 k1 v -> Tensor n2 k1 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
(Int, Int)
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
aSymTensFac
aSymATensFac3 :: (TIndex k1, TIndex k2, TAdd v, Prod (SField Rational) v) =>
(Int,Int) ->
AbsTensor3 n1 n2 n3 k1 k2 v ->
AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v)
aSymATensFac3 :: (Int, Int)
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v)
aSymATensFac3 = (Tensor n3 k2 v -> Tensor n3 k2 (TProd (SField Rational) v))
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) k.
(v1 -> v2) -> Tensor2 n1 n2 k v1 -> Tensor2 n1 n2 k v2
mapTo2 ((Tensor n3 k2 v -> Tensor n3 k2 (TProd (SField Rational) v))
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v))
-> ((Int, Int)
-> Tensor n3 k2 v -> Tensor n3 k2 (TProd (SField Rational) v))
-> (Int, Int)
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int)
-> Tensor n3 k2 v -> Tensor n3 k2 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
(Int, Int)
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
aSymTensFac
aSymATensFac4 :: (TIndex k1, TIndex k2, TAdd v, Prod (SField Rational) v) =>
(Int,Int) ->
AbsTensor4 n1 n2 n3 n4 k1 k2 v ->
AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v)
aSymATensFac4 :: (Int, Int)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v)
aSymATensFac4 = (Tensor n4 k2 v -> Tensor n4 k2 (TProd (SField Rational) v))
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor3 n1 n2 n3 k1 k2 v1 -> AbsTensor3 n1 n2 n3 k1 k2 v2
mapTo3 ((Tensor n4 k2 v -> Tensor n4 k2 (TProd (SField Rational) v))
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v))
-> ((Int, Int)
-> Tensor n4 k2 v -> Tensor n4 k2 (TProd (SField Rational) v))
-> (Int, Int)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int)
-> Tensor n4 k2 v -> Tensor n4 k2 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
(Int, Int)
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
aSymTensFac
aSymATensFac5 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v, Prod (SField Rational) v) =>
(Int,Int) ->
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v ->
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v)
aSymATensFac5 :: (Int, Int)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v)
aSymATensFac5 = (Tensor n5 k3 v -> Tensor n5 k3 (TProd (SField Rational) v))
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v1
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v2
mapTo4 ((Tensor n5 k3 v -> Tensor n5 k3 (TProd (SField Rational) v))
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v))
-> ((Int, Int)
-> Tensor n5 k3 v -> Tensor n5 k3 (TProd (SField Rational) v))
-> (Int, Int)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int)
-> Tensor n5 k3 v -> Tensor n5 k3 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
(Int, Int)
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
aSymTensFac
aSymATensFac6 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v, Prod (SField Rational) v) =>
(Int,Int) ->
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v ->
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v)
aSymATensFac6 :: (Int, Int)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6
n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v)
aSymATensFac6 = (Tensor n6 k3 v -> Tensor n6 k3 (TProd (SField Rational) v))
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6
n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v1
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v2
mapTo5 ((Tensor n6 k3 v -> Tensor n6 k3 (TProd (SField Rational) v))
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6
n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v))
-> ((Int, Int)
-> Tensor n6 k3 v -> Tensor n6 k3 (TProd (SField Rational) v))
-> (Int, Int)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6
n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int)
-> Tensor n6 k3 v -> Tensor n6 k3 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
(Int, Int)
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
aSymTensFac
aSymATensFac7 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v, Prod (SField Rational) v) =>
(Int,Int) ->
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v ->
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v)
aSymATensFac7 :: (Int, Int)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7
n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v)
aSymATensFac7 = (Tensor n7 k4 v -> Tensor n7 k4 (TProd (SField Rational) v))
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7
n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v1
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v2
mapTo6 ((Tensor n7 k4 v -> Tensor n7 k4 (TProd (SField Rational) v))
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7
n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v))
-> ((Int, Int)
-> Tensor n7 k4 v -> Tensor n7 k4 (TProd (SField Rational) v))
-> (Int, Int)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7
n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int)
-> Tensor n7 k4 v -> Tensor n7 k4 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
(Int, Int)
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
aSymTensFac
aSymATensFac8 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v, Prod (SField Rational) v) =>
(Int,Int) ->
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v ->
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v)
aSymATensFac8 :: (Int, Int)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8
n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v)
aSymATensFac8 = (Tensor n8 k4 v -> Tensor n8 k4 (TProd (SField Rational) v))
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8
n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) (n7 :: Nat) k1 k2 k3 k4.
(v1 -> v2)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v1
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v2
mapTo7 ((Tensor n8 k4 v -> Tensor n8 k4 (TProd (SField Rational) v))
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8
n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v))
-> ((Int, Int)
-> Tensor n8 k4 v -> Tensor n8 k4 (TProd (SField Rational) v))
-> (Int, Int)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8
n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int)
-> Tensor n8 k4 v -> Tensor n8 k4 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
(Int, Int)
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
aSymTensFac
symBlockTens :: (TIndex k, TAdd v) => ([Int],[Int]) -> Tensor n k v -> Tensor n k v
symBlockTens :: ([Int], [Int]) -> Tensor n k v -> Tensor n k v
symBlockTens ([Int], [Int])
inds Tensor n k v
t = Tensor n k v
t Tensor n k v -> Tensor n k v -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
Tensor n k v -> Tensor n k v -> Tensor n k v
&+ ([Int], [Int]) -> Tensor n k v -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
([Int], [Int]) -> Tensor n k v -> Tensor n k v
tensorBlockTrans ([Int], [Int])
inds Tensor n k v
t
symBlockATens1 :: (TIndex k1, TAdd v) =>
([Int],[Int]) ->
AbsTensor1 n1 k1 v ->
AbsTensor1 n1 k1 v
symBlockATens1 :: ([Int], [Int]) -> AbsTensor1 n1 k1 v -> AbsTensor1 n1 k1 v
symBlockATens1 = ([Int], [Int]) -> AbsTensor1 n1 k1 v -> AbsTensor1 n1 k1 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
([Int], [Int]) -> Tensor n k v -> Tensor n k v
symBlockTens
symBlockATens2 :: (TIndex k1, TAdd v) =>
([Int],[Int]) ->
AbsTensor2 n1 n2 k1 v ->
AbsTensor2 n1 n2 k1 v
symBlockATens2 :: ([Int], [Int]) -> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v
symBlockATens2 = (Tensor n2 k1 v -> Tensor n2 k1 v)
-> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v
forall v1 v2 (n1 :: Nat) k.
(v1 -> v2) -> Tensor n1 k v1 -> Tensor n1 k v2
mapTo1 ((Tensor n2 k1 v -> Tensor n2 k1 v)
-> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v)
-> (([Int], [Int]) -> Tensor n2 k1 v -> Tensor n2 k1 v)
-> ([Int], [Int])
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int]) -> Tensor n2 k1 v -> Tensor n2 k1 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
([Int], [Int]) -> Tensor n k v -> Tensor n k v
symBlockTens
symBlockATens3 :: (TIndex k1, TIndex k2, TAdd v) =>
([Int],[Int]) ->
AbsTensor3 n1 n2 n3 k1 k2 v ->
AbsTensor3 n1 n2 n3 k1 k2 v
symBlockATens3 :: ([Int], [Int])
-> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v
symBlockATens3 = (Tensor n3 k2 v -> Tensor n3 k2 v)
-> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) k.
(v1 -> v2) -> Tensor2 n1 n2 k v1 -> Tensor2 n1 n2 k v2
mapTo2 ((Tensor n3 k2 v -> Tensor n3 k2 v)
-> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v)
-> (([Int], [Int]) -> Tensor n3 k2 v -> Tensor n3 k2 v)
-> ([Int], [Int])
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int]) -> Tensor n3 k2 v -> Tensor n3 k2 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
([Int], [Int]) -> Tensor n k v -> Tensor n k v
symBlockTens
symBlockATens4 :: (TIndex k1, TIndex k2, TAdd v) =>
([Int],[Int]) ->
AbsTensor4 n1 n2 n3 n4 k1 k2 v ->
AbsTensor4 n1 n2 n3 n4 k1 k2 v
symBlockATens4 :: ([Int], [Int])
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
symBlockATens4 = (Tensor n4 k2 v -> Tensor n4 k2 v)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor3 n1 n2 n3 k1 k2 v1 -> AbsTensor3 n1 n2 n3 k1 k2 v2
mapTo3 ((Tensor n4 k2 v -> Tensor n4 k2 v)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v)
-> (([Int], [Int]) -> Tensor n4 k2 v -> Tensor n4 k2 v)
-> ([Int], [Int])
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int]) -> Tensor n4 k2 v -> Tensor n4 k2 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
([Int], [Int]) -> Tensor n k v -> Tensor n k v
symBlockTens
symBlockATens5 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
([Int],[Int]) ->
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v ->
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
symBlockATens5 :: ([Int], [Int])
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
symBlockATens5 = (Tensor n5 k3 v -> Tensor n5 k3 v)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v1
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v2
mapTo4 ((Tensor n5 k3 v -> Tensor n5 k3 v)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v)
-> (([Int], [Int]) -> Tensor n5 k3 v -> Tensor n5 k3 v)
-> ([Int], [Int])
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int]) -> Tensor n5 k3 v -> Tensor n5 k3 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
([Int], [Int]) -> Tensor n k v -> Tensor n k v
symBlockTens
symBlockATens6 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
([Int],[Int]) ->
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v ->
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
symBlockATens6 :: ([Int], [Int])
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
symBlockATens6 = (Tensor n6 k3 v -> Tensor n6 k3 v)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v1
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v2
mapTo5 ((Tensor n6 k3 v -> Tensor n6 k3 v)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v)
-> (([Int], [Int]) -> Tensor n6 k3 v -> Tensor n6 k3 v)
-> ([Int], [Int])
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int]) -> Tensor n6 k3 v -> Tensor n6 k3 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
([Int], [Int]) -> Tensor n k v -> Tensor n k v
symBlockTens
symBlockATens7 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) =>
([Int],[Int]) ->
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v ->
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
symBlockATens7 :: ([Int], [Int])
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
symBlockATens7 = (Tensor n7 k4 v -> Tensor n7 k4 v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v1
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v2
mapTo6 ((Tensor n7 k4 v -> Tensor n7 k4 v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v)
-> (([Int], [Int]) -> Tensor n7 k4 v -> Tensor n7 k4 v)
-> ([Int], [Int])
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int]) -> Tensor n7 k4 v -> Tensor n7 k4 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
([Int], [Int]) -> Tensor n k v -> Tensor n k v
symBlockTens
symBlockATens8 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) =>
([Int],[Int]) ->
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v ->
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
symBlockATens8 :: ([Int], [Int])
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
symBlockATens8 = (Tensor n8 k4 v -> Tensor n8 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) (n7 :: Nat) k1 k2 k3 k4.
(v1 -> v2)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v1
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v2
mapTo7 ((Tensor n8 k4 v -> Tensor n8 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v)
-> (([Int], [Int]) -> Tensor n8 k4 v -> Tensor n8 k4 v)
-> ([Int], [Int])
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int]) -> Tensor n8 k4 v -> Tensor n8 k4 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
([Int], [Int]) -> Tensor n k v -> Tensor n k v
symBlockTens
symBlockTensFac :: (TIndex k, TAdd v, Prod (SField Rational) v) => ([Int],[Int]) -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
symBlockTensFac :: ([Int], [Int])
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
symBlockTensFac ([Int], [Int])
inds Tensor n k v
t = Rational -> SField Rational
forall a. a -> SField a
SField (Rational
1Rational -> Rational -> Rational
forall a. Fractional a => a -> a -> a
/Rational
2 :: Rational) SField Rational
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
forall k s v (n :: Nat).
(TIndex k, Prod s v) =>
s -> Tensor n k v -> Tensor n k (TProd s v)
&. ([Int], [Int]) -> Tensor n k v -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
([Int], [Int]) -> Tensor n k v -> Tensor n k v
symBlockTens ([Int], [Int])
inds Tensor n k v
t
symBlockATensFac1 :: (TIndex k1, TAdd v, Prod (SField Rational) v) =>
([Int],[Int]) ->
AbsTensor1 n1 k1 v ->
AbsTensor1 n1 k1 (TProd (SField Rational) v)
symBlockATensFac1 :: ([Int], [Int])
-> AbsTensor1 n1 k1 v
-> AbsTensor1 n1 k1 (TProd (SField Rational) v)
symBlockATensFac1 = ([Int], [Int])
-> AbsTensor1 n1 k1 v
-> AbsTensor1 n1 k1 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
([Int], [Int])
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
symBlockTensFac
symBlockATensFac2 :: (TIndex k1, TAdd v, Prod (SField Rational) v) =>
([Int],[Int]) ->
AbsTensor2 n1 n2 k1 v ->
AbsTensor2 n1 n2 k1 (TProd (SField Rational) v)
symBlockATensFac2 :: ([Int], [Int])
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 (TProd (SField Rational) v)
symBlockATensFac2 = (Tensor n2 k1 v -> Tensor n2 k1 (TProd (SField Rational) v))
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) k.
(v1 -> v2) -> Tensor n1 k v1 -> Tensor n1 k v2
mapTo1 ((Tensor n2 k1 v -> Tensor n2 k1 (TProd (SField Rational) v))
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 (TProd (SField Rational) v))
-> (([Int], [Int])
-> Tensor n2 k1 v -> Tensor n2 k1 (TProd (SField Rational) v))
-> ([Int], [Int])
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int])
-> Tensor n2 k1 v -> Tensor n2 k1 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
([Int], [Int])
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
symBlockTensFac
symBlockATensFac3 :: (TIndex k1, TIndex k2, TAdd v, Prod (SField Rational) v) =>
([Int],[Int]) ->
AbsTensor3 n1 n2 n3 k1 k2 v ->
AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v)
symBlockATensFac3 :: ([Int], [Int])
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v)
symBlockATensFac3 = (Tensor n3 k2 v -> Tensor n3 k2 (TProd (SField Rational) v))
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) k.
(v1 -> v2) -> Tensor2 n1 n2 k v1 -> Tensor2 n1 n2 k v2
mapTo2 ((Tensor n3 k2 v -> Tensor n3 k2 (TProd (SField Rational) v))
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v))
-> (([Int], [Int])
-> Tensor n3 k2 v -> Tensor n3 k2 (TProd (SField Rational) v))
-> ([Int], [Int])
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int])
-> Tensor n3 k2 v -> Tensor n3 k2 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
([Int], [Int])
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
symBlockTensFac
symBlockATensFac4 :: (TIndex k1, TIndex k2, TAdd v, Prod (SField Rational) v) =>
([Int],[Int]) ->
AbsTensor4 n1 n2 n3 n4 k1 k2 v ->
AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v)
symBlockATensFac4 :: ([Int], [Int])
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v)
symBlockATensFac4 = (Tensor n4 k2 v -> Tensor n4 k2 (TProd (SField Rational) v))
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor3 n1 n2 n3 k1 k2 v1 -> AbsTensor3 n1 n2 n3 k1 k2 v2
mapTo3 ((Tensor n4 k2 v -> Tensor n4 k2 (TProd (SField Rational) v))
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v))
-> (([Int], [Int])
-> Tensor n4 k2 v -> Tensor n4 k2 (TProd (SField Rational) v))
-> ([Int], [Int])
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int])
-> Tensor n4 k2 v -> Tensor n4 k2 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
([Int], [Int])
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
symBlockTensFac
symBlockATensFac5 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v, Prod (SField Rational) v) =>
([Int],[Int]) ->
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v ->
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v)
symBlockATensFac5 :: ([Int], [Int])
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v)
symBlockATensFac5 = (Tensor n5 k3 v -> Tensor n5 k3 (TProd (SField Rational) v))
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v1
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v2
mapTo4 ((Tensor n5 k3 v -> Tensor n5 k3 (TProd (SField Rational) v))
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v))
-> (([Int], [Int])
-> Tensor n5 k3 v -> Tensor n5 k3 (TProd (SField Rational) v))
-> ([Int], [Int])
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int])
-> Tensor n5 k3 v -> Tensor n5 k3 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
([Int], [Int])
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
symBlockTensFac
symBlockATensFac6 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v, Prod (SField Rational) v) =>
([Int],[Int]) ->
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v ->
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v)
symBlockATensFac6 :: ([Int], [Int])
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6
n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v)
symBlockATensFac6 = (Tensor n6 k3 v -> Tensor n6 k3 (TProd (SField Rational) v))
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6
n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v1
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v2
mapTo5 ((Tensor n6 k3 v -> Tensor n6 k3 (TProd (SField Rational) v))
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6
n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v))
-> (([Int], [Int])
-> Tensor n6 k3 v -> Tensor n6 k3 (TProd (SField Rational) v))
-> ([Int], [Int])
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6
n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int])
-> Tensor n6 k3 v -> Tensor n6 k3 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
([Int], [Int])
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
symBlockTensFac
symBlockATensFac7 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v, Prod (SField Rational) v) =>
([Int],[Int]) ->
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v ->
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v)
symBlockATensFac7 :: ([Int], [Int])
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7
n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v)
symBlockATensFac7 = (Tensor n7 k4 v -> Tensor n7 k4 (TProd (SField Rational) v))
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7
n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v1
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v2
mapTo6 ((Tensor n7 k4 v -> Tensor n7 k4 (TProd (SField Rational) v))
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7
n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v))
-> (([Int], [Int])
-> Tensor n7 k4 v -> Tensor n7 k4 (TProd (SField Rational) v))
-> ([Int], [Int])
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7
n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int])
-> Tensor n7 k4 v -> Tensor n7 k4 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
([Int], [Int])
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
symBlockTensFac
symBlockATensFac8 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v, Prod (SField Rational) v) =>
([Int],[Int]) ->
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v ->
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v)
symBlockATensFac8 :: ([Int], [Int])
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8
n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v)
symBlockATensFac8 = (Tensor n8 k4 v -> Tensor n8 k4 (TProd (SField Rational) v))
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8
n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) (n7 :: Nat) k1 k2 k3 k4.
(v1 -> v2)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v1
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v2
mapTo7 ((Tensor n8 k4 v -> Tensor n8 k4 (TProd (SField Rational) v))
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8
n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v))
-> (([Int], [Int])
-> Tensor n8 k4 v -> Tensor n8 k4 (TProd (SField Rational) v))
-> ([Int], [Int])
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8
n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int])
-> Tensor n8 k4 v -> Tensor n8 k4 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
([Int], [Int])
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
symBlockTensFac
aSymBlockTens :: (TIndex k, TAdd v) => ([Int],[Int]) -> Tensor n k v -> Tensor n k v
aSymBlockTens :: ([Int], [Int]) -> Tensor n k v -> Tensor n k v
aSymBlockTens ([Int], [Int])
inds Tensor n k v
t = Tensor n k v
t Tensor n k v -> Tensor n k v -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
Tensor n k v -> Tensor n k v -> Tensor n k v
&- ([Int], [Int]) -> Tensor n k v -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
([Int], [Int]) -> Tensor n k v -> Tensor n k v
tensorBlockTrans ([Int], [Int])
inds Tensor n k v
t
aSymBlockATens1 :: (TIndex k1, TAdd v) =>
([Int],[Int]) ->
AbsTensor1 n1 k1 v ->
AbsTensor1 n1 k1 v
aSymBlockATens1 :: ([Int], [Int]) -> AbsTensor1 n1 k1 v -> AbsTensor1 n1 k1 v
aSymBlockATens1 = ([Int], [Int]) -> AbsTensor1 n1 k1 v -> AbsTensor1 n1 k1 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
([Int], [Int]) -> Tensor n k v -> Tensor n k v
aSymBlockTens
aSymBlockATens2 :: (TIndex k1, TAdd v) =>
([Int],[Int]) ->
AbsTensor2 n1 n2 k1 v ->
AbsTensor2 n1 n2 k1 v
aSymBlockATens2 :: ([Int], [Int]) -> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v
aSymBlockATens2 = (Tensor n2 k1 v -> Tensor n2 k1 v)
-> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v
forall v1 v2 (n1 :: Nat) k.
(v1 -> v2) -> Tensor n1 k v1 -> Tensor n1 k v2
mapTo1 ((Tensor n2 k1 v -> Tensor n2 k1 v)
-> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v)
-> (([Int], [Int]) -> Tensor n2 k1 v -> Tensor n2 k1 v)
-> ([Int], [Int])
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int]) -> Tensor n2 k1 v -> Tensor n2 k1 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
([Int], [Int]) -> Tensor n k v -> Tensor n k v
aSymBlockTens
aSymBlockATens3 :: (TIndex k1, TIndex k2, TAdd v) =>
([Int],[Int]) ->
AbsTensor3 n1 n2 n3 k1 k2 v ->
AbsTensor3 n1 n2 n3 k1 k2 v
aSymBlockATens3 :: ([Int], [Int])
-> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v
aSymBlockATens3 = (Tensor n3 k2 v -> Tensor n3 k2 v)
-> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) k.
(v1 -> v2) -> Tensor2 n1 n2 k v1 -> Tensor2 n1 n2 k v2
mapTo2 ((Tensor n3 k2 v -> Tensor n3 k2 v)
-> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v)
-> (([Int], [Int]) -> Tensor n3 k2 v -> Tensor n3 k2 v)
-> ([Int], [Int])
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int]) -> Tensor n3 k2 v -> Tensor n3 k2 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
([Int], [Int]) -> Tensor n k v -> Tensor n k v
aSymBlockTens
aSymBlockATens4 :: (TIndex k1, TIndex k2, TAdd v) =>
([Int],[Int]) ->
AbsTensor4 n1 n2 n3 n4 k1 k2 v ->
AbsTensor4 n1 n2 n3 n4 k1 k2 v
aSymBlockATens4 :: ([Int], [Int])
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
aSymBlockATens4 = (Tensor n4 k2 v -> Tensor n4 k2 v)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor3 n1 n2 n3 k1 k2 v1 -> AbsTensor3 n1 n2 n3 k1 k2 v2
mapTo3 ((Tensor n4 k2 v -> Tensor n4 k2 v)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v)
-> (([Int], [Int]) -> Tensor n4 k2 v -> Tensor n4 k2 v)
-> ([Int], [Int])
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int]) -> Tensor n4 k2 v -> Tensor n4 k2 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
([Int], [Int]) -> Tensor n k v -> Tensor n k v
aSymBlockTens
aSymBlockATens5 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
([Int],[Int]) ->
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v ->
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
aSymBlockATens5 :: ([Int], [Int])
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
aSymBlockATens5 = (Tensor n5 k3 v -> Tensor n5 k3 v)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v1
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v2
mapTo4 ((Tensor n5 k3 v -> Tensor n5 k3 v)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v)
-> (([Int], [Int]) -> Tensor n5 k3 v -> Tensor n5 k3 v)
-> ([Int], [Int])
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int]) -> Tensor n5 k3 v -> Tensor n5 k3 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
([Int], [Int]) -> Tensor n k v -> Tensor n k v
aSymBlockTens
aSymBlockATens6 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
([Int],[Int]) ->
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v ->
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
aSymBlockATens6 :: ([Int], [Int])
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
aSymBlockATens6 = (Tensor n6 k3 v -> Tensor n6 k3 v)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v1
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v2
mapTo5 ((Tensor n6 k3 v -> Tensor n6 k3 v)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v)
-> (([Int], [Int]) -> Tensor n6 k3 v -> Tensor n6 k3 v)
-> ([Int], [Int])
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int]) -> Tensor n6 k3 v -> Tensor n6 k3 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
([Int], [Int]) -> Tensor n k v -> Tensor n k v
aSymBlockTens
aSymBlockATens7 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) =>
([Int],[Int]) ->
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v ->
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
aSymBlockATens7 :: ([Int], [Int])
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
aSymBlockATens7 = (Tensor n7 k4 v -> Tensor n7 k4 v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v1
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v2
mapTo6 ((Tensor n7 k4 v -> Tensor n7 k4 v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v)
-> (([Int], [Int]) -> Tensor n7 k4 v -> Tensor n7 k4 v)
-> ([Int], [Int])
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int]) -> Tensor n7 k4 v -> Tensor n7 k4 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
([Int], [Int]) -> Tensor n k v -> Tensor n k v
aSymBlockTens
aSymBlockATens8 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) =>
([Int],[Int]) ->
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v ->
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
aSymBlockATens8 :: ([Int], [Int])
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
aSymBlockATens8 = (Tensor n8 k4 v -> Tensor n8 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) (n7 :: Nat) k1 k2 k3 k4.
(v1 -> v2)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v1
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v2
mapTo7 ((Tensor n8 k4 v -> Tensor n8 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v)
-> (([Int], [Int]) -> Tensor n8 k4 v -> Tensor n8 k4 v)
-> ([Int], [Int])
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int]) -> Tensor n8 k4 v -> Tensor n8 k4 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
([Int], [Int]) -> Tensor n k v -> Tensor n k v
aSymBlockTens
aSymBlockTensFac :: (TIndex k, TAdd v, Prod (SField Rational) v) => ([Int],[Int]) -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
aSymBlockTensFac :: ([Int], [Int])
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
aSymBlockTensFac ([Int], [Int])
inds Tensor n k v
t = Rational -> SField Rational
forall a. a -> SField a
SField (Rational
1Rational -> Rational -> Rational
forall a. Fractional a => a -> a -> a
/Rational
2 :: Rational) SField Rational
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
forall k s v (n :: Nat).
(TIndex k, Prod s v) =>
s -> Tensor n k v -> Tensor n k (TProd s v)
&. ([Int], [Int]) -> Tensor n k v -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
([Int], [Int]) -> Tensor n k v -> Tensor n k v
aSymBlockTens ([Int], [Int])
inds Tensor n k v
t
aSymBlockATensFac1 :: (TIndex k1, TAdd v, Prod (SField Rational) v) =>
([Int],[Int]) ->
AbsTensor1 n1 k1 v ->
AbsTensor1 n1 k1 (TProd (SField Rational) v)
aSymBlockATensFac1 :: ([Int], [Int])
-> AbsTensor1 n1 k1 v
-> AbsTensor1 n1 k1 (TProd (SField Rational) v)
aSymBlockATensFac1 = ([Int], [Int])
-> AbsTensor1 n1 k1 v
-> AbsTensor1 n1 k1 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
([Int], [Int])
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
aSymBlockTensFac
aSymBlockATensFac2 :: (TIndex k1, TAdd v, Prod (SField Rational) v) =>
([Int],[Int]) ->
AbsTensor2 n1 n2 k1 v ->
AbsTensor2 n1 n2 k1 (TProd (SField Rational) v)
aSymBlockATensFac2 :: ([Int], [Int])
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 (TProd (SField Rational) v)
aSymBlockATensFac2 = (Tensor n2 k1 v -> Tensor n2 k1 (TProd (SField Rational) v))
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) k.
(v1 -> v2) -> Tensor n1 k v1 -> Tensor n1 k v2
mapTo1 ((Tensor n2 k1 v -> Tensor n2 k1 (TProd (SField Rational) v))
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 (TProd (SField Rational) v))
-> (([Int], [Int])
-> Tensor n2 k1 v -> Tensor n2 k1 (TProd (SField Rational) v))
-> ([Int], [Int])
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int])
-> Tensor n2 k1 v -> Tensor n2 k1 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
([Int], [Int])
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
aSymBlockTensFac
aSymBlockATensFac3 :: (TIndex k1, TIndex k2, TAdd v, Prod (SField Rational) v) =>
([Int],[Int]) ->
AbsTensor3 n1 n2 n3 k1 k2 v ->
AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v)
aSymBlockATensFac3 :: ([Int], [Int])
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v)
aSymBlockATensFac3 = (Tensor n3 k2 v -> Tensor n3 k2 (TProd (SField Rational) v))
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) k.
(v1 -> v2) -> Tensor2 n1 n2 k v1 -> Tensor2 n1 n2 k v2
mapTo2 ((Tensor n3 k2 v -> Tensor n3 k2 (TProd (SField Rational) v))
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v))
-> (([Int], [Int])
-> Tensor n3 k2 v -> Tensor n3 k2 (TProd (SField Rational) v))
-> ([Int], [Int])
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int])
-> Tensor n3 k2 v -> Tensor n3 k2 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
([Int], [Int])
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
aSymBlockTensFac
aSymBlockATensFac4 :: (TIndex k1, TIndex k2, TAdd v, Prod (SField Rational) v) =>
([Int],[Int]) ->
AbsTensor4 n1 n2 n3 n4 k1 k2 v ->
AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v)
aSymBlockATensFac4 :: ([Int], [Int])
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v)
aSymBlockATensFac4 = (Tensor n4 k2 v -> Tensor n4 k2 (TProd (SField Rational) v))
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor3 n1 n2 n3 k1 k2 v1 -> AbsTensor3 n1 n2 n3 k1 k2 v2
mapTo3 ((Tensor n4 k2 v -> Tensor n4 k2 (TProd (SField Rational) v))
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v))
-> (([Int], [Int])
-> Tensor n4 k2 v -> Tensor n4 k2 (TProd (SField Rational) v))
-> ([Int], [Int])
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int])
-> Tensor n4 k2 v -> Tensor n4 k2 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
([Int], [Int])
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
aSymBlockTensFac
aSymBlockATensFac5 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v, Prod (SField Rational) v) =>
([Int],[Int]) ->
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v ->
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v)
aSymBlockATensFac5 :: ([Int], [Int])
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v)
aSymBlockATensFac5 = (Tensor n5 k3 v -> Tensor n5 k3 (TProd (SField Rational) v))
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v1
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v2
mapTo4 ((Tensor n5 k3 v -> Tensor n5 k3 (TProd (SField Rational) v))
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v))
-> (([Int], [Int])
-> Tensor n5 k3 v -> Tensor n5 k3 (TProd (SField Rational) v))
-> ([Int], [Int])
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int])
-> Tensor n5 k3 v -> Tensor n5 k3 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
([Int], [Int])
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
aSymBlockTensFac
aSymBlockATensFac6 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v, Prod (SField Rational) v) =>
([Int],[Int]) ->
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v ->
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v)
aSymBlockATensFac6 :: ([Int], [Int])
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6
n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v)
aSymBlockATensFac6 = (Tensor n6 k3 v -> Tensor n6 k3 (TProd (SField Rational) v))
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6
n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v1
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v2
mapTo5 ((Tensor n6 k3 v -> Tensor n6 k3 (TProd (SField Rational) v))
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6
n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v))
-> (([Int], [Int])
-> Tensor n6 k3 v -> Tensor n6 k3 (TProd (SField Rational) v))
-> ([Int], [Int])
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6
n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int])
-> Tensor n6 k3 v -> Tensor n6 k3 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
([Int], [Int])
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
aSymBlockTensFac
aSymBlockATensFac7 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v, Prod (SField Rational) v) =>
([Int],[Int]) ->
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v ->
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v)
aSymBlockATensFac7 :: ([Int], [Int])
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7
n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v)
aSymBlockATensFac7 = (Tensor n7 k4 v -> Tensor n7 k4 (TProd (SField Rational) v))
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7
n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v1
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v2
mapTo6 ((Tensor n7 k4 v -> Tensor n7 k4 (TProd (SField Rational) v))
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7
n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v))
-> (([Int], [Int])
-> Tensor n7 k4 v -> Tensor n7 k4 (TProd (SField Rational) v))
-> ([Int], [Int])
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7
n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int])
-> Tensor n7 k4 v -> Tensor n7 k4 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
([Int], [Int])
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
aSymBlockTensFac
aSymBlockATensFac8 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v, Prod (SField Rational) v) =>
([Int],[Int]) ->
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v ->
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v)
aSymBlockATensFac8 :: ([Int], [Int])
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8
n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v)
aSymBlockATensFac8 = (Tensor n8 k4 v -> Tensor n8 k4 (TProd (SField Rational) v))
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8
n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) (n7 :: Nat) k1 k2 k3 k4.
(v1 -> v2)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v1
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v2
mapTo7 ((Tensor n8 k4 v -> Tensor n8 k4 (TProd (SField Rational) v))
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8
n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v))
-> (([Int], [Int])
-> Tensor n8 k4 v -> Tensor n8 k4 (TProd (SField Rational) v))
-> ([Int], [Int])
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8
n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [Int])
-> Tensor n8 k4 v -> Tensor n8 k4 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
([Int], [Int])
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
aSymBlockTensFac
getAllSwaps :: [Int] -> [[(Int,Int)]]
getAllSwaps :: [Int] -> [[(Int, Int)]]
getAllSwaps [Int
x,Int
y] = [[(Int
x,Int
y)]]
getAllSwaps (Int
x:[Int]
xs) = [[(Int, Int)]]
lNew [[(Int, Int)]] -> [[(Int, Int)]] -> [[(Int, Int)]]
forall a. [a] -> [a] -> [a]
++ [[(Int, Int)]]
l' [[(Int, Int)]] -> [[(Int, Int)]] -> [[(Int, Int)]]
forall a. [a] -> [a] -> [a]
++ ((:) ((Int, Int) -> [(Int, Int)] -> [(Int, Int)])
-> [(Int, Int)] -> [[(Int, Int)] -> [(Int, Int)]]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [(Int, Int)]
l [[(Int, Int)] -> [(Int, Int)]] -> [[(Int, Int)]] -> [[(Int, Int)]]
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [[(Int, Int)]]
l')
where
l :: [(Int, Int)]
l = [Int] -> [Int] -> [(Int, Int)]
forall a b. [a] -> [b] -> [(a, b)]
zip (Int -> [Int]
forall a. a -> [a]
repeat Int
x) [Int]
xs
lNew :: [[(Int, Int)]]
lNew = ((Int, Int) -> [(Int, Int)]) -> [(Int, Int)] -> [[(Int, Int)]]
forall a b. (a -> b) -> [a] -> [b]
map (Int, Int) -> [(Int, Int)]
forall (f :: * -> *) a. Applicative f => a -> f a
pure [(Int, Int)]
l
l' :: [[(Int, Int)]]
l' = [Int] -> [[(Int, Int)]]
getAllSwaps [Int]
xs
getAllSwaps [Int]
_ = String -> [[(Int, Int)]]
forall a. HasCallStack => String -> a
error String
"cannot get swaps from empty permutations"
getAllBlockSwaps :: [[Int]] -> [[([Int],[Int])]]
getAllBlockSwaps :: [[Int]] -> [[([Int], [Int])]]
getAllBlockSwaps [[Int]
x,[Int]
y] = [[([Int]
x,[Int]
y)]]
getAllBlockSwaps ([Int]
x:[[Int]]
xs) = [[([Int], [Int])]]
lNew [[([Int], [Int])]] -> [[([Int], [Int])]] -> [[([Int], [Int])]]
forall a. [a] -> [a] -> [a]
++ [[([Int], [Int])]]
l' [[([Int], [Int])]] -> [[([Int], [Int])]] -> [[([Int], [Int])]]
forall a. [a] -> [a] -> [a]
++ ((:) (([Int], [Int]) -> [([Int], [Int])] -> [([Int], [Int])])
-> [([Int], [Int])] -> [[([Int], [Int])] -> [([Int], [Int])]]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [([Int], [Int])]
l [[([Int], [Int])] -> [([Int], [Int])]]
-> [[([Int], [Int])]] -> [[([Int], [Int])]]
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [[([Int], [Int])]]
l')
where
l :: [([Int], [Int])]
l = [[Int]] -> [[Int]] -> [([Int], [Int])]
forall a b. [a] -> [b] -> [(a, b)]
zip ([Int] -> [[Int]]
forall a. a -> [a]
repeat [Int]
x) [[Int]]
xs
lNew :: [[([Int], [Int])]]
lNew = (([Int], [Int]) -> [([Int], [Int])])
-> [([Int], [Int])] -> [[([Int], [Int])]]
forall a b. (a -> b) -> [a] -> [b]
map ([Int], [Int]) -> [([Int], [Int])]
forall (f :: * -> *) a. Applicative f => a -> f a
pure [([Int], [Int])]
l
l' :: [[([Int], [Int])]]
l' = [[Int]] -> [[([Int], [Int])]]
getAllBlockSwaps [[Int]]
xs
getAllBlockSwaps [[Int]]
_ = String -> [[([Int], [Int])]]
forall a. HasCallStack => String -> a
error String
"cannot get swaps from empty permutations"
factorial :: Int -> Int
factorial :: Int -> Int
factorial Int
1 = Int
1
factorial Int
n = Int
n Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int -> Int
factorial (Int
nInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1)
cyclicSymTens :: (TIndex k, TAdd v) => [Int] -> Tensor n k v -> Tensor n k v
cyclicSymTens :: [Int] -> Tensor n k v -> Tensor n k v
cyclicSymTens [Int]
inds Tensor n k v
t = Tensor n k v
newTens
where
swapList :: [[(Int, Int)]]
swapList = [Int] -> [[(Int, Int)]]
getAllSwaps [Int]
inds
tensList :: [Tensor n k v]
tensList = ([(Int, Int)] -> Tensor n k v) -> [[(Int, Int)]] -> [Tensor n k v]
forall a b. (a -> b) -> [a] -> [b]
map (((Int, Int) -> Tensor n k v -> Tensor n k v)
-> Tensor n k v -> [(Int, Int)] -> Tensor n k v
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr (Int, Int) -> Tensor n k v -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
tensorTrans Tensor n k v
t) [[(Int, Int)]]
swapList
newTens :: Tensor n k v
newTens = (Tensor n k v -> Tensor n k v -> Tensor n k v)
-> Tensor n k v -> [Tensor n k v] -> Tensor n k v
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr Tensor n k v -> Tensor n k v -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
Tensor n k v -> Tensor n k v -> Tensor n k v
(&+) Tensor n k v
t [Tensor n k v]
tensList
cyclicSymATens1 :: (TIndex k1, TAdd v) =>
[Int] ->
AbsTensor1 n1 k1 v ->
AbsTensor1 n1 k1 v
cyclicSymATens1 :: [Int] -> AbsTensor1 n1 k1 v -> AbsTensor1 n1 k1 v
cyclicSymATens1 = [Int] -> AbsTensor1 n1 k1 v -> AbsTensor1 n1 k1 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[Int] -> Tensor n k v -> Tensor n k v
cyclicSymTens
cyclicSymATens2 :: (TIndex k1, TAdd v) =>
[Int] ->
AbsTensor2 n1 n2 k1 v ->
AbsTensor2 n1 n2 k1 v
cyclicSymATens2 :: [Int] -> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v
cyclicSymATens2 = (Tensor n2 k1 v -> Tensor n2 k1 v)
-> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v
forall v1 v2 (n1 :: Nat) k.
(v1 -> v2) -> Tensor n1 k v1 -> Tensor n1 k v2
mapTo1 ((Tensor n2 k1 v -> Tensor n2 k1 v)
-> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v)
-> ([Int] -> Tensor n2 k1 v -> Tensor n2 k1 v)
-> [Int]
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n2 k1 v -> Tensor n2 k1 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[Int] -> Tensor n k v -> Tensor n k v
cyclicSymTens
cyclicSymATens3 :: (TIndex k1, TIndex k2, TAdd v) =>
[Int] ->
AbsTensor3 n1 n2 n3 k1 k2 v ->
AbsTensor3 n1 n2 n3 k1 k2 v
cyclicSymATens3 :: [Int] -> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v
cyclicSymATens3 = (Tensor n3 k2 v -> Tensor n3 k2 v)
-> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) k.
(v1 -> v2) -> Tensor2 n1 n2 k v1 -> Tensor2 n1 n2 k v2
mapTo2 ((Tensor n3 k2 v -> Tensor n3 k2 v)
-> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v)
-> ([Int] -> Tensor n3 k2 v -> Tensor n3 k2 v)
-> [Int]
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n3 k2 v -> Tensor n3 k2 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[Int] -> Tensor n k v -> Tensor n k v
cyclicSymTens
cyclicSymATens4 :: (TIndex k1, TIndex k2, TAdd v) =>
[Int] ->
AbsTensor4 n1 n2 n3 n4 k1 k2 v ->
AbsTensor4 n1 n2 n3 n4 k1 k2 v
cyclicSymATens4 :: [Int]
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
cyclicSymATens4 = (Tensor n4 k2 v -> Tensor n4 k2 v)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor3 n1 n2 n3 k1 k2 v1 -> AbsTensor3 n1 n2 n3 k1 k2 v2
mapTo3 ((Tensor n4 k2 v -> Tensor n4 k2 v)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v)
-> ([Int] -> Tensor n4 k2 v -> Tensor n4 k2 v)
-> [Int]
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n4 k2 v -> Tensor n4 k2 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[Int] -> Tensor n k v -> Tensor n k v
cyclicSymTens
cyclicSymATens5 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[Int] ->
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v ->
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
cyclicSymATens5 :: [Int]
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
cyclicSymATens5 = (Tensor n5 k3 v -> Tensor n5 k3 v)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v1
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v2
mapTo4 ((Tensor n5 k3 v -> Tensor n5 k3 v)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v)
-> ([Int] -> Tensor n5 k3 v -> Tensor n5 k3 v)
-> [Int]
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n5 k3 v -> Tensor n5 k3 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[Int] -> Tensor n k v -> Tensor n k v
cyclicSymTens
cyclicSymATens6 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[Int] ->
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v ->
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
cyclicSymATens6 :: [Int]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
cyclicSymATens6 = (Tensor n6 k3 v -> Tensor n6 k3 v)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v1
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v2
mapTo5 ((Tensor n6 k3 v -> Tensor n6 k3 v)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v)
-> ([Int] -> Tensor n6 k3 v -> Tensor n6 k3 v)
-> [Int]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n6 k3 v -> Tensor n6 k3 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[Int] -> Tensor n k v -> Tensor n k v
cyclicSymTens
cyclicSymATens7 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) =>
[Int] ->
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v ->
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
cyclicSymATens7 :: [Int]
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
cyclicSymATens7 = (Tensor n7 k4 v -> Tensor n7 k4 v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v1
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v2
mapTo6 ((Tensor n7 k4 v -> Tensor n7 k4 v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v)
-> ([Int] -> Tensor n7 k4 v -> Tensor n7 k4 v)
-> [Int]
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n7 k4 v -> Tensor n7 k4 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[Int] -> Tensor n k v -> Tensor n k v
cyclicSymTens
cyclicSymATens8 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) =>
[Int] ->
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v ->
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
cyclicSymATens8 :: [Int]
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
cyclicSymATens8 = (Tensor n8 k4 v -> Tensor n8 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) (n7 :: Nat) k1 k2 k3 k4.
(v1 -> v2)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v1
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v2
mapTo7 ((Tensor n8 k4 v -> Tensor n8 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v)
-> ([Int] -> Tensor n8 k4 v -> Tensor n8 k4 v)
-> [Int]
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n8 k4 v -> Tensor n8 k4 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[Int] -> Tensor n k v -> Tensor n k v
cyclicSymTens
cyclicSymTensFac :: (TIndex k, TAdd v, Prod (SField Rational) v) => [Int] -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
cyclicSymTensFac :: [Int] -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
cyclicSymTensFac [Int]
inds Tensor n k v
t = SField Rational
fac SField Rational
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
forall k s v (n :: Nat).
(TIndex k, Prod s v) =>
s -> Tensor n k v -> Tensor n k (TProd s v)
&. [Int] -> Tensor n k v -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[Int] -> Tensor n k v -> Tensor n k v
cyclicSymTens [Int]
inds Tensor n k v
t
where
fac :: SField Rational
fac = Rational -> SField Rational
forall a. a -> SField a
SField (Rational
1 Rational -> Rational -> Rational
forall a. Fractional a => a -> a -> a
/ Int -> Rational
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Int
factorial (Int -> Int) -> Int -> Int
forall a b. (a -> b) -> a -> b
$ [Int] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [Int]
inds) :: Rational)
cyclicSymATensFac1 :: (TIndex k1, TAdd v, Prod (SField Rational) v) =>
[Int] ->
AbsTensor1 n1 k1 v ->
AbsTensor1 n1 k1 (TProd (SField Rational) v)
cyclicSymATensFac1 :: [Int]
-> AbsTensor1 n1 k1 v
-> AbsTensor1 n1 k1 (TProd (SField Rational) v)
cyclicSymATensFac1 = [Int]
-> AbsTensor1 n1 k1 v
-> AbsTensor1 n1 k1 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
[Int] -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
cyclicSymTensFac
cyclicSymATensFac2 :: (TIndex k1, TAdd v, Prod (SField Rational) v) =>
[Int] ->
AbsTensor2 n1 n2 k1 v ->
AbsTensor2 n1 n2 k1 (TProd (SField Rational) v)
cyclicSymATensFac2 :: [Int]
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 (TProd (SField Rational) v)
cyclicSymATensFac2 = (Tensor n2 k1 v -> Tensor n2 k1 (TProd (SField Rational) v))
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) k.
(v1 -> v2) -> Tensor n1 k v1 -> Tensor n1 k v2
mapTo1 ((Tensor n2 k1 v -> Tensor n2 k1 (TProd (SField Rational) v))
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 (TProd (SField Rational) v))
-> ([Int]
-> Tensor n2 k1 v -> Tensor n2 k1 (TProd (SField Rational) v))
-> [Int]
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n2 k1 v -> Tensor n2 k1 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
[Int] -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
cyclicSymTensFac
cyclicSymATensFac3 :: (TIndex k1, TIndex k2, TAdd v, Prod (SField Rational) v) =>
[Int] ->
AbsTensor3 n1 n2 n3 k1 k2 v ->
AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v)
cyclicSymATensFac3 :: [Int]
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v)
cyclicSymATensFac3 = (Tensor n3 k2 v -> Tensor n3 k2 (TProd (SField Rational) v))
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) k.
(v1 -> v2) -> Tensor2 n1 n2 k v1 -> Tensor2 n1 n2 k v2
mapTo2 ((Tensor n3 k2 v -> Tensor n3 k2 (TProd (SField Rational) v))
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v))
-> ([Int]
-> Tensor n3 k2 v -> Tensor n3 k2 (TProd (SField Rational) v))
-> [Int]
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n3 k2 v -> Tensor n3 k2 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
[Int] -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
cyclicSymTensFac
cyclicSymATensFac4 :: (TIndex k1, TIndex k2, TAdd v, Prod (SField Rational) v) =>
[Int] ->
AbsTensor4 n1 n2 n3 n4 k1 k2 v ->
AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v)
cyclicSymATensFac4 :: [Int]
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v)
cyclicSymATensFac4 = (Tensor n4 k2 v -> Tensor n4 k2 (TProd (SField Rational) v))
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor3 n1 n2 n3 k1 k2 v1 -> AbsTensor3 n1 n2 n3 k1 k2 v2
mapTo3 ((Tensor n4 k2 v -> Tensor n4 k2 (TProd (SField Rational) v))
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v))
-> ([Int]
-> Tensor n4 k2 v -> Tensor n4 k2 (TProd (SField Rational) v))
-> [Int]
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n4 k2 v -> Tensor n4 k2 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
[Int] -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
cyclicSymTensFac
cyclicSymATensFac5 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v, Prod (SField Rational) v) =>
[Int] ->
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v ->
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v)
cyclicSymATensFac5 :: [Int]
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v)
cyclicSymATensFac5 = (Tensor n5 k3 v -> Tensor n5 k3 (TProd (SField Rational) v))
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v1
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v2
mapTo4 ((Tensor n5 k3 v -> Tensor n5 k3 (TProd (SField Rational) v))
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v))
-> ([Int]
-> Tensor n5 k3 v -> Tensor n5 k3 (TProd (SField Rational) v))
-> [Int]
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n5 k3 v -> Tensor n5 k3 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
[Int] -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
cyclicSymTensFac
cyclicSymATensFac6 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v, Prod (SField Rational) v) =>
[Int] ->
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v ->
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v)
cyclicSymATensFac6 :: [Int]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6
n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v)
cyclicSymATensFac6 = (Tensor n6 k3 v -> Tensor n6 k3 (TProd (SField Rational) v))
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6
n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v1
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v2
mapTo5 ((Tensor n6 k3 v -> Tensor n6 k3 (TProd (SField Rational) v))
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6
n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v))
-> ([Int]
-> Tensor n6 k3 v -> Tensor n6 k3 (TProd (SField Rational) v))
-> [Int]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6
n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n6 k3 v -> Tensor n6 k3 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
[Int] -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
cyclicSymTensFac
cyclicSymATensFac7 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v, Prod (SField Rational) v) =>
[Int] ->
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v ->
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v)
cyclicSymATensFac7 :: [Int]
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7
n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v)
cyclicSymATensFac7 = (Tensor n7 k4 v -> Tensor n7 k4 (TProd (SField Rational) v))
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7
n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v1
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v2
mapTo6 ((Tensor n7 k4 v -> Tensor n7 k4 (TProd (SField Rational) v))
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7
n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v))
-> ([Int]
-> Tensor n7 k4 v -> Tensor n7 k4 (TProd (SField Rational) v))
-> [Int]
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7
n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n7 k4 v -> Tensor n7 k4 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
[Int] -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
cyclicSymTensFac
cyclicSymATensFac8 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v, Prod (SField Rational) v) =>
[Int] ->
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v ->
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v)
cyclicSymATensFac8 :: [Int]
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8
n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v)
cyclicSymATensFac8 = (Tensor n8 k4 v -> Tensor n8 k4 (TProd (SField Rational) v))
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8
n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) (n7 :: Nat) k1 k2 k3 k4.
(v1 -> v2)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v1
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v2
mapTo7 ((Tensor n8 k4 v -> Tensor n8 k4 (TProd (SField Rational) v))
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8
n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v))
-> ([Int]
-> Tensor n8 k4 v -> Tensor n8 k4 (TProd (SField Rational) v))
-> [Int]
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8
n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n8 k4 v -> Tensor n8 k4 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
[Int] -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
cyclicSymTensFac
cyclicASymTens :: (TIndex k, TAdd v) => [Int] -> Tensor n k v -> Tensor n k v
cyclicASymTens :: [Int] -> Tensor n k v -> Tensor n k v
cyclicASymTens [Int]
inds Tensor n k v
t = Tensor n k v
newTens
where
swapList :: [[(Int, Int)]]
swapList = [Int] -> [[(Int, Int)]]
getAllSwaps [Int]
inds
signList :: [Integer]
signList = ([(Int, Int)] -> Integer) -> [[(Int, Int)]] -> [Integer]
forall a b. (a -> b) -> [a] -> [b]
map (\[(Int, Int)]
x -> (-Integer
1 :: Integer) Integer -> Int -> Integer
forall a b. (Num a, Integral b) => a -> b -> a
^ [(Int, Int)] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [(Int, Int)]
x) [[(Int, Int)]]
swapList
tensList' :: [Tensor n k v]
tensList' = ([(Int, Int)] -> Tensor n k v) -> [[(Int, Int)]] -> [Tensor n k v]
forall a b. (a -> b) -> [a] -> [b]
map (((Int, Int) -> Tensor n k v -> Tensor n k v)
-> Tensor n k v -> [(Int, Int)] -> Tensor n k v
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr (Int, Int) -> Tensor n k v -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor n k v -> Tensor n k v
tensorTrans Tensor n k v
t) [[(Int, Int)]]
swapList
tensList :: [Tensor n k v]
tensList = (Integer -> Tensor n k v -> Tensor n k v)
-> [Integer] -> [Tensor n k v] -> [Tensor n k v]
forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith (\Integer
s Tensor n k v
v -> if Integer
s Integer -> Integer -> Bool
forall a. Eq a => a -> a -> Bool
== -Integer
1 then Tensor n k v -> Tensor n k v
forall a. TAdd a => a -> a
negateS Tensor n k v
v else Tensor n k v
v) [Integer]
signList [Tensor n k v]
tensList'
newTens :: Tensor n k v
newTens = (Tensor n k v -> Tensor n k v -> Tensor n k v)
-> Tensor n k v -> [Tensor n k v] -> Tensor n k v
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr Tensor n k v -> Tensor n k v -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
Tensor n k v -> Tensor n k v -> Tensor n k v
(&+) Tensor n k v
t [Tensor n k v]
tensList
cyclicASymATens1 :: (TIndex k1, TAdd v) =>
[Int] ->
AbsTensor1 n1 k1 v ->
AbsTensor1 n1 k1 v
cyclicASymATens1 :: [Int] -> AbsTensor1 n1 k1 v -> AbsTensor1 n1 k1 v
cyclicASymATens1 = [Int] -> AbsTensor1 n1 k1 v -> AbsTensor1 n1 k1 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[Int] -> Tensor n k v -> Tensor n k v
cyclicASymTens
cyclicASymATens2 :: (TIndex k1, TAdd v) =>
[Int] ->
AbsTensor2 n1 n2 k1 v ->
AbsTensor2 n1 n2 k1 v
cyclicASymATens2 :: [Int] -> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v
cyclicASymATens2 = (Tensor n2 k1 v -> Tensor n2 k1 v)
-> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v
forall v1 v2 (n1 :: Nat) k.
(v1 -> v2) -> Tensor n1 k v1 -> Tensor n1 k v2
mapTo1 ((Tensor n2 k1 v -> Tensor n2 k1 v)
-> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v)
-> ([Int] -> Tensor n2 k1 v -> Tensor n2 k1 v)
-> [Int]
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n2 k1 v -> Tensor n2 k1 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[Int] -> Tensor n k v -> Tensor n k v
cyclicASymTens
cyclicASymATens3 :: (TIndex k1, TIndex k2, TAdd v) =>
[Int] ->
AbsTensor3 n1 n2 n3 k1 k2 v ->
AbsTensor3 n1 n2 n3 k1 k2 v
cyclicASymATens3 :: [Int] -> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v
cyclicASymATens3 = (Tensor n3 k2 v -> Tensor n3 k2 v)
-> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) k.
(v1 -> v2) -> Tensor2 n1 n2 k v1 -> Tensor2 n1 n2 k v2
mapTo2 ((Tensor n3 k2 v -> Tensor n3 k2 v)
-> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v)
-> ([Int] -> Tensor n3 k2 v -> Tensor n3 k2 v)
-> [Int]
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n3 k2 v -> Tensor n3 k2 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[Int] -> Tensor n k v -> Tensor n k v
cyclicASymTens
cyclicASymATens4 :: (TIndex k1, TIndex k2, TAdd v) =>
[Int] ->
AbsTensor4 n1 n2 n3 n4 k1 k2 v ->
AbsTensor4 n1 n2 n3 n4 k1 k2 v
cyclicASymATens4 :: [Int]
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
cyclicASymATens4 = (Tensor n4 k2 v -> Tensor n4 k2 v)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor3 n1 n2 n3 k1 k2 v1 -> AbsTensor3 n1 n2 n3 k1 k2 v2
mapTo3 ((Tensor n4 k2 v -> Tensor n4 k2 v)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v)
-> ([Int] -> Tensor n4 k2 v -> Tensor n4 k2 v)
-> [Int]
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n4 k2 v -> Tensor n4 k2 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[Int] -> Tensor n k v -> Tensor n k v
cyclicASymTens
cyclicASymATens5 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[Int] ->
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v ->
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
cyclicASymATens5 :: [Int]
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
cyclicASymATens5 = (Tensor n5 k3 v -> Tensor n5 k3 v)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v1
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v2
mapTo4 ((Tensor n5 k3 v -> Tensor n5 k3 v)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v)
-> ([Int] -> Tensor n5 k3 v -> Tensor n5 k3 v)
-> [Int]
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n5 k3 v -> Tensor n5 k3 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[Int] -> Tensor n k v -> Tensor n k v
cyclicASymTens
cyclicASymATens6 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[Int] ->
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v ->
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
cyclicASymATens6 :: [Int]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
cyclicASymATens6 = (Tensor n6 k3 v -> Tensor n6 k3 v)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v1
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v2
mapTo5 ((Tensor n6 k3 v -> Tensor n6 k3 v)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v)
-> ([Int] -> Tensor n6 k3 v -> Tensor n6 k3 v)
-> [Int]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n6 k3 v -> Tensor n6 k3 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[Int] -> Tensor n k v -> Tensor n k v
cyclicASymTens
cyclicASymATens7 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) =>
[Int] ->
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v ->
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
cyclicASymATens7 :: [Int]
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
cyclicASymATens7 = (Tensor n7 k4 v -> Tensor n7 k4 v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v1
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v2
mapTo6 ((Tensor n7 k4 v -> Tensor n7 k4 v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v)
-> ([Int] -> Tensor n7 k4 v -> Tensor n7 k4 v)
-> [Int]
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n7 k4 v -> Tensor n7 k4 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[Int] -> Tensor n k v -> Tensor n k v
cyclicASymTens
cyclicASymATens8 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) =>
[Int] ->
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v ->
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
cyclicASymATens8 :: [Int]
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
cyclicASymATens8 = (Tensor n8 k4 v -> Tensor n8 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) (n7 :: Nat) k1 k2 k3 k4.
(v1 -> v2)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v1
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v2
mapTo7 ((Tensor n8 k4 v -> Tensor n8 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v)
-> ([Int] -> Tensor n8 k4 v -> Tensor n8 k4 v)
-> [Int]
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n8 k4 v -> Tensor n8 k4 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[Int] -> Tensor n k v -> Tensor n k v
cyclicASymTens
cyclicASymTensFac :: (TIndex k, TAdd v, Prod (SField Rational) v) => [Int] -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
cyclicASymTensFac :: [Int] -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
cyclicASymTensFac [Int]
inds Tensor n k v
t = SField Rational
fac SField Rational
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
forall k s v (n :: Nat).
(TIndex k, Prod s v) =>
s -> Tensor n k v -> Tensor n k (TProd s v)
&. [Int] -> Tensor n k v -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[Int] -> Tensor n k v -> Tensor n k v
cyclicASymTens [Int]
inds Tensor n k v
t
where
fac :: SField Rational
fac = Rational -> SField Rational
forall a. a -> SField a
SField (Rational
1 Rational -> Rational -> Rational
forall a. Fractional a => a -> a -> a
/ Int -> Rational
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Int
factorial (Int -> Int) -> Int -> Int
forall a b. (a -> b) -> a -> b
$ [Int] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [Int]
inds) :: Rational)
cyclicASymATensFac1 :: (TIndex k1, TAdd v, Prod (SField Rational) v) =>
[Int] ->
AbsTensor1 n1 k1 v ->
AbsTensor1 n1 k1 (TProd (SField Rational) v)
cyclicASymATensFac1 :: [Int]
-> AbsTensor1 n1 k1 v
-> AbsTensor1 n1 k1 (TProd (SField Rational) v)
cyclicASymATensFac1 = [Int]
-> AbsTensor1 n1 k1 v
-> AbsTensor1 n1 k1 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
[Int] -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
cyclicASymTensFac
cyclicASymATensFac2 :: (TIndex k1, TAdd v, Prod (SField Rational) v) =>
[Int] ->
AbsTensor2 n1 n2 k1 v ->
AbsTensor2 n1 n2 k1 (TProd (SField Rational) v)
cyclicASymATensFac2 :: [Int]
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 (TProd (SField Rational) v)
cyclicASymATensFac2 = (Tensor n2 k1 v -> Tensor n2 k1 (TProd (SField Rational) v))
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) k.
(v1 -> v2) -> Tensor n1 k v1 -> Tensor n1 k v2
mapTo1 ((Tensor n2 k1 v -> Tensor n2 k1 (TProd (SField Rational) v))
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 (TProd (SField Rational) v))
-> ([Int]
-> Tensor n2 k1 v -> Tensor n2 k1 (TProd (SField Rational) v))
-> [Int]
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n2 k1 v -> Tensor n2 k1 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
[Int] -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
cyclicASymTensFac
cyclicASymATensFac3 :: (TIndex k1, TIndex k2, TAdd v, Prod (SField Rational) v) =>
[Int] ->
AbsTensor3 n1 n2 n3 k1 k2 v ->
AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v)
cyclicASymATensFac3 :: [Int]
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v)
cyclicASymATensFac3 = (Tensor n3 k2 v -> Tensor n3 k2 (TProd (SField Rational) v))
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) k.
(v1 -> v2) -> Tensor2 n1 n2 k v1 -> Tensor2 n1 n2 k v2
mapTo2 ((Tensor n3 k2 v -> Tensor n3 k2 (TProd (SField Rational) v))
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v))
-> ([Int]
-> Tensor n3 k2 v -> Tensor n3 k2 (TProd (SField Rational) v))
-> [Int]
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n3 k2 v -> Tensor n3 k2 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
[Int] -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
cyclicASymTensFac
cyclicASymATensFac4 :: (TIndex k1, TIndex k2, TAdd v, Prod (SField Rational) v) =>
[Int] ->
AbsTensor4 n1 n2 n3 n4 k1 k2 v ->
AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v)
cyclicASymATensFac4 :: [Int]
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v)
cyclicASymATensFac4 = (Tensor n4 k2 v -> Tensor n4 k2 (TProd (SField Rational) v))
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor3 n1 n2 n3 k1 k2 v1 -> AbsTensor3 n1 n2 n3 k1 k2 v2
mapTo3 ((Tensor n4 k2 v -> Tensor n4 k2 (TProd (SField Rational) v))
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v))
-> ([Int]
-> Tensor n4 k2 v -> Tensor n4 k2 (TProd (SField Rational) v))
-> [Int]
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n4 k2 v -> Tensor n4 k2 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
[Int] -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
cyclicASymTensFac
cyclicASymATensFac5 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v, Prod (SField Rational) v) =>
[Int] ->
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v ->
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v)
cyclicASymATensFac5 :: [Int]
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v)
cyclicASymATensFac5 = (Tensor n5 k3 v -> Tensor n5 k3 (TProd (SField Rational) v))
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v1
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v2
mapTo4 ((Tensor n5 k3 v -> Tensor n5 k3 (TProd (SField Rational) v))
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v))
-> ([Int]
-> Tensor n5 k3 v -> Tensor n5 k3 (TProd (SField Rational) v))
-> [Int]
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n5 k3 v -> Tensor n5 k3 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
[Int] -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
cyclicASymTensFac
cyclicASymATensFac6 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v, Prod (SField Rational) v) =>
[Int] ->
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v ->
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v)
cyclicASymATensFac6 :: [Int]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6
n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v)
cyclicASymATensFac6 = (Tensor n6 k3 v -> Tensor n6 k3 (TProd (SField Rational) v))
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6
n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v1
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v2
mapTo5 ((Tensor n6 k3 v -> Tensor n6 k3 (TProd (SField Rational) v))
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6
n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v))
-> ([Int]
-> Tensor n6 k3 v -> Tensor n6 k3 (TProd (SField Rational) v))
-> [Int]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6
n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n6 k3 v -> Tensor n6 k3 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
[Int] -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
cyclicASymTensFac
cyclicASymATensFac7 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v, Prod (SField Rational) v) =>
[Int] ->
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v ->
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v)
cyclicASymATensFac7 :: [Int]
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7
n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v)
cyclicASymATensFac7 = (Tensor n7 k4 v -> Tensor n7 k4 (TProd (SField Rational) v))
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7
n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v1
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v2
mapTo6 ((Tensor n7 k4 v -> Tensor n7 k4 (TProd (SField Rational) v))
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7
n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v))
-> ([Int]
-> Tensor n7 k4 v -> Tensor n7 k4 (TProd (SField Rational) v))
-> [Int]
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7
n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n7 k4 v -> Tensor n7 k4 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
[Int] -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
cyclicASymTensFac
cyclicASymATensFac8 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v, Prod (SField Rational) v) =>
[Int] ->
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v ->
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v)
cyclicASymATensFac8 :: [Int]
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8
n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v)
cyclicASymATensFac8 = (Tensor n8 k4 v -> Tensor n8 k4 (TProd (SField Rational) v))
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8
n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) (n7 :: Nat) k1 k2 k3 k4.
(v1 -> v2)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v1
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v2
mapTo7 ((Tensor n8 k4 v -> Tensor n8 k4 (TProd (SField Rational) v))
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8
n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v))
-> ([Int]
-> Tensor n8 k4 v -> Tensor n8 k4 (TProd (SField Rational) v))
-> [Int]
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8
n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> Tensor n8 k4 v -> Tensor n8 k4 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
[Int] -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
cyclicASymTensFac
cyclicBlockSymTens :: (TIndex k, TAdd v) => [[Int]] -> Tensor n k v -> Tensor n k v
cyclicBlockSymTens :: [[Int]] -> Tensor n k v -> Tensor n k v
cyclicBlockSymTens [[Int]]
inds Tensor n k v
t = Tensor n k v
newTens
where
swapList :: [[([Int], [Int])]]
swapList = [[Int]] -> [[([Int], [Int])]]
getAllBlockSwaps [[Int]]
inds
tensList :: [Tensor n k v]
tensList = ([([Int], [Int])] -> Tensor n k v)
-> [[([Int], [Int])]] -> [Tensor n k v]
forall a b. (a -> b) -> [a] -> [b]
map ((([Int], [Int]) -> Tensor n k v -> Tensor n k v)
-> Tensor n k v -> [([Int], [Int])] -> Tensor n k v
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr ([Int], [Int]) -> Tensor n k v -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
([Int], [Int]) -> Tensor n k v -> Tensor n k v
tensorBlockTrans Tensor n k v
t) [[([Int], [Int])]]
swapList
newTens :: Tensor n k v
newTens = (Tensor n k v -> Tensor n k v -> Tensor n k v)
-> Tensor n k v -> [Tensor n k v] -> Tensor n k v
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr Tensor n k v -> Tensor n k v -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
Tensor n k v -> Tensor n k v -> Tensor n k v
(&+) Tensor n k v
t [Tensor n k v]
tensList
cyclicBlockSymATens1 :: (TIndex k1, TAdd v) =>
[[Int]] ->
AbsTensor1 n1 k1 v ->
AbsTensor1 n1 k1 v
cyclicBlockSymATens1 :: [[Int]] -> AbsTensor1 n1 k1 v -> AbsTensor1 n1 k1 v
cyclicBlockSymATens1 = [[Int]] -> AbsTensor1 n1 k1 v -> AbsTensor1 n1 k1 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[[Int]] -> Tensor n k v -> Tensor n k v
cyclicBlockSymTens
cyclicBlockSymATens2 :: (TIndex k1, TAdd v) =>
[[Int]] ->
AbsTensor2 n1 n2 k1 v ->
AbsTensor2 n1 n2 k1 v
cyclicBlockSymATens2 :: [[Int]] -> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v
cyclicBlockSymATens2 = (Tensor n2 k1 v -> Tensor n2 k1 v)
-> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v
forall v1 v2 (n1 :: Nat) k.
(v1 -> v2) -> Tensor n1 k v1 -> Tensor n1 k v2
mapTo1 ((Tensor n2 k1 v -> Tensor n2 k1 v)
-> AbsTensor2 n1 n2 k1 v -> AbsTensor2 n1 n2 k1 v)
-> ([[Int]] -> Tensor n2 k1 v -> Tensor n2 k1 v)
-> [[Int]]
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [[Int]] -> Tensor n2 k1 v -> Tensor n2 k1 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[[Int]] -> Tensor n k v -> Tensor n k v
cyclicBlockSymTens
cyclicBlockSymATens3 :: (TIndex k1, TIndex k2, TAdd v) =>
[[Int]] ->
AbsTensor3 n1 n2 n3 k1 k2 v ->
AbsTensor3 n1 n2 n3 k1 k2 v
cyclicBlockSymATens3 :: [[Int]]
-> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v
cyclicBlockSymATens3 = (Tensor n3 k2 v -> Tensor n3 k2 v)
-> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) k.
(v1 -> v2) -> Tensor2 n1 n2 k v1 -> Tensor2 n1 n2 k v2
mapTo2 ((Tensor n3 k2 v -> Tensor n3 k2 v)
-> AbsTensor3 n1 n2 n3 k1 k2 v -> AbsTensor3 n1 n2 n3 k1 k2 v)
-> ([[Int]] -> Tensor n3 k2 v -> Tensor n3 k2 v)
-> [[Int]]
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [[Int]] -> Tensor n3 k2 v -> Tensor n3 k2 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[[Int]] -> Tensor n k v -> Tensor n k v
cyclicBlockSymTens
cyclicBlockSymATens4 :: (TIndex k1, TIndex k2, TAdd v) =>
[[Int]] ->
AbsTensor4 n1 n2 n3 n4 k1 k2 v ->
AbsTensor4 n1 n2 n3 n4 k1 k2 v
cyclicBlockSymATens4 :: [[Int]]
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
cyclicBlockSymATens4 = (Tensor n4 k2 v -> Tensor n4 k2 v)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor3 n1 n2 n3 k1 k2 v1 -> AbsTensor3 n1 n2 n3 k1 k2 v2
mapTo3 ((Tensor n4 k2 v -> Tensor n4 k2 v)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v)
-> ([[Int]] -> Tensor n4 k2 v -> Tensor n4 k2 v)
-> [[Int]]
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [[Int]] -> Tensor n4 k2 v -> Tensor n4 k2 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[[Int]] -> Tensor n k v -> Tensor n k v
cyclicBlockSymTens
cyclicBlockSymATens5 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[[Int]] ->
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v ->
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
cyclicBlockSymATens5 :: [[Int]]
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
cyclicBlockSymATens5 = (Tensor n5 k3 v -> Tensor n5 k3 v)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v1
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v2
mapTo4 ((Tensor n5 k3 v -> Tensor n5 k3 v)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v)
-> ([[Int]] -> Tensor n5 k3 v -> Tensor n5 k3 v)
-> [[Int]]
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [[Int]] -> Tensor n5 k3 v -> Tensor n5 k3 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[[Int]] -> Tensor n k v -> Tensor n k v
cyclicBlockSymTens
cyclicBlockSymATens6 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[[Int]] ->
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v ->
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
cyclicBlockSymATens6 :: [[Int]]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
cyclicBlockSymATens6 = (Tensor n6 k3 v -> Tensor n6 k3 v)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v1
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v2
mapTo5 ((Tensor n6 k3 v -> Tensor n6 k3 v)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v)
-> ([[Int]] -> Tensor n6 k3 v -> Tensor n6 k3 v)
-> [[Int]]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [[Int]] -> Tensor n6 k3 v -> Tensor n6 k3 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[[Int]] -> Tensor n k v -> Tensor n k v
cyclicBlockSymTens
cyclicBlockSymATens7 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) =>
[[Int]] ->
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v ->
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
cyclicBlockSymATens7 :: [[Int]]
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
cyclicBlockSymATens7 = (Tensor n7 k4 v -> Tensor n7 k4 v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v1
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v2
mapTo6 ((Tensor n7 k4 v -> Tensor n7 k4 v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v)
-> ([[Int]] -> Tensor n7 k4 v -> Tensor n7 k4 v)
-> [[Int]]
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [[Int]] -> Tensor n7 k4 v -> Tensor n7 k4 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[[Int]] -> Tensor n k v -> Tensor n k v
cyclicBlockSymTens
cyclicBlockSymATens8 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) =>
[[Int]] ->
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v ->
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
cyclicBlockSymATens8 :: [[Int]]
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
cyclicBlockSymATens8 = (Tensor n8 k4 v -> Tensor n8 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) (n7 :: Nat) k1 k2 k3 k4.
(v1 -> v2)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v1
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v2
mapTo7 ((Tensor n8 k4 v -> Tensor n8 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v)
-> ([[Int]] -> Tensor n8 k4 v -> Tensor n8 k4 v)
-> [[Int]]
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [[Int]] -> Tensor n8 k4 v -> Tensor n8 k4 v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[[Int]] -> Tensor n k v -> Tensor n k v
cyclicBlockSymTens
cyclicBlockSymTensFac :: (TIndex k, TAdd v, Prod (SField Rational) v) => [[Int]] -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
cyclicBlockSymTensFac :: [[Int]] -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
cyclicBlockSymTensFac [[Int]]
inds Tensor n k v
t = SField Rational
fac SField Rational
-> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
forall k s v (n :: Nat).
(TIndex k, Prod s v) =>
s -> Tensor n k v -> Tensor n k (TProd s v)
&. [[Int]] -> Tensor n k v -> Tensor n k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[[Int]] -> Tensor n k v -> Tensor n k v
cyclicBlockSymTens [[Int]]
inds Tensor n k v
t
where
fac :: SField Rational
fac = Rational -> SField Rational
forall a. a -> SField a
SField (Rational
1 Rational -> Rational -> Rational
forall a. Fractional a => a -> a -> a
/ Int -> Rational
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Int
factorial (Int -> Int) -> Int -> Int
forall a b. (a -> b) -> a -> b
$ [[Int]] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [[Int]]
inds) :: Rational)
cyclicBlockSymATensFac1 :: (TIndex k1, TAdd v, Prod (SField Rational) v) =>
[[Int]] ->
AbsTensor1 n1 k1 v ->
AbsTensor1 n1 k1 (TProd (SField Rational) v)
cyclicBlockSymATensFac1 :: [[Int]]
-> AbsTensor1 n1 k1 v
-> AbsTensor1 n1 k1 (TProd (SField Rational) v)
cyclicBlockSymATensFac1 = [[Int]]
-> AbsTensor1 n1 k1 v
-> AbsTensor1 n1 k1 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
[[Int]] -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
cyclicBlockSymTensFac
cyclicBlockSymATensFac2 :: (TIndex k1, TAdd v, Prod (SField Rational) v) =>
[[Int]] ->
AbsTensor2 n1 n2 k1 v ->
AbsTensor2 n1 n2 k1 (TProd (SField Rational) v)
cyclicBlockSymATensFac2 :: [[Int]]
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 (TProd (SField Rational) v)
cyclicBlockSymATensFac2 = (Tensor n2 k1 v -> Tensor n2 k1 (TProd (SField Rational) v))
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) k.
(v1 -> v2) -> Tensor n1 k v1 -> Tensor n1 k v2
mapTo1 ((Tensor n2 k1 v -> Tensor n2 k1 (TProd (SField Rational) v))
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 (TProd (SField Rational) v))
-> ([[Int]]
-> Tensor n2 k1 v -> Tensor n2 k1 (TProd (SField Rational) v))
-> [[Int]]
-> AbsTensor2 n1 n2 k1 v
-> AbsTensor2 n1 n2 k1 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [[Int]]
-> Tensor n2 k1 v -> Tensor n2 k1 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
[[Int]] -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
cyclicBlockSymTensFac
cyclicBlockSymATensFac3 :: (TIndex k1, TIndex k2, TAdd v, Prod (SField Rational) v) =>
[[Int]] ->
AbsTensor3 n1 n2 n3 k1 k2 v ->
AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v)
cyclicBlockSymATensFac3 :: [[Int]]
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v)
cyclicBlockSymATensFac3 = (Tensor n3 k2 v -> Tensor n3 k2 (TProd (SField Rational) v))
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) k.
(v1 -> v2) -> Tensor2 n1 n2 k v1 -> Tensor2 n1 n2 k v2
mapTo2 ((Tensor n3 k2 v -> Tensor n3 k2 (TProd (SField Rational) v))
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v))
-> ([[Int]]
-> Tensor n3 k2 v -> Tensor n3 k2 (TProd (SField Rational) v))
-> [[Int]]
-> AbsTensor3 n1 n2 n3 k1 k2 v
-> AbsTensor3 n1 n2 n3 k1 k2 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [[Int]]
-> Tensor n3 k2 v -> Tensor n3 k2 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
[[Int]] -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
cyclicBlockSymTensFac
cyclicBlockSymATensFac4 :: (TIndex k1, TIndex k2, TAdd v, Prod (SField Rational) v) =>
[[Int]] ->
AbsTensor4 n1 n2 n3 n4 k1 k2 v ->
AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v)
cyclicBlockSymATensFac4 :: [[Int]]
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v)
cyclicBlockSymATensFac4 = (Tensor n4 k2 v -> Tensor n4 k2 (TProd (SField Rational) v))
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor3 n1 n2 n3 k1 k2 v1 -> AbsTensor3 n1 n2 n3 k1 k2 v2
mapTo3 ((Tensor n4 k2 v -> Tensor n4 k2 (TProd (SField Rational) v))
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v))
-> ([[Int]]
-> Tensor n4 k2 v -> Tensor n4 k2 (TProd (SField Rational) v))
-> [[Int]]
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [[Int]]
-> Tensor n4 k2 v -> Tensor n4 k2 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
[[Int]] -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
cyclicBlockSymTensFac
cyclicBlockSymATensFac5 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v, Prod (SField Rational) v) =>
[[Int]] ->
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v ->
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v)
cyclicBlockSymATensFac5 :: [[Int]]
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v)
cyclicBlockSymATensFac5 = (Tensor n5 k3 v -> Tensor n5 k3 (TProd (SField Rational) v))
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v1
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v2
mapTo4 ((Tensor n5 k3 v -> Tensor n5 k3 (TProd (SField Rational) v))
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v))
-> ([[Int]]
-> Tensor n5 k3 v -> Tensor n5 k3 (TProd (SField Rational) v))
-> [[Int]]
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [[Int]]
-> Tensor n5 k3 v -> Tensor n5 k3 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
[[Int]] -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
cyclicBlockSymTensFac
cyclicBlockSymATensFac6 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v, Prod (SField Rational) v) =>
[[Int]] ->
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v ->
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v)
cyclicBlockSymATensFac6 :: [[Int]]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6
n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v)
cyclicBlockSymATensFac6 = (Tensor n6 k3 v -> Tensor n6 k3 (TProd (SField Rational) v))
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6
n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v1
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v2
mapTo5 ((Tensor n6 k3 v -> Tensor n6 k3 (TProd (SField Rational) v))
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6
n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v))
-> ([[Int]]
-> Tensor n6 k3 v -> Tensor n6 k3 (TProd (SField Rational) v))
-> [[Int]]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6
n1 n2 n3 n4 n5 n6 k1 k2 k3 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [[Int]]
-> Tensor n6 k3 v -> Tensor n6 k3 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
[[Int]] -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
cyclicBlockSymTensFac
cyclicBlockSymATensFac7 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v, Prod (SField Rational) v) =>
[[Int]] ->
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v ->
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v)
cyclicBlockSymATensFac7 :: [[Int]]
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7
n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v)
cyclicBlockSymATensFac7 = (Tensor n7 k4 v -> Tensor n7 k4 (TProd (SField Rational) v))
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7
n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v1
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v2
mapTo6 ((Tensor n7 k4 v -> Tensor n7 k4 (TProd (SField Rational) v))
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7
n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v))
-> ([[Int]]
-> Tensor n7 k4 v -> Tensor n7 k4 (TProd (SField Rational) v))
-> [[Int]]
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> AbsTensor7
n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [[Int]]
-> Tensor n7 k4 v -> Tensor n7 k4 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
[[Int]] -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
cyclicBlockSymTensFac
cyclicBlockSymATensFac8 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v, Prod (SField Rational) v) =>
[[Int]] ->
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v ->
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v)
cyclicBlockSymATensFac8 :: [[Int]]
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8
n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v)
cyclicBlockSymATensFac8 = (Tensor n8 k4 v -> Tensor n8 k4 (TProd (SField Rational) v))
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8
n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v)
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) (n7 :: Nat) k1 k2 k3 k4.
(v1 -> v2)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v1
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v2
mapTo7 ((Tensor n8 k4 v -> Tensor n8 k4 (TProd (SField Rational) v))
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8
n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v))
-> ([[Int]]
-> Tensor n8 k4 v -> Tensor n8 k4 (TProd (SField Rational) v))
-> [[Int]]
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> AbsTensor8
n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (TProd (SField Rational) v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [[Int]]
-> Tensor n8 k4 v -> Tensor n8 k4 (TProd (SField Rational) v)
forall k v (n :: Nat).
(TIndex k, TAdd v, Prod (SField Rational) v) =>
[[Int]] -> Tensor n k v -> Tensor n k (TProd (SField Rational) v)
cyclicBlockSymTensFac
tensorContr :: (TIndex k, TAdd v) => (Int,Int) -> Tensor2 n1 n2 k v -> Tensor2 (n1-1) (n2-1) k v
tensorContr :: (Int, Int) -> Tensor2 n1 n2 k v -> Tensor2 (n1 - 1) (n2 - 1) k v
tensorContr (Int
0,Int
j) Tensor2 n1 n2 k v
t = [(IndList (n1 - 1) k, Tensor (n2 - 1) k v)]
-> Tensor2 (n1 - 1) (n2 - 1) k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[(IndList n k, v)] -> Tensor n k v
fromListT [(IndList (n1 - 1) k, Tensor (n2 - 1) k v)]
tensList
where
l :: [(IndList n1 k, [(IndList n2 k, v)])]
l = ((IndList n1 k, Tensor n2 k v)
-> (IndList n1 k, [(IndList n2 k, v)]))
-> [(IndList n1 k, Tensor n2 k v)]
-> [(IndList n1 k, [(IndList n2 k, v)])]
forall a b. (a -> b) -> [a] -> [b]
map (\(IndList n1 k
x,Tensor n2 k v
y) -> (IndList n1 k
x, Tensor n2 k v -> [(IndList n2 k, v)]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor n2 k v
y)) ([(IndList n1 k, Tensor n2 k v)]
-> [(IndList n1 k, [(IndList n2 k, v)])])
-> [(IndList n1 k, Tensor n2 k v)]
-> [(IndList n1 k, [(IndList n2 k, v)])]
forall a b. (a -> b) -> a -> b
$ Tensor2 n1 n2 k v -> [(IndList n1 k, Tensor n2 k v)]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor2 n1 n2 k v
t
l2 :: [(IndList (n1 - 1) k, [(IndList (n2 - 1) k, v)])]
l2 = ((IndList n1 k, [(IndList n2 k, v)])
-> (IndList (n1 - 1) k, [(IndList (n2 - 1) k, v)]))
-> [(IndList n1 k, [(IndList n2 k, v)])]
-> [(IndList (n1 - 1) k, [(IndList (n2 - 1) k, v)])]
forall a b. (a -> b) -> [a] -> [b]
map (\(IndList n1 k
x,[(IndList n2 k, v)]
y) -> (IndList n1 k -> IndList (n1 - 1) k
forall (n :: Nat) a. IndList n a -> IndList (n - 1) a
tailInd IndList n1 k
x,((IndList n2 k, v) -> Maybe (IndList (n2 - 1) k, v))
-> [(IndList n2 k, v)] -> [(IndList (n2 - 1) k, v)]
forall a b. (a -> Maybe b) -> [a] -> [b]
mapMaybe (Int -> k -> (IndList n2 k, v) -> Maybe (IndList (n2 - 1) k, v)
forall a (n :: Nat) c.
Eq a =>
Int -> a -> (IndList n a, c) -> Maybe (IndList (n - 1) a, c)
removeContractionInd Int
j (IndList n1 k -> k
forall (n :: Nat) a. IndList n a -> a
headInd IndList n1 k
x)) [(IndList n2 k, v)]
y)) [(IndList n1 k, [(IndList n2 k, v)])]
l
l3 :: [(IndList (n1 - 1) k, [(IndList (n2 - 1) k, v)])]
l3 = ((IndList (n1 - 1) k, [(IndList (n2 - 1) k, v)]) -> Bool)
-> [(IndList (n1 - 1) k, [(IndList (n2 - 1) k, v)])]
-> [(IndList (n1 - 1) k, [(IndList (n2 - 1) k, v)])]
forall a. (a -> Bool) -> [a] -> [a]
filter (\(IndList (n1 - 1) k
_,[(IndList (n2 - 1) k, v)]
y) -> Bool -> Bool
not ([(IndList (n2 - 1) k, v)] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null [(IndList (n2 - 1) k, v)]
y)) [(IndList (n1 - 1) k, [(IndList (n2 - 1) k, v)])]
l2
tensList :: [(IndList (n1 - 1) k, Tensor (n2 - 1) k v)]
tensList = ((IndList (n1 - 1) k, [(IndList (n2 - 1) k, v)])
-> (IndList (n1 - 1) k, Tensor (n2 - 1) k v))
-> [(IndList (n1 - 1) k, [(IndList (n2 - 1) k, v)])]
-> [(IndList (n1 - 1) k, Tensor (n2 - 1) k v)]
forall a b. (a -> b) -> [a] -> [b]
map (\(IndList (n1 - 1) k
x,[(IndList (n2 - 1) k, v)]
y) -> (IndList (n1 - 1) k
x, [(IndList (n2 - 1) k, v)] -> Tensor (n2 - 1) k v
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
[(IndList n k, v)] -> Tensor n k v
fromListT [(IndList (n2 - 1) k, v)]
y)) [(IndList (n1 - 1) k, [(IndList (n2 - 1) k, v)])]
l3
tensorContr (Int
i,Int
j) (Tensor TMap k (Tensor n k (Tensor n2 k v))
m) = TMap k (Tensor (n - 1) k (Tensor (n2 - 1) k v))
-> Tensor ((n - 1) + 1) k (Tensor (n2 - 1) k v)
forall k (n :: Nat) v. TMap k (Tensor n k v) -> Tensor (n + 1) k v
Tensor (TMap k (Tensor (n - 1) k (Tensor (n2 - 1) k v))
-> Tensor ((n - 1) + 1) k (Tensor (n2 - 1) k v))
-> TMap k (Tensor (n - 1) k (Tensor (n2 - 1) k v))
-> Tensor ((n - 1) + 1) k (Tensor (n2 - 1) k v)
forall a b. (a -> b) -> a -> b
$ (Tensor n k (Tensor n2 k v)
-> Tensor (n - 1) k (Tensor (n2 - 1) k v))
-> TMap k (Tensor n k (Tensor n2 k v))
-> TMap k (Tensor (n - 1) k (Tensor (n2 - 1) k v))
forall v v' k. (v -> v') -> TMap k v -> TMap k v'
mapTMap ((Int, Int)
-> Tensor n k (Tensor n2 k v)
-> Tensor (n - 1) k (Tensor (n2 - 1) k v)
forall k v (n1 :: Nat) (n2 :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor2 n1 n2 k v -> Tensor2 (n1 - 1) (n2 - 1) k v
tensorContr (Int
iInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1,Int
j)) TMap k (Tensor n k (Tensor n2 k v))
m
tensorContr (Int, Int)
_ Tensor2 n1 n2 k v
ZeroTensor = Tensor2 (n1 - 1) (n2 - 1) k v
forall (n :: Nat) k v. Tensor n k v
ZeroTensor
tensorContr (Int, Int)
_ (Scalar Tensor n2 k v
_) = String -> Tensor (0 - 1) k (Tensor (n2 - 1) k v)
forall a. HasCallStack => String -> a
error String
"cannot contract scalar!"
contrATens1 :: (TIndex k1, TAdd v) => (Int,Int) -> AbsTensor2 (n1+1) (n2+1) k1 v -> AbsTensor2 n1 n2 k1 v
contrATens1 :: (Int, Int)
-> AbsTensor2 (n1 + 1) (n2 + 1) k1 v -> AbsTensor2 n1 n2 k1 v
contrATens1 = (Int, Int)
-> AbsTensor2 (n1 + 1) (n2 + 1) k1 v -> AbsTensor2 n1 n2 k1 v
forall k v (n1 :: Nat) (n2 :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor2 n1 n2 k v -> Tensor2 (n1 - 1) (n2 - 1) k v
tensorContr
contrATens2 :: (TIndex k1, TIndex k2, TAdd v) => (Int,Int) -> AbsTensor4 n1 n2 (n3+1) (n4+1) k1 k2 v -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
contrATens2 :: (Int, Int)
-> AbsTensor4 n1 n2 (n3 + 1) (n4 + 1) k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
contrATens2 = (Tensor2 (n3 + 1) (n4 + 1) k2 v -> Tensor2 n3 n4 k2 v)
-> AbsTensor4 n1 n2 (n3 + 1) (n4 + 1) k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) k.
(v1 -> v2) -> Tensor2 n1 n2 k v1 -> Tensor2 n1 n2 k v2
mapTo2 ((Tensor2 (n3 + 1) (n4 + 1) k2 v -> Tensor2 n3 n4 k2 v)
-> AbsTensor4 n1 n2 (n3 + 1) (n4 + 1) k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v)
-> ((Int, Int)
-> Tensor2 (n3 + 1) (n4 + 1) k2 v -> Tensor2 n3 n4 k2 v)
-> (Int, Int)
-> AbsTensor4 n1 n2 (n3 + 1) (n4 + 1) k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int) -> Tensor2 (n3 + 1) (n4 + 1) k2 v -> Tensor2 n3 n4 k2 v
forall k v (n1 :: Nat) (n2 :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor2 n1 n2 k v -> Tensor2 (n1 - 1) (n2 - 1) k v
tensorContr
contrATens3 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v) => (Int,Int) -> AbsTensor6 n1 n2 n3 n4 (n5+1) (n6+1) k1 k2 k3 v -> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
contrATens3 :: (Int, Int)
-> AbsTensor6 n1 n2 n3 n4 (n5 + 1) (n6 + 1) k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
contrATens3 = (Tensor2 (n5 + 1) (n6 + 1) k3 v -> Tensor2 n5 n6 k3 v)
-> AbsTensor6 n1 n2 n3 n4 (n5 + 1) (n6 + 1) k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2.
(v1 -> v2)
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v1
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v2
mapTo4 ((Tensor2 (n5 + 1) (n6 + 1) k3 v -> Tensor2 n5 n6 k3 v)
-> AbsTensor6 n1 n2 n3 n4 (n5 + 1) (n6 + 1) k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v)
-> ((Int, Int)
-> Tensor2 (n5 + 1) (n6 + 1) k3 v -> Tensor2 n5 n6 k3 v)
-> (Int, Int)
-> AbsTensor6 n1 n2 n3 n4 (n5 + 1) (n6 + 1) k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int) -> Tensor2 (n5 + 1) (n6 + 1) k3 v -> Tensor2 n5 n6 k3 v
forall k v (n1 :: Nat) (n2 :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor2 n1 n2 k v -> Tensor2 (n1 - 1) (n2 - 1) k v
tensorContr
contrATens4 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) => (Int,Int) -> AbsTensor8 n1 n2 n3 n4 n5 n6 (n7+1) (n8+1) k1 k2 k3 k4 v -> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
contrATens4 :: (Int, Int)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 (n7 + 1) (n8 + 1) k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
contrATens4 = (Tensor2 (n7 + 1) (n8 + 1) k4 v -> Tensor2 n7 n8 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 (n7 + 1) (n8 + 1) k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall v1 v2 (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat) k1 k2 k3.
(v1 -> v2)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v1
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v2
mapTo6 ((Tensor2 (n7 + 1) (n8 + 1) k4 v -> Tensor2 n7 n8 k4 v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 (n7 + 1) (n8 + 1) k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v)
-> ((Int, Int)
-> Tensor2 (n7 + 1) (n8 + 1) k4 v -> Tensor2 n7 n8 k4 v)
-> (Int, Int)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 (n7 + 1) (n8 + 1) k1 k2 k3 k4 v
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, Int) -> Tensor2 (n7 + 1) (n8 + 1) k4 v -> Tensor2 n7 n8 k4 v
forall k v (n1 :: Nat) (n2 :: Nat).
(TIndex k, TAdd v) =>
(Int, Int) -> Tensor2 n1 n2 k v -> Tensor2 (n1 - 1) (n2 - 1) k v
tensorContr
type IndTuple1 n1 k1 = IndList n1 k1
type IndTuple2 n1 n2 k1 = (IndList n1 k1, IndList n2 k1)
type IndTuple3 n1 n2 n3 k1 k2 = (IndList n1 k1, IndList n2 k1, IndList n3 k2)
type IndTuple4 n1 n2 n3 n4 k1 k2 = (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2)
type IndTuple5 n1 n2 n3 n4 n5 k1 k2 k3 = (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2, IndList n5 k3)
type IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3 = (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2, IndList n5 k3, IndList n6 k3)
type IndTuple7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 = (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2, IndList n5 k3, IndList n6 k3, IndList n7 k4)
type IndTuple8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 = (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2, IndList n5 k3, IndList n6 k3, IndList n7 k4, IndList n8 k4)
_mkTens1 :: (IndTuple1 n1 k1, v) -> AbsTensor1 n1 k1 v
_mkTens1 :: (IndTuple1 n1 k1, v) -> AbsTensor1 n1 k1 v
_mkTens1 = (IndTuple1 n1 k1, v) -> AbsTensor1 n1 k1 v
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens
mkTens2 :: (IndTuple2 n1 n2 k1, v) -> AbsTensor2 n1 n2 k1 v
mkTens2 :: (IndTuple2 n1 n2 k1, v) -> AbsTensor2 n1 n2 k1 v
mkTens2 ((IndList n1 k1
i1,IndList n2 k1
i2),v
s) = (IndList n1 k1, Tensor n2 k1 v) -> AbsTensor2 n1 n2 k1 v
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n1 k1
i1,(IndList n2 k1, v) -> Tensor n2 k1 v
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n2 k1
i2,v
s))
mkTens3 :: (IndTuple3 n1 n2 n3 k1 k2, v) -> AbsTensor3 n1 n2 n3 k1 k2 v
mkTens3 :: (IndTuple3 n1 n2 n3 k1 k2, v) -> AbsTensor3 n1 n2 n3 k1 k2 v
mkTens3 ((IndList n1 k1
i1,IndList n2 k1
i2,IndList n3 k2
i3),v
s) = (IndList n1 k1, Tensor n2 k1 (Tensor n3 k2 v))
-> AbsTensor3 n1 n2 n3 k1 k2 v
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n1 k1
i1,(IndList n2 k1, Tensor n3 k2 v) -> Tensor n2 k1 (Tensor n3 k2 v)
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n2 k1
i2,(IndList n3 k2, v) -> Tensor n3 k2 v
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n3 k2
i3,v
s)))
mkTens4 :: (IndTuple4 n1 n2 n3 n4 k1 k2, v) -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
mkTens4 :: (IndTuple4 n1 n2 n3 n4 k1 k2, v) -> AbsTensor4 n1 n2 n3 n4 k1 k2 v
mkTens4 ((IndList n1 k1
i1,IndList n2 k1
i2,IndList n3 k2
i3,IndList n4 k2
i4),v
s) = (IndList n1 k1, Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 v)))
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n1 k1
i1,(IndList n2 k1, Tensor n3 k2 (Tensor n4 k2 v))
-> Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 v))
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n2 k1
i2,(IndList n3 k2, Tensor n4 k2 v) -> Tensor n3 k2 (Tensor n4 k2 v)
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n3 k2
i3,(IndList n4 k2, v) -> Tensor n4 k2 v
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n4 k2
i4,v
s))))
mkTens5 :: (IndTuple5 n1 n2 n3 n4 n5 k1 k2 k3, v) -> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
mkTens5 :: (IndTuple5 n1 n2 n3 n4 n5 k1 k2 k3, v)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
mkTens5 ((IndList n1 k1
i1,IndList n2 k1
i2,IndList n3 k2
i3,IndList n4 k2
i4,IndList n5 k3
i5),v
s) = (IndList n1 k1,
Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v))))
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n1 k1
i1,(IndList n2 k1, Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v)))
-> Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v)))
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n2 k1
i2,(IndList n3 k2, Tensor n4 k2 (Tensor n5 k3 v))
-> Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v))
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n3 k2
i3,(IndList n4 k2, Tensor n5 k3 v) -> Tensor n4 k2 (Tensor n5 k3 v)
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n4 k2
i4,(IndList n5 k3, v) -> Tensor n5 k3 v
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n5 k3
i5,v
s)))))
mkTens6 :: (IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v) -> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
mkTens6 :: (IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
mkTens6 ((IndList n1 k1
i1,IndList n2 k1
i2,IndList n3 k2
i3,IndList n4 k2
i4,IndList n5 k3
i5,IndList n6 k3
i6),v
s) = (IndList n1 k1,
Tensor
n2
k1
(Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v)))))
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n1 k1
i1,(IndList n2 k1,
Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v))))
-> Tensor
n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v))))
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n2 k1
i2,(IndList n3 k2, Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v)))
-> Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v)))
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n3 k2
i3,(IndList n4 k2, Tensor n5 k3 (Tensor n6 k3 v))
-> Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v))
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n4 k2
i4,(IndList n5 k3, Tensor n6 k3 v) -> Tensor n5 k3 (Tensor n6 k3 v)
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n5 k3
i5,(IndList n6 k3, v) -> Tensor n6 k3 v
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n6 k3
i6,v
s))))))
mkTens7 :: (IndTuple7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4, v) -> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
mkTens7 :: (IndTuple7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4, v)
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
mkTens7 ((IndList n1 k1
i1,IndList n2 k1
i2,IndList n3 k2
i3,IndList n4 k2
i4,IndList n5 k3
i5,IndList n6 k3
i6,IndList n7 k4
i7),v
s) = (IndList n1 k1,
Tensor
n2
k1
(Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))))))
-> AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n1 k1
i1,(IndList n2 k1,
Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))))
-> Tensor
n2
k1
(Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))))
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n2 k1
i2,(IndList n3 k2,
Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))))
-> Tensor
n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))))
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n3 k2
i3,(IndList n4 k2, Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))
-> Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n4 k2
i4,(IndList n5 k3, Tensor n6 k3 (Tensor n7 k4 v))
-> Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n5 k3
i5,(IndList n6 k3, Tensor n7 k4 v) -> Tensor n6 k3 (Tensor n7 k4 v)
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n6 k3
i6,(IndList n7 k4, v) -> Tensor n7 k4 v
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n7 k4
i7,v
s)))))))
mkTens8 :: (IndTuple8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4, v) -> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
mkTens8 :: (IndTuple8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4, v)
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
mkTens8 ((IndList n1 k1
i1,IndList n2 k1
i2,IndList n3 k2
i3,IndList n4 k2
i4,IndList n5 k3
i5,IndList n6 k3
i6,IndList n7 k4
i7,IndList n8 k4
i8),v
s) = (IndList n1 k1,
Tensor
n2
k1
(Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))))))
-> AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n1 k1
i1,(IndList n2 k1,
Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))))
-> Tensor
n2
k1
(Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))))
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n2 k1
i2,(IndList n3 k2,
Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))))
-> Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))))
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n3 k2
i3,(IndList n4 k2,
Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))
-> Tensor
n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n4 k2
i4,(IndList n5 k3, Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))
-> Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n5 k3
i5,(IndList n6 k3, Tensor n7 k4 (Tensor n8 k4 v))
-> Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n6 k3
i6,(IndList n7 k4, Tensor n8 k4 v) -> Tensor n7 k4 (Tensor n8 k4 v)
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n7 k4
i7,(IndList n8 k4, v) -> Tensor n8 k4 v
forall (n :: Nat) k v. (IndList n k, v) -> Tensor n k v
mkTens (IndList n8 k4
i8,v
s))))))))
toListT :: Tensor n k v -> [(IndList n k, v)]
toListT :: Tensor n k v -> [(IndList n k, v)]
toListT (Scalar v
x) = [(IndList n k
forall a. IndList 0 a
Empty, v
x)]
toListT (Tensor TMap k (Tensor n k v)
m) = ((k, Tensor n k v) -> [(IndList n k, v)])
-> TMap k (Tensor n k v) -> [(IndList n k, v)]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\(k
i,Tensor n k v
t) -> k -> [(IndList (n - 1) k, v)] -> [(IndList n k, v)]
forall a (n :: Nat) b.
a -> [(IndList (n - 1) a, b)] -> [(IndList n a, b)]
appendF k
i ([(IndList (n - 1) k, v)] -> [(IndList n k, v)])
-> [(IndList (n - 1) k, v)] -> [(IndList n k, v)]
forall a b. (a -> b) -> a -> b
$ Tensor n k v -> [(IndList n k, v)]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor n k v
t) TMap k (Tensor n k v)
m
where
appendF :: a -> [(IndList (n - 1) a, b)] -> [(IndList n a, b)]
appendF a
i = ((IndList (n - 1) a, b) -> (IndList n a, b))
-> [(IndList (n - 1) a, b)] -> [(IndList n a, b)]
forall a b. (a -> b) -> [a] -> [b]
map (\(IndList (n - 1) a
l,b
val) -> (a -> IndList (n - 1) a -> IndList n a
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append a
i IndList (n - 1) a
l ,b
val))
toListT Tensor n k v
ZeroTensor = []
toListT1 :: AbsTensor1 n1 k1 v -> [(IndTuple1 n1 k1, v)]
toListT1 :: AbsTensor1 n1 k1 v -> [(IndTuple1 n1 k1, v)]
toListT1 = AbsTensor1 n1 k1 v -> [(IndTuple1 n1 k1, v)]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT
toListT2 :: AbsTensor2 n1 n2 k1 v -> [(IndTuple2 n1 n2 k1, v)]
toListT2 :: AbsTensor2 n1 n2 k1 v -> [(IndTuple2 n1 n2 k1, v)]
toListT2 AbsTensor2 n1 n2 k1 v
t = ((IndList n1 k1, Tensor n2 k1 v) -> [(IndTuple2 n1 n2 k1, v)])
-> [(IndList n1 k1, Tensor n2 k1 v)] -> [(IndTuple2 n1 n2 k1, v)]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\(IndList n1 k1
x,Tensor n2 k1 v
y) -> IndList n1 k1 -> [(IndList n2 k1, v)] -> [(IndTuple2 n1 n2 k1, v)]
forall a1 b1 b2. a1 -> [(b1, b2)] -> [((a1, b1), b2)]
appendT1 IndList n1 k1
x ([(IndList n2 k1, v)] -> [(IndTuple2 n1 n2 k1, v)])
-> [(IndList n2 k1, v)] -> [(IndTuple2 n1 n2 k1, v)]
forall a b. (a -> b) -> a -> b
$ Tensor n2 k1 v -> [(IndList n2 k1, v)]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor n2 k1 v
y ) ([(IndList n1 k1, Tensor n2 k1 v)] -> [(IndTuple2 n1 n2 k1, v)])
-> [(IndList n1 k1, Tensor n2 k1 v)] -> [(IndTuple2 n1 n2 k1, v)]
forall a b. (a -> b) -> a -> b
$ AbsTensor2 n1 n2 k1 v -> [(IndList n1 k1, Tensor n2 k1 v)]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT AbsTensor2 n1 n2 k1 v
t
toListT3 :: AbsTensor3 n1 n2 n3 k1 k2 v -> [(IndTuple3 n1 n2 n3 k1 k2, v)]
toListT3 :: AbsTensor3 n1 n2 n3 k1 k2 v -> [(IndTuple3 n1 n2 n3 k1 k2, v)]
toListT3 AbsTensor3 n1 n2 n3 k1 k2 v
t = (((IndList n1 k1, IndList n2 k1), Tensor n3 k2 v)
-> [(IndTuple3 n1 n2 n3 k1 k2, v)])
-> [((IndList n1 k1, IndList n2 k1), Tensor n3 k2 v)]
-> [(IndTuple3 n1 n2 n3 k1 k2, v)]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\((IndList n1 k1, IndList n2 k1)
x,Tensor n3 k2 v
y) -> (IndList n1 k1, IndList n2 k1)
-> [(IndList n3 k2, v)] -> [(IndTuple3 n1 n2 n3 k1 k2, v)]
forall a1 a2 b1 b2. (a1, a2) -> [(b1, b2)] -> [((a1, a2, b1), b2)]
appendT2 (IndList n1 k1, IndList n2 k1)
x ([(IndList n3 k2, v)] -> [(IndTuple3 n1 n2 n3 k1 k2, v)])
-> [(IndList n3 k2, v)] -> [(IndTuple3 n1 n2 n3 k1 k2, v)]
forall a b. (a -> b) -> a -> b
$ Tensor n3 k2 v -> [(IndList n3 k2, v)]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor n3 k2 v
y ) ([((IndList n1 k1, IndList n2 k1), Tensor n3 k2 v)]
-> [(IndTuple3 n1 n2 n3 k1 k2, v)])
-> [((IndList n1 k1, IndList n2 k1), Tensor n3 k2 v)]
-> [(IndTuple3 n1 n2 n3 k1 k2, v)]
forall a b. (a -> b) -> a -> b
$
((IndList n1 k1, Tensor n2 k1 (Tensor n3 k2 v))
-> [((IndList n1 k1, IndList n2 k1), Tensor n3 k2 v)])
-> [(IndList n1 k1, Tensor n2 k1 (Tensor n3 k2 v))]
-> [((IndList n1 k1, IndList n2 k1), Tensor n3 k2 v)]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\(IndList n1 k1
x,Tensor n2 k1 (Tensor n3 k2 v)
y) -> IndList n1 k1
-> [(IndList n2 k1, Tensor n3 k2 v)]
-> [((IndList n1 k1, IndList n2 k1), Tensor n3 k2 v)]
forall a1 b1 b2. a1 -> [(b1, b2)] -> [((a1, b1), b2)]
appendT1 IndList n1 k1
x ([(IndList n2 k1, Tensor n3 k2 v)]
-> [((IndList n1 k1, IndList n2 k1), Tensor n3 k2 v)])
-> [(IndList n2 k1, Tensor n3 k2 v)]
-> [((IndList n1 k1, IndList n2 k1), Tensor n3 k2 v)]
forall a b. (a -> b) -> a -> b
$ Tensor n2 k1 (Tensor n3 k2 v) -> [(IndList n2 k1, Tensor n3 k2 v)]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor n2 k1 (Tensor n3 k2 v)
y ) ([(IndList n1 k1, Tensor n2 k1 (Tensor n3 k2 v))]
-> [((IndList n1 k1, IndList n2 k1), Tensor n3 k2 v)])
-> [(IndList n1 k1, Tensor n2 k1 (Tensor n3 k2 v))]
-> [((IndList n1 k1, IndList n2 k1), Tensor n3 k2 v)]
forall a b. (a -> b) -> a -> b
$ AbsTensor3 n1 n2 n3 k1 k2 v
-> [(IndList n1 k1, Tensor n2 k1 (Tensor n3 k2 v))]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT AbsTensor3 n1 n2 n3 k1 k2 v
t
toListT4 :: AbsTensor4 n1 n2 n3 n4 k1 k2 v -> [(IndTuple4 n1 n2 n3 n4 k1 k2, v)]
toListT4 :: AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> [(IndTuple4 n1 n2 n3 n4 k1 k2, v)]
toListT4 AbsTensor4 n1 n2 n3 n4 k1 k2 v
t = (((IndList n1 k1, IndList n2 k1, IndList n3 k2), Tensor n4 k2 v)
-> [(IndTuple4 n1 n2 n3 n4 k1 k2, v)])
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 v)]
-> [(IndTuple4 n1 n2 n3 n4 k1 k2, v)]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\((IndList n1 k1, IndList n2 k1, IndList n3 k2)
x,Tensor n4 k2 v
y) -> (IndList n1 k1, IndList n2 k1, IndList n3 k2)
-> [(IndList n4 k2, v)] -> [(IndTuple4 n1 n2 n3 n4 k1 k2, v)]
forall a1 a2 a3 b1 b2.
(a1, a2, a3) -> [(b1, b2)] -> [((a1, a2, a3, b1), b2)]
appendT3 (IndList n1 k1, IndList n2 k1, IndList n3 k2)
x ([(IndList n4 k2, v)] -> [(IndTuple4 n1 n2 n3 n4 k1 k2, v)])
-> [(IndList n4 k2, v)] -> [(IndTuple4 n1 n2 n3 n4 k1 k2, v)]
forall a b. (a -> b) -> a -> b
$ Tensor n4 k2 v -> [(IndList n4 k2, v)]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor n4 k2 v
y ) ([((IndList n1 k1, IndList n2 k1, IndList n3 k2), Tensor n4 k2 v)]
-> [(IndTuple4 n1 n2 n3 n4 k1 k2, v)])
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 v)]
-> [(IndTuple4 n1 n2 n3 n4 k1 k2, v)]
forall a b. (a -> b) -> a -> b
$
(((IndList n1 k1, IndList n2 k1), Tensor n3 k2 (Tensor n4 k2 v))
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 v)])
-> [((IndList n1 k1, IndList n2 k1),
Tensor n3 k2 (Tensor n4 k2 v))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 v)]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\((IndList n1 k1, IndList n2 k1)
x,Tensor n3 k2 (Tensor n4 k2 v)
y) -> (IndList n1 k1, IndList n2 k1)
-> [(IndList n3 k2, Tensor n4 k2 v)]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 v)]
forall a1 a2 b1 b2. (a1, a2) -> [(b1, b2)] -> [((a1, a2, b1), b2)]
appendT2 (IndList n1 k1, IndList n2 k1)
x ([(IndList n3 k2, Tensor n4 k2 v)]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 v)])
-> [(IndList n3 k2, Tensor n4 k2 v)]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 v)]
forall a b. (a -> b) -> a -> b
$ Tensor n3 k2 (Tensor n4 k2 v) -> [(IndList n3 k2, Tensor n4 k2 v)]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor n3 k2 (Tensor n4 k2 v)
y ) ([((IndList n1 k1, IndList n2 k1), Tensor n3 k2 (Tensor n4 k2 v))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 v)])
-> [((IndList n1 k1, IndList n2 k1),
Tensor n3 k2 (Tensor n4 k2 v))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 v)]
forall a b. (a -> b) -> a -> b
$
((IndList n1 k1, Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 v)))
-> [((IndList n1 k1, IndList n2 k1),
Tensor n3 k2 (Tensor n4 k2 v))])
-> [(IndList n1 k1, Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 v)))]
-> [((IndList n1 k1, IndList n2 k1),
Tensor n3 k2 (Tensor n4 k2 v))]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\(IndList n1 k1
x,Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 v))
y) -> IndList n1 k1
-> [(IndList n2 k1, Tensor n3 k2 (Tensor n4 k2 v))]
-> [((IndList n1 k1, IndList n2 k1),
Tensor n3 k2 (Tensor n4 k2 v))]
forall a1 b1 b2. a1 -> [(b1, b2)] -> [((a1, b1), b2)]
appendT1 IndList n1 k1
x ([(IndList n2 k1, Tensor n3 k2 (Tensor n4 k2 v))]
-> [((IndList n1 k1, IndList n2 k1),
Tensor n3 k2 (Tensor n4 k2 v))])
-> [(IndList n2 k1, Tensor n3 k2 (Tensor n4 k2 v))]
-> [((IndList n1 k1, IndList n2 k1),
Tensor n3 k2 (Tensor n4 k2 v))]
forall a b. (a -> b) -> a -> b
$ Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 v))
-> [(IndList n2 k1, Tensor n3 k2 (Tensor n4 k2 v))]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 v))
y ) ([(IndList n1 k1, Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 v)))]
-> [((IndList n1 k1, IndList n2 k1),
Tensor n3 k2 (Tensor n4 k2 v))])
-> [(IndList n1 k1, Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 v)))]
-> [((IndList n1 k1, IndList n2 k1),
Tensor n3 k2 (Tensor n4 k2 v))]
forall a b. (a -> b) -> a -> b
$ AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> [(IndList n1 k1, Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 v)))]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT AbsTensor4 n1 n2 n3 n4 k1 k2 v
t
toListT5 :: AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v -> [(IndTuple5 n1 n2 n3 n4 n5 k1 k2 k3, v)]
toListT5 :: AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> [(IndTuple5 n1 n2 n3 n4 n5 k1 k2 k3, v)]
toListT5 AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
t = (((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 v)
-> [(IndTuple5 n1 n2 n3 n4 n5 k1 k2 k3, v)])
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 v)]
-> [(IndTuple5 n1 n2 n3 n4 n5 k1 k2 k3, v)]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2)
x,Tensor n5 k3 v
y) -> (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2)
-> [(IndList n5 k3, v)] -> [(IndTuple5 n1 n2 n3 n4 n5 k1 k2 k3, v)]
forall a1 a2 a3 a4 b1 b2.
(a1, a2, a3, a4) -> [(b1, b2)] -> [((a1, a2, a3, a4, b1), b2)]
appendT4 (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2)
x ([(IndList n5 k3, v)] -> [(IndTuple5 n1 n2 n3 n4 n5 k1 k2 k3, v)])
-> [(IndList n5 k3, v)] -> [(IndTuple5 n1 n2 n3 n4 n5 k1 k2 k3, v)]
forall a b. (a -> b) -> a -> b
$ Tensor n5 k3 v -> [(IndList n5 k3, v)]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor n5 k3 v
y ) ([((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 v)]
-> [(IndTuple5 n1 n2 n3 n4 n5 k1 k2 k3, v)])
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 v)]
-> [(IndTuple5 n1 n2 n3 n4 n5 k1 k2 k3, v)]
forall a b. (a -> b) -> a -> b
$
(((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 v))
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 v)])
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 v))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 v)]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\((IndList n1 k1, IndList n2 k1, IndList n3 k2)
x,Tensor n4 k2 (Tensor n5 k3 v)
y) -> (IndList n1 k1, IndList n2 k1, IndList n3 k2)
-> [(IndList n4 k2, Tensor n5 k3 v)]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 v)]
forall a1 a2 a3 b1 b2.
(a1, a2, a3) -> [(b1, b2)] -> [((a1, a2, a3, b1), b2)]
appendT3 (IndList n1 k1, IndList n2 k1, IndList n3 k2)
x ([(IndList n4 k2, Tensor n5 k3 v)]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 v)])
-> [(IndList n4 k2, Tensor n5 k3 v)]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 v)]
forall a b. (a -> b) -> a -> b
$ Tensor n4 k2 (Tensor n5 k3 v) -> [(IndList n4 k2, Tensor n5 k3 v)]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor n4 k2 (Tensor n5 k3 v)
y ) ([((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 v))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 v)])
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 v))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 v)]
forall a b. (a -> b) -> a -> b
$
(((IndList n1 k1, IndList n2 k1),
Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v)))
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 v))])
-> [((IndList n1 k1, IndList n2 k1),
Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v)))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 v))]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\((IndList n1 k1, IndList n2 k1)
x,Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v))
y) -> (IndList n1 k1, IndList n2 k1)
-> [(IndList n3 k2, Tensor n4 k2 (Tensor n5 k3 v))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 v))]
forall a1 a2 b1 b2. (a1, a2) -> [(b1, b2)] -> [((a1, a2, b1), b2)]
appendT2 (IndList n1 k1, IndList n2 k1)
x ([(IndList n3 k2, Tensor n4 k2 (Tensor n5 k3 v))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 v))])
-> [(IndList n3 k2, Tensor n4 k2 (Tensor n5 k3 v))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 v))]
forall a b. (a -> b) -> a -> b
$ Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v))
-> [(IndList n3 k2, Tensor n4 k2 (Tensor n5 k3 v))]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v))
y ) ([((IndList n1 k1, IndList n2 k1),
Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v)))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 v))])
-> [((IndList n1 k1, IndList n2 k1),
Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v)))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 v))]
forall a b. (a -> b) -> a -> b
$
((IndList n1 k1,
Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v))))
-> [((IndList n1 k1, IndList n2 k1),
Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v)))])
-> [(IndList n1 k1,
Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v))))]
-> [((IndList n1 k1, IndList n2 k1),
Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v)))]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\(IndList n1 k1
x,Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v)))
y) -> IndList n1 k1
-> [(IndList n2 k1, Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v)))]
-> [((IndList n1 k1, IndList n2 k1),
Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v)))]
forall a1 b1 b2. a1 -> [(b1, b2)] -> [((a1, b1), b2)]
appendT1 IndList n1 k1
x ([(IndList n2 k1, Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v)))]
-> [((IndList n1 k1, IndList n2 k1),
Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v)))])
-> [(IndList n2 k1, Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v)))]
-> [((IndList n1 k1, IndList n2 k1),
Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v)))]
forall a b. (a -> b) -> a -> b
$ Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v)))
-> [(IndList n2 k1, Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v)))]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v)))
y ) ([(IndList n1 k1,
Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v))))]
-> [((IndList n1 k1, IndList n2 k1),
Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v)))])
-> [(IndList n1 k1,
Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v))))]
-> [((IndList n1 k1, IndList n2 k1),
Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v)))]
forall a b. (a -> b) -> a -> b
$ AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> [(IndList n1 k1,
Tensor n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 v))))]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
t
toListT6 :: AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v -> [(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
toListT6 :: AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> [(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
toListT6 AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
t = (((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 v)
-> [(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)])
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 v)]
-> [(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3)
x,Tensor n6 k3 v
y) -> (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3)
-> [(IndList n6 k3, v)]
-> [(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
forall a1 a2 a3 a4 a5 b1 b2.
(a1, a2, a3, a4, a5)
-> [(b1, b2)] -> [((a1, a2, a3, a4, a5, b1), b2)]
appendT5 (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3)
x ([(IndList n6 k3, v)]
-> [(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)])
-> [(IndList n6 k3, v)]
-> [(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
forall a b. (a -> b) -> a -> b
$ Tensor n6 k3 v -> [(IndList n6 k3, v)]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor n6 k3 v
y ) ([((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 v)]
-> [(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)])
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 v)]
-> [(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
forall a b. (a -> b) -> a -> b
$
(((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 v))
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 v)])
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 v))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 v)]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2)
x,Tensor n5 k3 (Tensor n6 k3 v)
y) -> (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2)
-> [(IndList n5 k3, Tensor n6 k3 v)]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 v)]
forall a1 a2 a3 a4 b1 b2.
(a1, a2, a3, a4) -> [(b1, b2)] -> [((a1, a2, a3, a4, b1), b2)]
appendT4 (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2)
x ([(IndList n5 k3, Tensor n6 k3 v)]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 v)])
-> [(IndList n5 k3, Tensor n6 k3 v)]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 v)]
forall a b. (a -> b) -> a -> b
$ Tensor n5 k3 (Tensor n6 k3 v) -> [(IndList n5 k3, Tensor n6 k3 v)]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor n5 k3 (Tensor n6 k3 v)
y ) ([((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 v))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 v)])
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 v))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 v)]
forall a b. (a -> b) -> a -> b
$
(((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v)))
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 v))])
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v)))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 v))]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\((IndList n1 k1, IndList n2 k1, IndList n3 k2)
x,Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v))
y) -> (IndList n1 k1, IndList n2 k1, IndList n3 k2)
-> [(IndList n4 k2, Tensor n5 k3 (Tensor n6 k3 v))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 v))]
forall a1 a2 a3 b1 b2.
(a1, a2, a3) -> [(b1, b2)] -> [((a1, a2, a3, b1), b2)]
appendT3 (IndList n1 k1, IndList n2 k1, IndList n3 k2)
x ([(IndList n4 k2, Tensor n5 k3 (Tensor n6 k3 v))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 v))])
-> [(IndList n4 k2, Tensor n5 k3 (Tensor n6 k3 v))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 v))]
forall a b. (a -> b) -> a -> b
$ Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v))
-> [(IndList n4 k2, Tensor n5 k3 (Tensor n6 k3 v))]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v))
y ) ([((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v)))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 v))])
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v)))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 v))]
forall a b. (a -> b) -> a -> b
$
(((IndList n1 k1, IndList n2 k1),
Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v))))
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v)))])
-> [((IndList n1 k1, IndList n2 k1),
Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v))))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v)))]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\((IndList n1 k1, IndList n2 k1)
x,Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v)))
y) -> (IndList n1 k1, IndList n2 k1)
-> [(IndList n3 k2, Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v)))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v)))]
forall a1 a2 b1 b2. (a1, a2) -> [(b1, b2)] -> [((a1, a2, b1), b2)]
appendT2 (IndList n1 k1, IndList n2 k1)
x ([(IndList n3 k2, Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v)))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v)))])
-> [(IndList n3 k2, Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v)))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v)))]
forall a b. (a -> b) -> a -> b
$ Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v)))
-> [(IndList n3 k2, Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v)))]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v)))
y ) ([((IndList n1 k1, IndList n2 k1),
Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v))))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v)))])
-> [((IndList n1 k1, IndList n2 k1),
Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v))))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v)))]
forall a b. (a -> b) -> a -> b
$
((IndList n1 k1,
Tensor
n2
k1
(Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v)))))
-> [((IndList n1 k1, IndList n2 k1),
Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v))))])
-> [(IndList n1 k1,
Tensor
n2
k1
(Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v)))))]
-> [((IndList n1 k1, IndList n2 k1),
Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v))))]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\(IndList n1 k1
x,Tensor
n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v))))
y) -> IndList n1 k1
-> [(IndList n2 k1,
Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v))))]
-> [((IndList n1 k1, IndList n2 k1),
Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v))))]
forall a1 b1 b2. a1 -> [(b1, b2)] -> [((a1, b1), b2)]
appendT1 IndList n1 k1
x ([(IndList n2 k1,
Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v))))]
-> [((IndList n1 k1, IndList n2 k1),
Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v))))])
-> [(IndList n2 k1,
Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v))))]
-> [((IndList n1 k1, IndList n2 k1),
Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v))))]
forall a b. (a -> b) -> a -> b
$ Tensor
n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v))))
-> [(IndList n2 k1,
Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v))))]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor
n2 k1 (Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v))))
y ) ([(IndList n1 k1,
Tensor
n2
k1
(Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v)))))]
-> [((IndList n1 k1, IndList n2 k1),
Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v))))])
-> [(IndList n1 k1,
Tensor
n2
k1
(Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v)))))]
-> [((IndList n1 k1, IndList n2 k1),
Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v))))]
forall a b. (a -> b) -> a -> b
$ AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> [(IndList n1 k1,
Tensor
n2
k1
(Tensor n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 v)))))]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
t
toListT7 :: AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v -> [(IndTuple7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4, v)]
toListT7 :: AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> [(IndTuple7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4, v)]
toListT7 AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
t = (((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
Tensor n7 k4 v)
-> [(IndTuple7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4, v)])
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
Tensor n7 k4 v)]
-> [(IndTuple7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4, v)]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3)
x,Tensor n7 k4 v
y) -> (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3)
-> [(IndList n7 k4, v)]
-> [(IndTuple7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4, v)]
forall a1 a2 a3 a4 a5 a6 b1 b2.
(a1, a2, a3, a4, a5, a6)
-> [(b1, b2)] -> [((a1, a2, a3, a4, a5, a6, b1), b2)]
appendT6 (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3)
x ([(IndList n7 k4, v)]
-> [(IndTuple7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4, v)])
-> [(IndList n7 k4, v)]
-> [(IndTuple7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4, v)]
forall a b. (a -> b) -> a -> b
$ Tensor n7 k4 v -> [(IndList n7 k4, v)]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor n7 k4 v
y ) ([((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
Tensor n7 k4 v)]
-> [(IndTuple7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4, v)])
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
Tensor n7 k4 v)]
-> [(IndTuple7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4, v)]
forall a b. (a -> b) -> a -> b
$
(((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 (Tensor n7 k4 v))
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
Tensor n7 k4 v)])
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 (Tensor n7 k4 v))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
Tensor n7 k4 v)]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3)
x,Tensor n6 k3 (Tensor n7 k4 v)
y) -> (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3)
-> [(IndList n6 k3, Tensor n7 k4 v)]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
Tensor n7 k4 v)]
forall a1 a2 a3 a4 a5 b1 b2.
(a1, a2, a3, a4, a5)
-> [(b1, b2)] -> [((a1, a2, a3, a4, a5, b1), b2)]
appendT5 (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3)
x ([(IndList n6 k3, Tensor n7 k4 v)]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
Tensor n7 k4 v)])
-> [(IndList n6 k3, Tensor n7 k4 v)]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
Tensor n7 k4 v)]
forall a b. (a -> b) -> a -> b
$ Tensor n6 k3 (Tensor n7 k4 v) -> [(IndList n6 k3, Tensor n7 k4 v)]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor n6 k3 (Tensor n7 k4 v)
y ) ([((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 (Tensor n7 k4 v))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
Tensor n7 k4 v)])
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 (Tensor n7 k4 v))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
Tensor n7 k4 v)]
forall a b. (a -> b) -> a -> b
$
(((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 (Tensor n7 k4 v))])
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 (Tensor n7 k4 v))]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2)
x,Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))
y) -> (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2)
-> [(IndList n5 k3, Tensor n6 k3 (Tensor n7 k4 v))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 (Tensor n7 k4 v))]
forall a1 a2 a3 a4 b1 b2.
(a1, a2, a3, a4) -> [(b1, b2)] -> [((a1, a2, a3, a4, b1), b2)]
appendT4 (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2)
x ([(IndList n5 k3, Tensor n6 k3 (Tensor n7 k4 v))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 (Tensor n7 k4 v))])
-> [(IndList n5 k3, Tensor n6 k3 (Tensor n7 k4 v))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 (Tensor n7 k4 v))]
forall a b. (a -> b) -> a -> b
$ Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))
-> [(IndList n5 k3, Tensor n6 k3 (Tensor n7 k4 v))]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))
y ) ([((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 (Tensor n7 k4 v))])
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 (Tensor n7 k4 v))]
forall a b. (a -> b) -> a -> b
$
(((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))))
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))])
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\((IndList n1 k1, IndList n2 k1, IndList n3 k2)
x,Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))
y) -> (IndList n1 k1, IndList n2 k1, IndList n3 k2)
-> [(IndList n4 k2, Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))]
forall a1 a2 a3 b1 b2.
(a1, a2, a3) -> [(b1, b2)] -> [((a1, a2, a3, b1), b2)]
appendT3 (IndList n1 k1, IndList n2 k1, IndList n3 k2)
x ([(IndList n4 k2, Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))])
-> [(IndList n4 k2, Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))]
forall a b. (a -> b) -> a -> b
$ Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))
-> [(IndList n4 k2, Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))
y ) ([((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))])
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))]
forall a b. (a -> b) -> a -> b
$
(((IndList n1 k1, IndList n2 k1),
Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))))
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))))])
-> [((IndList n1 k1, IndList n2 k1),
Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))))]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\((IndList n1 k1, IndList n2 k1)
x,Tensor
n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))))
y) -> (IndList n1 k1, IndList n2 k1)
-> [(IndList n3 k2,
Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))))]
forall a1 a2 b1 b2. (a1, a2) -> [(b1, b2)] -> [((a1, a2, b1), b2)]
appendT2 (IndList n1 k1, IndList n2 k1)
x ([(IndList n3 k2,
Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))))])
-> [(IndList n3 k2,
Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))))]
forall a b. (a -> b) -> a -> b
$ Tensor
n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))))
-> [(IndList n3 k2,
Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))))]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor
n3 k2 (Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))))
y ) ([((IndList n1 k1, IndList n2 k1),
Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))))])
-> [((IndList n1 k1, IndList n2 k1),
Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))))]
forall a b. (a -> b) -> a -> b
$
((IndList n1 k1,
Tensor
n2
k1
(Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))))))
-> [((IndList n1 k1, IndList n2 k1),
Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))))])
-> [(IndList n1 k1,
Tensor
n2
k1
(Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))))))]
-> [((IndList n1 k1, IndList n2 k1),
Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))))]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\(IndList n1 k1
x,Tensor
n2
k1
(Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))))
y) -> IndList n1 k1
-> [(IndList n2 k1,
Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))))]
-> [((IndList n1 k1, IndList n2 k1),
Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))))]
forall a1 b1 b2. a1 -> [(b1, b2)] -> [((a1, b1), b2)]
appendT1 IndList n1 k1
x ([(IndList n2 k1,
Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))))]
-> [((IndList n1 k1, IndList n2 k1),
Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))))])
-> [(IndList n2 k1,
Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))))]
-> [((IndList n1 k1, IndList n2 k1),
Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))))]
forall a b. (a -> b) -> a -> b
$ Tensor
n2
k1
(Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))))
-> [(IndList n2 k1,
Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))))]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor
n2
k1
(Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))))
y ) ([(IndList n1 k1,
Tensor
n2
k1
(Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))))))]
-> [((IndList n1 k1, IndList n2 k1),
Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))))])
-> [(IndList n1 k1,
Tensor
n2
k1
(Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))))))]
-> [((IndList n1 k1, IndList n2 k1),
Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v)))))]
forall a b. (a -> b) -> a -> b
$ AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> [(IndList n1 k1,
Tensor
n2
k1
(Tensor
n3
k2
(Tensor n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 v))))))]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
t
toListT8 :: AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v -> [(IndTuple8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4, v)]
toListT8 :: AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> [(IndTuple8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4, v)]
toListT8 AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
t = (((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4),
Tensor n8 k4 v)
-> [(IndTuple8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4, v)])
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4),
Tensor n8 k4 v)]
-> [(IndTuple8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4, v)]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4)
x,Tensor n8 k4 v
y) -> (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4)
-> [(IndList n8 k4, v)]
-> [(IndTuple8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4, v)]
forall a1 a2 a3 a4 a5 a6 a7 b1 b2.
(a1, a2, a3, a4, a5, a6, a7)
-> [(b1, b2)] -> [((a1, a2, a3, a4, a5, a6, a7, b1), b2)]
appendT7 (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4)
x ([(IndList n8 k4, v)]
-> [(IndTuple8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4, v)])
-> [(IndList n8 k4, v)]
-> [(IndTuple8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4, v)]
forall a b. (a -> b) -> a -> b
$ Tensor n8 k4 v -> [(IndList n8 k4, v)]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor n8 k4 v
y ) ([((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4),
Tensor n8 k4 v)]
-> [(IndTuple8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4, v)])
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4),
Tensor n8 k4 v)]
-> [(IndTuple8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4, v)]
forall a b. (a -> b) -> a -> b
$
(((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
Tensor n7 k4 (Tensor n8 k4 v))
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4),
Tensor n8 k4 v)])
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
Tensor n7 k4 (Tensor n8 k4 v))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4),
Tensor n8 k4 v)]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3)
x,Tensor n7 k4 (Tensor n8 k4 v)
y) -> (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3)
-> [(IndList n7 k4, Tensor n8 k4 v)]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4),
Tensor n8 k4 v)]
forall a1 a2 a3 a4 a5 a6 b1 b2.
(a1, a2, a3, a4, a5, a6)
-> [(b1, b2)] -> [((a1, a2, a3, a4, a5, a6, b1), b2)]
appendT6 (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3)
x ([(IndList n7 k4, Tensor n8 k4 v)]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4),
Tensor n8 k4 v)])
-> [(IndList n7 k4, Tensor n8 k4 v)]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4),
Tensor n8 k4 v)]
forall a b. (a -> b) -> a -> b
$ Tensor n7 k4 (Tensor n8 k4 v) -> [(IndList n7 k4, Tensor n8 k4 v)]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor n7 k4 (Tensor n8 k4 v)
y ) ([((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
Tensor n7 k4 (Tensor n8 k4 v))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4),
Tensor n8 k4 v)])
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
Tensor n7 k4 (Tensor n8 k4 v))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4),
Tensor n8 k4 v)]
forall a b. (a -> b) -> a -> b
$
(((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
Tensor n7 k4 (Tensor n8 k4 v))])
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
Tensor n7 k4 (Tensor n8 k4 v))]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3)
x,Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))
y) -> (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3)
-> [(IndList n6 k3, Tensor n7 k4 (Tensor n8 k4 v))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
Tensor n7 k4 (Tensor n8 k4 v))]
forall a1 a2 a3 a4 a5 b1 b2.
(a1, a2, a3, a4, a5)
-> [(b1, b2)] -> [((a1, a2, a3, a4, a5, b1), b2)]
appendT5 (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3)
x ([(IndList n6 k3, Tensor n7 k4 (Tensor n8 k4 v))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
Tensor n7 k4 (Tensor n8 k4 v))])
-> [(IndList n6 k3, Tensor n7 k4 (Tensor n8 k4 v))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
Tensor n7 k4 (Tensor n8 k4 v))]
forall a b. (a -> b) -> a -> b
$ Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))
-> [(IndList n6 k3, Tensor n7 k4 (Tensor n8 k4 v))]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))
y ) ([((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
Tensor n7 k4 (Tensor n8 k4 v))])
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
Tensor n7 k4 (Tensor n8 k4 v))]
forall a b. (a -> b) -> a -> b
$
(((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))])
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2)
x,Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))
y) -> (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2)
-> [(IndList n5 k3, Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))]
forall a1 a2 a3 a4 b1 b2.
(a1, a2, a3, a4) -> [(b1, b2)] -> [((a1, a2, a3, a4, b1), b2)]
appendT4 (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2)
x ([(IndList n5 k3, Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))])
-> [(IndList n5 k3, Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))]
forall a b. (a -> b) -> a -> b
$ Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))
-> [(IndList n5 k3, Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))
y ) ([((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))])
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))]
forall a b. (a -> b) -> a -> b
$
(((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))))
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))])
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\((IndList n1 k1, IndList n2 k1, IndList n3 k2)
x,Tensor
n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))
y) -> (IndList n1 k1, IndList n2 k1, IndList n3 k2)
-> [(IndList n4 k2,
Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))]
forall a1 a2 a3 b1 b2.
(a1, a2, a3) -> [(b1, b2)] -> [((a1, a2, a3, b1), b2)]
appendT3 (IndList n1 k1, IndList n2 k1, IndList n3 k2)
x ([(IndList n4 k2,
Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))])
-> [(IndList n4 k2,
Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))]
forall a b. (a -> b) -> a -> b
$ Tensor
n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))
-> [(IndList n4 k2,
Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor
n4 k2 (Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))
y ) ([((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))])
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))]
forall a b. (a -> b) -> a -> b
$
(((IndList n1 k1, IndList n2 k1),
Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))))
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))))])
-> [((IndList n1 k1, IndList n2 k1),
Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))))]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\((IndList n1 k1, IndList n2 k1)
x,Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))))
y) -> (IndList n1 k1, IndList n2 k1)
-> [(IndList n3 k2,
Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))))]
forall a1 a2 b1 b2. (a1, a2) -> [(b1, b2)] -> [((a1, a2, b1), b2)]
appendT2 (IndList n1 k1, IndList n2 k1)
x ([(IndList n3 k2,
Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))))])
-> [(IndList n3 k2,
Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))))]
forall a b. (a -> b) -> a -> b
$ Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))))
-> [(IndList n3 k2,
Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))))]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))))
y ) ([((IndList n1 k1, IndList n2 k1),
Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))))])
-> [((IndList n1 k1, IndList n2 k1),
Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))))]
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2),
Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))))]
forall a b. (a -> b) -> a -> b
$
((IndList n1 k1,
Tensor
n2
k1
(Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))))))
-> [((IndList n1 k1, IndList n2 k1),
Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))))])
-> [(IndList n1 k1,
Tensor
n2
k1
(Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))))))]
-> [((IndList n1 k1, IndList n2 k1),
Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))))]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\(IndList n1 k1
x,Tensor
n2
k1
(Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))))
y) -> IndList n1 k1
-> [(IndList n2 k1,
Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))))]
-> [((IndList n1 k1, IndList n2 k1),
Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))))]
forall a1 b1 b2. a1 -> [(b1, b2)] -> [((a1, b1), b2)]
appendT1 IndList n1 k1
x ([(IndList n2 k1,
Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))))]
-> [((IndList n1 k1, IndList n2 k1),
Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))))])
-> [(IndList n2 k1,
Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))))]
-> [((IndList n1 k1, IndList n2 k1),
Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))))]
forall a b. (a -> b) -> a -> b
$ Tensor
n2
k1
(Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))))
-> [(IndList n2 k1,
Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))))]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor
n2
k1
(Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))))
y ) ([(IndList n1 k1,
Tensor
n2
k1
(Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))))))]
-> [((IndList n1 k1, IndList n2 k1),
Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))))])
-> [(IndList n1 k1,
Tensor
n2
k1
(Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))))))]
-> [((IndList n1 k1, IndList n2 k1),
Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v))))))]
forall a b. (a -> b) -> a -> b
$ AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> [(IndList n1 k1,
Tensor
n2
k1
(Tensor
n3
k2
(Tensor
n4
k2
(Tensor n5 k3 (Tensor n6 k3 (Tensor n7 k4 (Tensor n8 k4 v)))))))]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
t
appendT1 :: a1 -> [(b1, b2)] -> [((a1, b1), b2)]
appendT1 :: a1 -> [(b1, b2)] -> [((a1, b1), b2)]
appendT1 a1
i = ((b1, b2) -> ((a1, b1), b2)) -> [(b1, b2)] -> [((a1, b1), b2)]
forall a b. (a -> b) -> [a] -> [b]
map (\(b1
x,b2
y) -> ((a1
i,b1
x),b2
y))
appendT2 :: (a1, a2) -> [(b1, b2)] -> [((a1, a2, b1), b2)]
appendT2 :: (a1, a2) -> [(b1, b2)] -> [((a1, a2, b1), b2)]
appendT2 (a1
i1,a2
i2) = ((b1, b2) -> ((a1, a2, b1), b2))
-> [(b1, b2)] -> [((a1, a2, b1), b2)]
forall a b. (a -> b) -> [a] -> [b]
map (\(b1
x,b2
y) -> ((a1
i1,a2
i2,b1
x),b2
y))
appendT3 :: (a1, a2, a3) -> [(b1, b2)] -> [((a1, a2, a3, b1), b2)]
appendT3 :: (a1, a2, a3) -> [(b1, b2)] -> [((a1, a2, a3, b1), b2)]
appendT3 (a1
i1,a2
i2,a3
i3) = ((b1, b2) -> ((a1, a2, a3, b1), b2))
-> [(b1, b2)] -> [((a1, a2, a3, b1), b2)]
forall a b. (a -> b) -> [a] -> [b]
map (\(b1
x,b2
y) -> ((a1
i1,a2
i2,a3
i3,b1
x),b2
y))
appendT4 :: (a1, a2, a3, a4) -> [(b1, b2)] -> [((a1, a2, a3, a4, b1), b2)]
appendT4 :: (a1, a2, a3, a4) -> [(b1, b2)] -> [((a1, a2, a3, a4, b1), b2)]
appendT4 (a1
i1,a2
i2,a3
i3,a4
i4) = ((b1, b2) -> ((a1, a2, a3, a4, b1), b2))
-> [(b1, b2)] -> [((a1, a2, a3, a4, b1), b2)]
forall a b. (a -> b) -> [a] -> [b]
map (\(b1
x,b2
y) -> ((a1
i1,a2
i2,a3
i3,a4
i4,b1
x),b2
y))
appendT5 :: (a1, a2, a3, a4, a5) -> [(b1, b2)] -> [((a1, a2, a3, a4, a5, b1), b2)]
appendT5 :: (a1, a2, a3, a4, a5)
-> [(b1, b2)] -> [((a1, a2, a3, a4, a5, b1), b2)]
appendT5 (a1
i1,a2
i2,a3
i3,a4
i4,a5
i5) = ((b1, b2) -> ((a1, a2, a3, a4, a5, b1), b2))
-> [(b1, b2)] -> [((a1, a2, a3, a4, a5, b1), b2)]
forall a b. (a -> b) -> [a] -> [b]
map (\(b1
x,b2
y) -> ((a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,b1
x),b2
y))
appendT6 :: (a1, a2, a3, a4, a5, a6) -> [(b1, b2)] -> [((a1, a2, a3, a4, a5, a6, b1), b2)]
appendT6 :: (a1, a2, a3, a4, a5, a6)
-> [(b1, b2)] -> [((a1, a2, a3, a4, a5, a6, b1), b2)]
appendT6 (a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6) = ((b1, b2) -> ((a1, a2, a3, a4, a5, a6, b1), b2))
-> [(b1, b2)] -> [((a1, a2, a3, a4, a5, a6, b1), b2)]
forall a b. (a -> b) -> [a] -> [b]
map (\(b1
x,b2
y) -> ((a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6,b1
x),b2
y))
appendT7 :: (a1, a2, a3, a4, a5, a6, a7) -> [(b1, b2)] -> [((a1, a2, a3, a4, a5, a6, a7, b1), b2)]
appendT7 :: (a1, a2, a3, a4, a5, a6, a7)
-> [(b1, b2)] -> [((a1, a2, a3, a4, a5, a6, a7, b1), b2)]
appendT7 (a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6,a7
i7) = ((b1, b2) -> ((a1, a2, a3, a4, a5, a6, a7, b1), b2))
-> [(b1, b2)] -> [((a1, a2, a3, a4, a5, a6, a7, b1), b2)]
forall a b. (a -> b) -> [a] -> [b]
map (\(b1
x,b2
y) -> ((a1
i1,a2
i2,a3
i3,a4
i4,a5
i5,a6
i6,a7
i7,b1
x),b2
y))
toListT' :: (TIndex k, TAdd v) => Tensor n k v -> [([Int],v)]
toListT' :: Tensor n k v -> [([Int], v)]
toListT' Tensor n k v
t = (([Int], v) -> Bool) -> [([Int], v)] -> [([Int], v)]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool) -> (([Int], v) -> Bool) -> ([Int], v) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Bool
forall a. TAdd a => a -> Bool
scaleZero (v -> Bool) -> (([Int], v) -> v) -> ([Int], v) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], v) -> v
forall a b. (a, b) -> b
snd) ([([Int], v)] -> [([Int], v)]) -> [([Int], v)] -> [([Int], v)]
forall a b. (a -> b) -> a -> b
$ ((IndList n k, v) -> ([Int], v))
-> [(IndList n k, v)] -> [([Int], v)]
forall a b. (a -> b) -> [a] -> [b]
map (\(IndList n k
x,v
y) -> (IndList n k -> [Int]
forall a (t :: * -> *). (Enum a, Foldable t) => t a -> [Int]
showInd IndList n k
x, v
y)) [(IndList n k, v)]
l
where
l :: [(IndList n k, v)]
l = Tensor n k v -> [(IndList n k, v)]
forall (n :: Nat) k v. Tensor n k v -> [(IndList n k, v)]
toListT Tensor n k v
t
showInd :: t a -> [Int]
showInd t a
i1 = (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum ([a] -> [Int]) -> [a] -> [Int]
forall a b. (a -> b) -> a -> b
$ t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i1
toListT1' :: (TIndex k1, TAdd v) => AbsTensor1 n1 k1 v -> [([Int],v)]
toListT1' :: AbsTensor1 n1 k1 v -> [([Int], v)]
toListT1' = AbsTensor1 n1 k1 v -> [([Int], v)]
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
Tensor n k v -> [([Int], v)]
toListT'
toListT2' :: (TIndex k1, TAdd v) => AbsTensor2 n1 n2 k1 v -> [(([Int], [Int]), v)]
toListT2' :: AbsTensor2 n1 n2 k1 v -> [(([Int], [Int]), v)]
toListT2' AbsTensor2 n1 n2 k1 v
t = ((([Int], [Int]), v) -> Bool)
-> [(([Int], [Int]), v)] -> [(([Int], [Int]), v)]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool)
-> ((([Int], [Int]), v) -> Bool) -> (([Int], [Int]), v) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Bool
forall a. TAdd a => a -> Bool
scaleZero (v -> Bool)
-> ((([Int], [Int]), v) -> v) -> (([Int], [Int]), v) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (([Int], [Int]), v) -> v
forall a b. (a, b) -> b
snd) ([(([Int], [Int]), v)] -> [(([Int], [Int]), v)])
-> [(([Int], [Int]), v)] -> [(([Int], [Int]), v)]
forall a b. (a -> b) -> a -> b
$ (((IndList n1 k1, IndList n2 k1), v) -> (([Int], [Int]), v))
-> [((IndList n1 k1, IndList n2 k1), v)] -> [(([Int], [Int]), v)]
forall a b. (a -> b) -> [a] -> [b]
map (\((IndList n1 k1, IndList n2 k1)
x,v
y) -> ((IndList n1 k1, IndList n2 k1) -> ([Int], [Int])
forall a a (t :: * -> *) (t :: * -> *).
(Enum a, Enum a, Foldable t, Foldable t) =>
(t a, t a) -> ([Int], [Int])
showInd (IndList n1 k1, IndList n2 k1)
x, v
y)) [((IndList n1 k1, IndList n2 k1), v)]
l
where
l :: [((IndList n1 k1, IndList n2 k1), v)]
l = AbsTensor2 n1 n2 k1 v -> [((IndList n1 k1, IndList n2 k1), v)]
forall (n1 :: Nat) (n2 :: Nat) k1 v.
AbsTensor2 n1 n2 k1 v -> [(IndTuple2 n1 n2 k1, v)]
toListT2 AbsTensor2 n1 n2 k1 v
t
showInd :: (t a, t a) -> ([Int], [Int])
showInd (t a
i1,t a
i2) = ((a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i1), (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i2))
toListT3' :: (TIndex k1, TIndex k2, TAdd v) => AbsTensor3 n1 n2 n3 k1 k2 v -> [(([Int], [Int], [Int]),v)]
toListT3' :: AbsTensor3 n1 n2 n3 k1 k2 v -> [(([Int], [Int], [Int]), v)]
toListT3' AbsTensor3 n1 n2 n3 k1 k2 v
t = ((([Int], [Int], [Int]), v) -> Bool)
-> [(([Int], [Int], [Int]), v)] -> [(([Int], [Int], [Int]), v)]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool)
-> ((([Int], [Int], [Int]), v) -> Bool)
-> (([Int], [Int], [Int]), v)
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Bool
forall a. TAdd a => a -> Bool
scaleZero (v -> Bool)
-> ((([Int], [Int], [Int]), v) -> v)
-> (([Int], [Int], [Int]), v)
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (([Int], [Int], [Int]), v) -> v
forall a b. (a, b) -> b
snd) ([(([Int], [Int], [Int]), v)] -> [(([Int], [Int], [Int]), v)])
-> [(([Int], [Int], [Int]), v)] -> [(([Int], [Int], [Int]), v)]
forall a b. (a -> b) -> a -> b
$ (((IndList n1 k1, IndList n2 k1, IndList n3 k2), v)
-> (([Int], [Int], [Int]), v))
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2), v)]
-> [(([Int], [Int], [Int]), v)]
forall a b. (a -> b) -> [a] -> [b]
map (\((IndList n1 k1, IndList n2 k1, IndList n3 k2)
x,v
y) -> ((IndList n1 k1, IndList n2 k1, IndList n3 k2)
-> ([Int], [Int], [Int])
forall a a a (t :: * -> *) (t :: * -> *) (t :: * -> *).
(Enum a, Enum a, Enum a, Foldable t, Foldable t, Foldable t) =>
(t a, t a, t a) -> ([Int], [Int], [Int])
showInd (IndList n1 k1, IndList n2 k1, IndList n3 k2)
x, v
y)) [((IndList n1 k1, IndList n2 k1, IndList n3 k2), v)]
l
where
l :: [((IndList n1 k1, IndList n2 k1, IndList n3 k2), v)]
l = AbsTensor3 n1 n2 n3 k1 k2 v
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2), v)]
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2 v.
AbsTensor3 n1 n2 n3 k1 k2 v -> [(IndTuple3 n1 n2 n3 k1 k2, v)]
toListT3 AbsTensor3 n1 n2 n3 k1 k2 v
t
showInd :: (t a, t a, t a) -> ([Int], [Int], [Int])
showInd (t a
i1,t a
i2,t a
i3) = ((a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i1), (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i2),
(a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i3))
toListT4' :: (TIndex k1, TIndex k2, TAdd v) => AbsTensor4 n1 n2 n3 n4 k1 k2 v -> [(([Int], [Int], [Int], [Int]),v)]
toListT4' :: AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> [(([Int], [Int], [Int], [Int]), v)]
toListT4' AbsTensor4 n1 n2 n3 n4 k1 k2 v
t = ((([Int], [Int], [Int], [Int]), v) -> Bool)
-> [(([Int], [Int], [Int], [Int]), v)]
-> [(([Int], [Int], [Int], [Int]), v)]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool)
-> ((([Int], [Int], [Int], [Int]), v) -> Bool)
-> (([Int], [Int], [Int], [Int]), v)
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Bool
forall a. TAdd a => a -> Bool
scaleZero (v -> Bool)
-> ((([Int], [Int], [Int], [Int]), v) -> v)
-> (([Int], [Int], [Int], [Int]), v)
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (([Int], [Int], [Int], [Int]), v) -> v
forall a b. (a, b) -> b
snd) ([(([Int], [Int], [Int], [Int]), v)]
-> [(([Int], [Int], [Int], [Int]), v)])
-> [(([Int], [Int], [Int], [Int]), v)]
-> [(([Int], [Int], [Int], [Int]), v)]
forall a b. (a -> b) -> a -> b
$ (((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2), v)
-> (([Int], [Int], [Int], [Int]), v))
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
v)]
-> [(([Int], [Int], [Int], [Int]), v)]
forall a b. (a -> b) -> [a] -> [b]
map (\((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2)
x,v
y) -> ((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2)
-> ([Int], [Int], [Int], [Int])
forall a a a a (t :: * -> *) (t :: * -> *) (t :: * -> *)
(t :: * -> *).
(Enum a, Enum a, Enum a, Enum a, Foldable t, Foldable t,
Foldable t, Foldable t) =>
(t a, t a, t a, t a) -> ([Int], [Int], [Int], [Int])
showInd (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2)
x, v
y)) [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2), v)]
l
where
l :: [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2), v)]
l = AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
v)]
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2 v.
AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> [(IndTuple4 n1 n2 n3 n4 k1 k2, v)]
toListT4 AbsTensor4 n1 n2 n3 n4 k1 k2 v
t
showInd :: (t a, t a, t a, t a) -> ([Int], [Int], [Int], [Int])
showInd (t a
i1,t a
i2,t a
i3,t a
i4) = ((a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i1), (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i2),
(a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i3), (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i4))
toListT5' :: (TIndex k1, TIndex k2, TIndex k3, TAdd v) => AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v -> [(([Int], [Int], [Int], [Int], [Int]),v)]
toListT5' :: AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> [(([Int], [Int], [Int], [Int], [Int]), v)]
toListT5' AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
t = ((([Int], [Int], [Int], [Int], [Int]), v) -> Bool)
-> [(([Int], [Int], [Int], [Int], [Int]), v)]
-> [(([Int], [Int], [Int], [Int], [Int]), v)]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool)
-> ((([Int], [Int], [Int], [Int], [Int]), v) -> Bool)
-> (([Int], [Int], [Int], [Int], [Int]), v)
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Bool
forall a. TAdd a => a -> Bool
scaleZero (v -> Bool)
-> ((([Int], [Int], [Int], [Int], [Int]), v) -> v)
-> (([Int], [Int], [Int], [Int], [Int]), v)
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (([Int], [Int], [Int], [Int], [Int]), v) -> v
forall a b. (a, b) -> b
snd) ([(([Int], [Int], [Int], [Int], [Int]), v)]
-> [(([Int], [Int], [Int], [Int], [Int]), v)])
-> [(([Int], [Int], [Int], [Int], [Int]), v)]
-> [(([Int], [Int], [Int], [Int], [Int]), v)]
forall a b. (a -> b) -> a -> b
$ (((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
v)
-> (([Int], [Int], [Int], [Int], [Int]), v))
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
v)]
-> [(([Int], [Int], [Int], [Int], [Int]), v)]
forall a b. (a -> b) -> [a] -> [b]
map (\((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3)
x,v
y) -> ((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3)
-> ([Int], [Int], [Int], [Int], [Int])
forall a a a a a (t :: * -> *) (t :: * -> *) (t :: * -> *)
(t :: * -> *) (t :: * -> *).
(Enum a, Enum a, Enum a, Enum a, Enum a, Foldable t, Foldable t,
Foldable t, Foldable t, Foldable t) =>
(t a, t a, t a, t a, t a) -> ([Int], [Int], [Int], [Int], [Int])
showInd (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3)
x, v
y)) [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
v)]
l
where
l :: [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
v)]
l = AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
v)]
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
k1 k2 k3 v.
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> [(IndTuple5 n1 n2 n3 n4 n5 k1 k2 k3, v)]
toListT5 AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
t
showInd :: (t a, t a, t a, t a, t a) -> ([Int], [Int], [Int], [Int], [Int])
showInd (t a
i1,t a
i2,t a
i3,t a
i4,t a
i5) = ((a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i1), (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i2),
(a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i3), (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i4),
(a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i5))
toListT6' :: (TIndex k1, TIndex k2, TIndex k3, TAdd v) => AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v -> [(([Int], [Int], [Int], [Int], [Int], [Int]),v)]
toListT6' :: AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> [(([Int], [Int], [Int], [Int], [Int], [Int]), v)]
toListT6' AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
t = ((([Int], [Int], [Int], [Int], [Int], [Int]), v) -> Bool)
-> [(([Int], [Int], [Int], [Int], [Int], [Int]), v)]
-> [(([Int], [Int], [Int], [Int], [Int], [Int]), v)]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool)
-> ((([Int], [Int], [Int], [Int], [Int], [Int]), v) -> Bool)
-> (([Int], [Int], [Int], [Int], [Int], [Int]), v)
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Bool
forall a. TAdd a => a -> Bool
scaleZero (v -> Bool)
-> ((([Int], [Int], [Int], [Int], [Int], [Int]), v) -> v)
-> (([Int], [Int], [Int], [Int], [Int], [Int]), v)
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (([Int], [Int], [Int], [Int], [Int], [Int]), v) -> v
forall a b. (a, b) -> b
snd) ([(([Int], [Int], [Int], [Int], [Int], [Int]), v)]
-> [(([Int], [Int], [Int], [Int], [Int], [Int]), v)])
-> [(([Int], [Int], [Int], [Int], [Int], [Int]), v)]
-> [(([Int], [Int], [Int], [Int], [Int], [Int]), v)]
forall a b. (a -> b) -> a -> b
$ (((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
v)
-> (([Int], [Int], [Int], [Int], [Int], [Int]), v))
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
v)]
-> [(([Int], [Int], [Int], [Int], [Int], [Int]), v)]
forall a b. (a -> b) -> [a] -> [b]
map (\((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3)
x,v
y) -> ((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3)
-> ([Int], [Int], [Int], [Int], [Int], [Int])
forall a a a a a a (t :: * -> *) (t :: * -> *) (t :: * -> *)
(t :: * -> *) (t :: * -> *) (t :: * -> *).
(Enum a, Enum a, Enum a, Enum a, Enum a, Enum a, Foldable t,
Foldable t, Foldable t, Foldable t, Foldable t, Foldable t) =>
(t a, t a, t a, t a, t a, t a)
-> ([Int], [Int], [Int], [Int], [Int], [Int])
showInd (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3)
x, v
y)) [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
v)]
l
where
l :: [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
v)]
l = AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
v)]
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) k1 k2 k3 v.
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> [(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
toListT6 AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
t
showInd :: (t a, t a, t a, t a, t a, t a)
-> ([Int], [Int], [Int], [Int], [Int], [Int])
showInd (t a
i1,t a
i2,t a
i3,t a
i4,t a
i5,t a
i6) = ((a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i1), (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i2),
(a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i3), (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i4),
(a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i5), (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i6))
toListT7' :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) => AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v -> [(([Int], [Int], [Int], [Int], [Int], [Int], [Int]),v)]
toListT7' :: AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> [(([Int], [Int], [Int], [Int], [Int], [Int], [Int]), v)]
toListT7' AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
t = ((([Int], [Int], [Int], [Int], [Int], [Int], [Int]), v) -> Bool)
-> [(([Int], [Int], [Int], [Int], [Int], [Int], [Int]), v)]
-> [(([Int], [Int], [Int], [Int], [Int], [Int], [Int]), v)]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool)
-> ((([Int], [Int], [Int], [Int], [Int], [Int], [Int]), v) -> Bool)
-> (([Int], [Int], [Int], [Int], [Int], [Int], [Int]), v)
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Bool
forall a. TAdd a => a -> Bool
scaleZero (v -> Bool)
-> ((([Int], [Int], [Int], [Int], [Int], [Int], [Int]), v) -> v)
-> (([Int], [Int], [Int], [Int], [Int], [Int], [Int]), v)
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (([Int], [Int], [Int], [Int], [Int], [Int], [Int]), v) -> v
forall a b. (a, b) -> b
snd) ([(([Int], [Int], [Int], [Int], [Int], [Int], [Int]), v)]
-> [(([Int], [Int], [Int], [Int], [Int], [Int], [Int]), v)])
-> [(([Int], [Int], [Int], [Int], [Int], [Int], [Int]), v)]
-> [(([Int], [Int], [Int], [Int], [Int], [Int], [Int]), v)]
forall a b. (a -> b) -> a -> b
$ (((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4),
v)
-> (([Int], [Int], [Int], [Int], [Int], [Int], [Int]), v))
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4),
v)]
-> [(([Int], [Int], [Int], [Int], [Int], [Int], [Int]), v)]
forall a b. (a -> b) -> [a] -> [b]
map (\((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4)
x,v
y) -> ((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4)
-> ([Int], [Int], [Int], [Int], [Int], [Int], [Int])
forall a a a a a a a (t :: * -> *) (t :: * -> *) (t :: * -> *)
(t :: * -> *) (t :: * -> *) (t :: * -> *) (t :: * -> *).
(Enum a, Enum a, Enum a, Enum a, Enum a, Enum a, Enum a,
Foldable t, Foldable t, Foldable t, Foldable t, Foldable t,
Foldable t, Foldable t) =>
(t a, t a, t a, t a, t a, t a, t a)
-> ([Int], [Int], [Int], [Int], [Int], [Int], [Int])
showInd (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4)
x, v
y)) [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4),
v)]
l
where
l :: [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4),
v)]
l = AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4),
v)]
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat) k1 k2 k3 k4 v.
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> [(IndTuple7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4, v)]
toListT7 AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
t
showInd :: (t a, t a, t a, t a, t a, t a, t a)
-> ([Int], [Int], [Int], [Int], [Int], [Int], [Int])
showInd (t a
i1,t a
i2,t a
i3,t a
i4,t a
i5,t a
i6,t a
i7) = ((a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i1), (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i2),
(a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i3), (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i4),
(a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i5), (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i6),
(a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i7))
toListT8' :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) => AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v -> [(([Int], [Int], [Int], [Int], [Int], [Int], [Int], [Int]),v)]
toListT8' :: AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> [(([Int], [Int], [Int], [Int], [Int], [Int], [Int], [Int]), v)]
toListT8' AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
t = ((([Int], [Int], [Int], [Int], [Int], [Int], [Int], [Int]), v)
-> Bool)
-> [(([Int], [Int], [Int], [Int], [Int], [Int], [Int], [Int]), v)]
-> [(([Int], [Int], [Int], [Int], [Int], [Int], [Int], [Int]), v)]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool)
-> ((([Int], [Int], [Int], [Int], [Int], [Int], [Int], [Int]), v)
-> Bool)
-> (([Int], [Int], [Int], [Int], [Int], [Int], [Int], [Int]), v)
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Bool
forall a. TAdd a => a -> Bool
scaleZero (v -> Bool)
-> ((([Int], [Int], [Int], [Int], [Int], [Int], [Int], [Int]), v)
-> v)
-> (([Int], [Int], [Int], [Int], [Int], [Int], [Int], [Int]), v)
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (([Int], [Int], [Int], [Int], [Int], [Int], [Int], [Int]), v) -> v
forall a b. (a, b) -> b
snd) ([(([Int], [Int], [Int], [Int], [Int], [Int], [Int], [Int]), v)]
-> [(([Int], [Int], [Int], [Int], [Int], [Int], [Int], [Int]), v)])
-> [(([Int], [Int], [Int], [Int], [Int], [Int], [Int], [Int]), v)]
-> [(([Int], [Int], [Int], [Int], [Int], [Int], [Int], [Int]), v)]
forall a b. (a -> b) -> a -> b
$ (((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4, IndList n8 k4),
v)
-> (([Int], [Int], [Int], [Int], [Int], [Int], [Int], [Int]), v))
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4, IndList n8 k4),
v)]
-> [(([Int], [Int], [Int], [Int], [Int], [Int], [Int], [Int]), v)]
forall a b. (a -> b) -> [a] -> [b]
map (\((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4, IndList n8 k4)
x,v
y) -> ((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4, IndList n8 k4)
-> ([Int], [Int], [Int], [Int], [Int], [Int], [Int], [Int])
forall a a a a a a a a (t :: * -> *) (t :: * -> *) (t :: * -> *)
(t :: * -> *) (t :: * -> *) (t :: * -> *) (t :: * -> *)
(t :: * -> *).
(Enum a, Enum a, Enum a, Enum a, Enum a, Enum a, Enum a, Enum a,
Foldable t, Foldable t, Foldable t, Foldable t, Foldable t,
Foldable t, Foldable t, Foldable t) =>
(t a, t a, t a, t a, t a, t a, t a, t a)
-> ([Int], [Int], [Int], [Int], [Int], [Int], [Int], [Int])
showInd (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4, IndList n8 k4)
x, v
y)) [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4, IndList n8 k4),
v)]
l
where
l :: [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4, IndList n8 k4),
v)]
l = AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4, IndList n8 k4),
v)]
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat) (n8 :: Nat) k1 k2 k3 k4 v.
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> [(IndTuple8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4, v)]
toListT8 AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
t
showInd :: (t a, t a, t a, t a, t a, t a, t a, t a)
-> ([Int], [Int], [Int], [Int], [Int], [Int], [Int], [Int])
showInd (t a
i1,t a
i2,t a
i3,t a
i4,t a
i5,t a
i6,t a
i7,t a
i8) = ((a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i1), (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i2),
(a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i3), (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i4),
(a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i5), (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i6),
(a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i7), (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i8))
toListShow1 :: (TIndex k1, TAdd v) => AbsTensor1 n1 k1 v -> [([Int],v)]
toListShow1 :: AbsTensor1 n1 k1 v -> [([Int], v)]
toListShow1 = AbsTensor1 n1 k1 v -> [([Int], v)]
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
Tensor n k v -> [([Int], v)]
toListT'
toListShow2 :: (TIndex k1, TAdd v) => AbsTensor2 n1 n2 k1 v -> [([Int],v)]
toListShow2 :: AbsTensor2 n1 n2 k1 v -> [([Int], v)]
toListShow2 AbsTensor2 n1 n2 k1 v
t = (([Int], v) -> Bool) -> [([Int], v)] -> [([Int], v)]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool) -> (([Int], v) -> Bool) -> ([Int], v) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Bool
forall a. TAdd a => a -> Bool
scaleZero (v -> Bool) -> (([Int], v) -> v) -> ([Int], v) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], v) -> v
forall a b. (a, b) -> b
snd) ([([Int], v)] -> [([Int], v)]) -> [([Int], v)] -> [([Int], v)]
forall a b. (a -> b) -> a -> b
$ (((IndList n1 k1, IndList n2 k1), v) -> ([Int], v))
-> [((IndList n1 k1, IndList n2 k1), v)] -> [([Int], v)]
forall a b. (a -> b) -> [a] -> [b]
map (\((IndList n1 k1, IndList n2 k1)
x,v
y) -> ((IndList n1 k1, IndList n2 k1) -> [Int]
forall a a (t :: * -> *) (t :: * -> *).
(Enum a, Enum a, Foldable t, Foldable t) =>
(t a, t a) -> [Int]
showInd (IndList n1 k1, IndList n2 k1)
x, v
y)) [((IndList n1 k1, IndList n2 k1), v)]
l
where
l :: [((IndList n1 k1, IndList n2 k1), v)]
l = AbsTensor2 n1 n2 k1 v -> [((IndList n1 k1, IndList n2 k1), v)]
forall (n1 :: Nat) (n2 :: Nat) k1 v.
AbsTensor2 n1 n2 k1 v -> [(IndTuple2 n1 n2 k1, v)]
toListT2 AbsTensor2 n1 n2 k1 v
t
showInd :: (t a, t a) -> [Int]
showInd (t a
i1,t a
i2) = (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i1) [Int] -> [Int] -> [Int]
forall a. [a] -> [a] -> [a]
++ (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i2)
toListShow3 :: (TIndex k1, TIndex k2, TAdd v) => AbsTensor3 n1 n2 n3 k1 k2 v -> [([Int],v)]
toListShow3 :: AbsTensor3 n1 n2 n3 k1 k2 v -> [([Int], v)]
toListShow3 AbsTensor3 n1 n2 n3 k1 k2 v
t = (([Int], v) -> Bool) -> [([Int], v)] -> [([Int], v)]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool) -> (([Int], v) -> Bool) -> ([Int], v) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Bool
forall a. TAdd a => a -> Bool
scaleZero (v -> Bool) -> (([Int], v) -> v) -> ([Int], v) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], v) -> v
forall a b. (a, b) -> b
snd) ([([Int], v)] -> [([Int], v)]) -> [([Int], v)] -> [([Int], v)]
forall a b. (a -> b) -> a -> b
$ (((IndList n1 k1, IndList n2 k1, IndList n3 k2), v) -> ([Int], v))
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2), v)]
-> [([Int], v)]
forall a b. (a -> b) -> [a] -> [b]
map (\((IndList n1 k1, IndList n2 k1, IndList n3 k2)
x,v
y) -> ((IndList n1 k1, IndList n2 k1, IndList n3 k2) -> [Int]
forall a a a (t :: * -> *) (t :: * -> *) (t :: * -> *).
(Enum a, Enum a, Enum a, Foldable t, Foldable t, Foldable t) =>
(t a, t a, t a) -> [Int]
showInd (IndList n1 k1, IndList n2 k1, IndList n3 k2)
x, v
y)) [((IndList n1 k1, IndList n2 k1, IndList n3 k2), v)]
l
where
l :: [((IndList n1 k1, IndList n2 k1, IndList n3 k2), v)]
l = AbsTensor3 n1 n2 n3 k1 k2 v
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2), v)]
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2 v.
AbsTensor3 n1 n2 n3 k1 k2 v -> [(IndTuple3 n1 n2 n3 k1 k2, v)]
toListT3 AbsTensor3 n1 n2 n3 k1 k2 v
t
showInd :: (t a, t a, t a) -> [Int]
showInd (t a
i1,t a
i2,t a
i3) = (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i1) [Int] -> [Int] -> [Int]
forall a. [a] -> [a] -> [a]
++ (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i2) [Int] -> [Int] -> [Int]
forall a. [a] -> [a] -> [a]
++
(a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i3)
toListShow4 :: (TIndex k1, TIndex k2, TAdd v) => AbsTensor4 n1 n2 n3 n4 k1 k2 v -> [([Int],v)]
toListShow4 :: AbsTensor4 n1 n2 n3 n4 k1 k2 v -> [([Int], v)]
toListShow4 AbsTensor4 n1 n2 n3 n4 k1 k2 v
t = (([Int], v) -> Bool) -> [([Int], v)] -> [([Int], v)]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool) -> (([Int], v) -> Bool) -> ([Int], v) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Bool
forall a. TAdd a => a -> Bool
scaleZero (v -> Bool) -> (([Int], v) -> v) -> ([Int], v) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], v) -> v
forall a b. (a, b) -> b
snd) ([([Int], v)] -> [([Int], v)]) -> [([Int], v)] -> [([Int], v)]
forall a b. (a -> b) -> a -> b
$ (((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2), v)
-> ([Int], v))
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
v)]
-> [([Int], v)]
forall a b. (a -> b) -> [a] -> [b]
map (\((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2)
x,v
y) -> ((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2)
-> [Int]
forall a a a a (t :: * -> *) (t :: * -> *) (t :: * -> *)
(t :: * -> *).
(Enum a, Enum a, Enum a, Enum a, Foldable t, Foldable t,
Foldable t, Foldable t) =>
(t a, t a, t a, t a) -> [Int]
showInd (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2)
x, v
y)) [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2), v)]
l
where
l :: [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2), v)]
l = AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2),
v)]
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2 v.
AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> [(IndTuple4 n1 n2 n3 n4 k1 k2, v)]
toListT4 AbsTensor4 n1 n2 n3 n4 k1 k2 v
t
showInd :: (t a, t a, t a, t a) -> [Int]
showInd (t a
i1,t a
i2,t a
i3,t a
i4) = (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i1) [Int] -> [Int] -> [Int]
forall a. [a] -> [a] -> [a]
++ (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i2) [Int] -> [Int] -> [Int]
forall a. [a] -> [a] -> [a]
++
(a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i3) [Int] -> [Int] -> [Int]
forall a. [a] -> [a] -> [a]
++ (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i4)
toListShow5 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v) => AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v -> [([Int],v)]
toListShow5 :: AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v -> [([Int], v)]
toListShow5 AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
t = (([Int], v) -> Bool) -> [([Int], v)] -> [([Int], v)]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool) -> (([Int], v) -> Bool) -> ([Int], v) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Bool
forall a. TAdd a => a -> Bool
scaleZero (v -> Bool) -> (([Int], v) -> v) -> ([Int], v) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], v) -> v
forall a b. (a, b) -> b
snd) ([([Int], v)] -> [([Int], v)]) -> [([Int], v)] -> [([Int], v)]
forall a b. (a -> b) -> a -> b
$ (((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
v)
-> ([Int], v))
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
v)]
-> [([Int], v)]
forall a b. (a -> b) -> [a] -> [b]
map (\((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3)
x,v
y) -> ((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3)
-> [Int]
forall a a a a a (t :: * -> *) (t :: * -> *) (t :: * -> *)
(t :: * -> *) (t :: * -> *).
(Enum a, Enum a, Enum a, Enum a, Enum a, Foldable t, Foldable t,
Foldable t, Foldable t, Foldable t) =>
(t a, t a, t a, t a, t a) -> [Int]
showInd (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3)
x, v
y)) [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
v)]
l
where
l :: [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
v)]
l = AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3),
v)]
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
k1 k2 k3 v.
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> [(IndTuple5 n1 n2 n3 n4 n5 k1 k2 k3, v)]
toListT5 AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
t
showInd :: (t a, t a, t a, t a, t a) -> [Int]
showInd (t a
i1,t a
i2,t a
i3,t a
i4,t a
i5) = (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i1) [Int] -> [Int] -> [Int]
forall a. [a] -> [a] -> [a]
++ (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i2) [Int] -> [Int] -> [Int]
forall a. [a] -> [a] -> [a]
++
(a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i3) [Int] -> [Int] -> [Int]
forall a. [a] -> [a] -> [a]
++ (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i4) [Int] -> [Int] -> [Int]
forall a. [a] -> [a] -> [a]
++
(a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i5)
toListShow6 :: (TIndex k1, TIndex k2, TIndex k3, TAdd v) => AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v -> [([Int],v)]
toListShow6 :: AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v -> [([Int], v)]
toListShow6 AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
t = (([Int], v) -> Bool) -> [([Int], v)] -> [([Int], v)]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool) -> (([Int], v) -> Bool) -> ([Int], v) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Bool
forall a. TAdd a => a -> Bool
scaleZero (v -> Bool) -> (([Int], v) -> v) -> ([Int], v) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], v) -> v
forall a b. (a, b) -> b
snd) ([([Int], v)] -> [([Int], v)]) -> [([Int], v)] -> [([Int], v)]
forall a b. (a -> b) -> a -> b
$ (((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
v)
-> ([Int], v))
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
v)]
-> [([Int], v)]
forall a b. (a -> b) -> [a] -> [b]
map (\((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3)
x,v
y) -> ((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3)
-> [Int]
forall a a a a a a (t :: * -> *) (t :: * -> *) (t :: * -> *)
(t :: * -> *) (t :: * -> *) (t :: * -> *).
(Enum a, Enum a, Enum a, Enum a, Enum a, Enum a, Foldable t,
Foldable t, Foldable t, Foldable t, Foldable t, Foldable t) =>
(t a, t a, t a, t a, t a, t a) -> [Int]
showInd (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3)
x, v
y)) [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
v)]
l
where
l :: [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
v)]
l = AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3),
v)]
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) k1 k2 k3 v.
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> [(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
toListT6 AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
t
showInd :: (t a, t a, t a, t a, t a, t a) -> [Int]
showInd (t a
i1,t a
i2,t a
i3,t a
i4,t a
i5,t a
i6) = (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i1) [Int] -> [Int] -> [Int]
forall a. [a] -> [a] -> [a]
++ (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i2) [Int] -> [Int] -> [Int]
forall a. [a] -> [a] -> [a]
++
(a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i3) [Int] -> [Int] -> [Int]
forall a. [a] -> [a] -> [a]
++ (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i4) [Int] -> [Int] -> [Int]
forall a. [a] -> [a] -> [a]
++
(a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i5) [Int] -> [Int] -> [Int]
forall a. [a] -> [a] -> [a]
++ (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i6)
toListShow7 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) => AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v -> [([Int],v)]
toListShow7 :: AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v -> [([Int], v)]
toListShow7 AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
t = (([Int], v) -> Bool) -> [([Int], v)] -> [([Int], v)]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool) -> (([Int], v) -> Bool) -> ([Int], v) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Bool
forall a. TAdd a => a -> Bool
scaleZero (v -> Bool) -> (([Int], v) -> v) -> ([Int], v) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], v) -> v
forall a b. (a, b) -> b
snd) ([([Int], v)] -> [([Int], v)]) -> [([Int], v)] -> [([Int], v)]
forall a b. (a -> b) -> a -> b
$ (((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4),
v)
-> ([Int], v))
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4),
v)]
-> [([Int], v)]
forall a b. (a -> b) -> [a] -> [b]
map (\((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4)
x,v
y) -> ((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4)
-> [Int]
forall a a a a a a a (t :: * -> *) (t :: * -> *) (t :: * -> *)
(t :: * -> *) (t :: * -> *) (t :: * -> *) (t :: * -> *).
(Enum a, Enum a, Enum a, Enum a, Enum a, Enum a, Enum a,
Foldable t, Foldable t, Foldable t, Foldable t, Foldable t,
Foldable t, Foldable t) =>
(t a, t a, t a, t a, t a, t a, t a) -> [Int]
showInd (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4)
x, v
y)) [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4),
v)]
l
where
l :: [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4),
v)]
l = AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4),
v)]
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat) k1 k2 k3 k4 v.
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> [(IndTuple7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4, v)]
toListT7 AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
t
showInd :: (t a, t a, t a, t a, t a, t a, t a) -> [Int]
showInd (t a
i1,t a
i2,t a
i3,t a
i4,t a
i5,t a
i6,t a
i7) = (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i1) [Int] -> [Int] -> [Int]
forall a. [a] -> [a] -> [a]
++ (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i2) [Int] -> [Int] -> [Int]
forall a. [a] -> [a] -> [a]
++
(a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i3) [Int] -> [Int] -> [Int]
forall a. [a] -> [a] -> [a]
++ (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i4) [Int] -> [Int] -> [Int]
forall a. [a] -> [a] -> [a]
++
(a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i5) [Int] -> [Int] -> [Int]
forall a. [a] -> [a] -> [a]
++ (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i6) [Int] -> [Int] -> [Int]
forall a. [a] -> [a] -> [a]
++
(a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i7)
toListShow8 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) => AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v -> [([Int],v)]
toListShow8 :: AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v -> [([Int], v)]
toListShow8 AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
t = (([Int], v) -> Bool) -> [([Int], v)] -> [([Int], v)]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool) -> (([Int], v) -> Bool) -> ([Int], v) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. v -> Bool
forall a. TAdd a => a -> Bool
scaleZero (v -> Bool) -> (([Int], v) -> v) -> ([Int], v) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], v) -> v
forall a b. (a, b) -> b
snd) ([([Int], v)] -> [([Int], v)]) -> [([Int], v)] -> [([Int], v)]
forall a b. (a -> b) -> a -> b
$ (((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4, IndList n8 k4),
v)
-> ([Int], v))
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4, IndList n8 k4),
v)]
-> [([Int], v)]
forall a b. (a -> b) -> [a] -> [b]
map (\((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4, IndList n8 k4)
x,v
y) -> ((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4, IndList n8 k4)
-> [Int]
forall a a a a a a a a (t :: * -> *) (t :: * -> *) (t :: * -> *)
(t :: * -> *) (t :: * -> *) (t :: * -> *) (t :: * -> *)
(t :: * -> *).
(Enum a, Enum a, Enum a, Enum a, Enum a, Enum a, Enum a, Enum a,
Foldable t, Foldable t, Foldable t, Foldable t, Foldable t,
Foldable t, Foldable t, Foldable t) =>
(t a, t a, t a, t a, t a, t a, t a, t a) -> [Int]
showInd (IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4, IndList n8 k4)
x, v
y)) [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4, IndList n8 k4),
v)]
l
where
l :: [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4, IndList n8 k4),
v)]
l = AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> [((IndList n1 k1, IndList n2 k1, IndList n3 k2, IndList n4 k2,
IndList n5 k3, IndList n6 k3, IndList n7 k4, IndList n8 k4),
v)]
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat) (n8 :: Nat) k1 k2 k3 k4 v.
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> [(IndTuple8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4, v)]
toListT8 AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
t
showInd :: (t a, t a, t a, t a, t a, t a, t a, t a) -> [Int]
showInd (t a
i1,t a
i2,t a
i3,t a
i4,t a
i5,t a
i6,t a
i7,t a
i8) = (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i1) [Int] -> [Int] -> [Int]
forall a. [a] -> [a] -> [a]
++ (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i2) [Int] -> [Int] -> [Int]
forall a. [a] -> [a] -> [a]
++
(a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i3) [Int] -> [Int] -> [Int]
forall a. [a] -> [a] -> [a]
++ (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i4) [Int] -> [Int] -> [Int]
forall a. [a] -> [a] -> [a]
++
(a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i5) [Int] -> [Int] -> [Int]
forall a. [a] -> [a] -> [a]
++ (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i6) [Int] -> [Int] -> [Int]
forall a. [a] -> [a] -> [a]
++
(a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i7) [Int] -> [Int] -> [Int]
forall a. [a] -> [a] -> [a]
++ (a -> Int) -> [a] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map a -> Int
forall a. Enum a => a -> Int
fromEnum (t a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList t a
i8)
toListShowVar1 :: (TIndex k1, TAdd a) => AbsTensor1 n1 k1 (AnsVar a) -> [([Int], [(Int, a)])]
toListShowVar1 :: AbsTensor1 n1 k1 (AnsVar a) -> [([Int], [(Int, a)])]
toListShowVar1 AbsTensor1 n1 k1 (AnsVar a)
t = (([Int], [(Int, a)]) -> Bool)
-> [([Int], [(Int, a)])] -> [([Int], [(Int, a)])]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool)
-> (([Int], [(Int, a)]) -> Bool) -> ([Int], [(Int, a)]) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [(Int, a)] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null ([(Int, a)] -> Bool)
-> (([Int], [(Int, a)]) -> [(Int, a)])
-> ([Int], [(Int, a)])
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [(Int, a)]) -> [(Int, a)]
forall a b. (a, b) -> b
snd) ([([Int], [(Int, a)])] -> [([Int], [(Int, a)])])
-> [([Int], [(Int, a)])] -> [([Int], [(Int, a)])]
forall a b. (a -> b) -> a -> b
$ (([Int], AnsVar a) -> ([Int], [(Int, a)]))
-> [([Int], AnsVar a)] -> [([Int], [(Int, a)])]
forall a b. (a -> b) -> [a] -> [b]
map (\([Int]
a,AnsVar IntMap a
b) -> ([Int]
a, ((Int, a) -> Bool) -> [(Int, a)] -> [(Int, a)]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool) -> ((Int, a) -> Bool) -> (Int, a) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> Bool
forall a. TAdd a => a -> Bool
scaleZero (a -> Bool) -> ((Int, a) -> a) -> (Int, a) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, a) -> a
forall a b. (a, b) -> b
snd) ([(Int, a)] -> [(Int, a)]) -> [(Int, a)] -> [(Int, a)]
forall a b. (a -> b) -> a -> b
$ IntMap a -> [(Int, a)]
forall a. IntMap a -> [(Int, a)]
I.assocs IntMap a
b)) [([Int], AnsVar a)]
l
where
l :: [([Int], AnsVar a)]
l = AbsTensor1 n1 k1 (AnsVar a) -> [([Int], AnsVar a)]
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
Tensor n k v -> [([Int], v)]
toListShow1 AbsTensor1 n1 k1 (AnsVar a)
t
toListShowVar2 :: (TIndex k1, TAdd a) => AbsTensor2 n1 n2 k1 (AnsVar a) -> [([Int], [(Int, a)])]
toListShowVar2 :: AbsTensor2 n1 n2 k1 (AnsVar a) -> [([Int], [(Int, a)])]
toListShowVar2 AbsTensor2 n1 n2 k1 (AnsVar a)
t = (([Int], [(Int, a)]) -> Bool)
-> [([Int], [(Int, a)])] -> [([Int], [(Int, a)])]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool)
-> (([Int], [(Int, a)]) -> Bool) -> ([Int], [(Int, a)]) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [(Int, a)] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null ([(Int, a)] -> Bool)
-> (([Int], [(Int, a)]) -> [(Int, a)])
-> ([Int], [(Int, a)])
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [(Int, a)]) -> [(Int, a)]
forall a b. (a, b) -> b
snd) ([([Int], [(Int, a)])] -> [([Int], [(Int, a)])])
-> [([Int], [(Int, a)])] -> [([Int], [(Int, a)])]
forall a b. (a -> b) -> a -> b
$ (([Int], AnsVar a) -> ([Int], [(Int, a)]))
-> [([Int], AnsVar a)] -> [([Int], [(Int, a)])]
forall a b. (a -> b) -> [a] -> [b]
map (\([Int]
a,AnsVar IntMap a
b) -> ([Int]
a, ((Int, a) -> Bool) -> [(Int, a)] -> [(Int, a)]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool) -> ((Int, a) -> Bool) -> (Int, a) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> Bool
forall a. TAdd a => a -> Bool
scaleZero (a -> Bool) -> ((Int, a) -> a) -> (Int, a) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, a) -> a
forall a b. (a, b) -> b
snd) ([(Int, a)] -> [(Int, a)]) -> [(Int, a)] -> [(Int, a)]
forall a b. (a -> b) -> a -> b
$ IntMap a -> [(Int, a)]
forall a. IntMap a -> [(Int, a)]
I.assocs IntMap a
b)) [([Int], AnsVar a)]
l
where
l :: [([Int], AnsVar a)]
l = AbsTensor2 n1 n2 k1 (AnsVar a) -> [([Int], AnsVar a)]
forall k1 v (n1 :: Nat) (n2 :: Nat).
(TIndex k1, TAdd v) =>
AbsTensor2 n1 n2 k1 v -> [([Int], v)]
toListShow2 AbsTensor2 n1 n2 k1 (AnsVar a)
t
toListShowVar3 :: (TIndex k1, TIndex k2, TAdd a) => AbsTensor3 n1 n2 n3 k1 k2 (AnsVar a) -> [([Int], [(Int, a)])]
toListShowVar3 :: AbsTensor3 n1 n2 n3 k1 k2 (AnsVar a) -> [([Int], [(Int, a)])]
toListShowVar3 AbsTensor3 n1 n2 n3 k1 k2 (AnsVar a)
t = (([Int], [(Int, a)]) -> Bool)
-> [([Int], [(Int, a)])] -> [([Int], [(Int, a)])]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool)
-> (([Int], [(Int, a)]) -> Bool) -> ([Int], [(Int, a)]) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [(Int, a)] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null ([(Int, a)] -> Bool)
-> (([Int], [(Int, a)]) -> [(Int, a)])
-> ([Int], [(Int, a)])
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [(Int, a)]) -> [(Int, a)]
forall a b. (a, b) -> b
snd) ([([Int], [(Int, a)])] -> [([Int], [(Int, a)])])
-> [([Int], [(Int, a)])] -> [([Int], [(Int, a)])]
forall a b. (a -> b) -> a -> b
$ (([Int], AnsVar a) -> ([Int], [(Int, a)]))
-> [([Int], AnsVar a)] -> [([Int], [(Int, a)])]
forall a b. (a -> b) -> [a] -> [b]
map (\([Int]
a,AnsVar IntMap a
b) -> ([Int]
a, ((Int, a) -> Bool) -> [(Int, a)] -> [(Int, a)]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool) -> ((Int, a) -> Bool) -> (Int, a) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> Bool
forall a. TAdd a => a -> Bool
scaleZero (a -> Bool) -> ((Int, a) -> a) -> (Int, a) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, a) -> a
forall a b. (a, b) -> b
snd) ([(Int, a)] -> [(Int, a)]) -> [(Int, a)] -> [(Int, a)]
forall a b. (a -> b) -> a -> b
$ IntMap a -> [(Int, a)]
forall a. IntMap a -> [(Int, a)]
I.assocs IntMap a
b)) [([Int], AnsVar a)]
l
where
l :: [([Int], AnsVar a)]
l = AbsTensor3 n1 n2 n3 k1 k2 (AnsVar a) -> [([Int], AnsVar a)]
forall k1 k2 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat).
(TIndex k1, TIndex k2, TAdd v) =>
AbsTensor3 n1 n2 n3 k1 k2 v -> [([Int], v)]
toListShow3 AbsTensor3 n1 n2 n3 k1 k2 (AnsVar a)
t
toListShowVar4 :: (TIndex k1, TIndex k2, TAdd a) => AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar a) -> [([Int], [(Int, a)])]
toListShowVar4 :: AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar a) -> [([Int], [(Int, a)])]
toListShowVar4 AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar a)
t = (([Int], [(Int, a)]) -> Bool)
-> [([Int], [(Int, a)])] -> [([Int], [(Int, a)])]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool)
-> (([Int], [(Int, a)]) -> Bool) -> ([Int], [(Int, a)]) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [(Int, a)] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null ([(Int, a)] -> Bool)
-> (([Int], [(Int, a)]) -> [(Int, a)])
-> ([Int], [(Int, a)])
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [(Int, a)]) -> [(Int, a)]
forall a b. (a, b) -> b
snd) ([([Int], [(Int, a)])] -> [([Int], [(Int, a)])])
-> [([Int], [(Int, a)])] -> [([Int], [(Int, a)])]
forall a b. (a -> b) -> a -> b
$ (([Int], AnsVar a) -> ([Int], [(Int, a)]))
-> [([Int], AnsVar a)] -> [([Int], [(Int, a)])]
forall a b. (a -> b) -> [a] -> [b]
map (\([Int]
a,AnsVar IntMap a
b) -> ([Int]
a, ((Int, a) -> Bool) -> [(Int, a)] -> [(Int, a)]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool) -> ((Int, a) -> Bool) -> (Int, a) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> Bool
forall a. TAdd a => a -> Bool
scaleZero (a -> Bool) -> ((Int, a) -> a) -> (Int, a) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, a) -> a
forall a b. (a, b) -> b
snd) ([(Int, a)] -> [(Int, a)]) -> [(Int, a)] -> [(Int, a)]
forall a b. (a -> b) -> a -> b
$ IntMap a -> [(Int, a)]
forall a. IntMap a -> [(Int, a)]
I.assocs IntMap a
b)) [([Int], AnsVar a)]
l
where
l :: [([Int], AnsVar a)]
l = AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar a) -> [([Int], AnsVar a)]
forall k1 k2 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat).
(TIndex k1, TIndex k2, TAdd v) =>
AbsTensor4 n1 n2 n3 n4 k1 k2 v -> [([Int], v)]
toListShow4 AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar a)
t
toListShowVar5 :: (TIndex k1, TIndex k2, TIndex k3, TAdd a) => AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar a) -> [([Int], [(Int, a)])]
toListShowVar5 :: AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar a)
-> [([Int], [(Int, a)])]
toListShowVar5 AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar a)
t = (([Int], [(Int, a)]) -> Bool)
-> [([Int], [(Int, a)])] -> [([Int], [(Int, a)])]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool)
-> (([Int], [(Int, a)]) -> Bool) -> ([Int], [(Int, a)]) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [(Int, a)] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null ([(Int, a)] -> Bool)
-> (([Int], [(Int, a)]) -> [(Int, a)])
-> ([Int], [(Int, a)])
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [(Int, a)]) -> [(Int, a)]
forall a b. (a, b) -> b
snd) ([([Int], [(Int, a)])] -> [([Int], [(Int, a)])])
-> [([Int], [(Int, a)])] -> [([Int], [(Int, a)])]
forall a b. (a -> b) -> a -> b
$ (([Int], AnsVar a) -> ([Int], [(Int, a)]))
-> [([Int], AnsVar a)] -> [([Int], [(Int, a)])]
forall a b. (a -> b) -> [a] -> [b]
map (\([Int]
a,AnsVar IntMap a
b) -> ([Int]
a, ((Int, a) -> Bool) -> [(Int, a)] -> [(Int, a)]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool) -> ((Int, a) -> Bool) -> (Int, a) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> Bool
forall a. TAdd a => a -> Bool
scaleZero (a -> Bool) -> ((Int, a) -> a) -> (Int, a) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, a) -> a
forall a b. (a, b) -> b
snd) ([(Int, a)] -> [(Int, a)]) -> [(Int, a)] -> [(Int, a)]
forall a b. (a -> b) -> a -> b
$ IntMap a -> [(Int, a)]
forall a. IntMap a -> [(Int, a)]
I.assocs IntMap a
b)) [([Int], AnsVar a)]
l
where
l :: [([Int], AnsVar a)]
l = AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar a)
-> [([Int], AnsVar a)]
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v -> [([Int], v)]
toListShow5 AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar a)
t
toListShowVar6 :: (TIndex k1, TIndex k2, TIndex k3, TAdd a) => AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar a) -> [([Int], [(Int, a)])]
toListShowVar6 :: AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar a)
-> [([Int], [(Int, a)])]
toListShowVar6 AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar a)
t = (([Int], [(Int, a)]) -> Bool)
-> [([Int], [(Int, a)])] -> [([Int], [(Int, a)])]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool)
-> (([Int], [(Int, a)]) -> Bool) -> ([Int], [(Int, a)]) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [(Int, a)] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null ([(Int, a)] -> Bool)
-> (([Int], [(Int, a)]) -> [(Int, a)])
-> ([Int], [(Int, a)])
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [(Int, a)]) -> [(Int, a)]
forall a b. (a, b) -> b
snd) ([([Int], [(Int, a)])] -> [([Int], [(Int, a)])])
-> [([Int], [(Int, a)])] -> [([Int], [(Int, a)])]
forall a b. (a -> b) -> a -> b
$ (([Int], AnsVar a) -> ([Int], [(Int, a)]))
-> [([Int], AnsVar a)] -> [([Int], [(Int, a)])]
forall a b. (a -> b) -> [a] -> [b]
map (\([Int]
a,AnsVar IntMap a
b) -> ([Int]
a, ((Int, a) -> Bool) -> [(Int, a)] -> [(Int, a)]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool) -> ((Int, a) -> Bool) -> (Int, a) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> Bool
forall a. TAdd a => a -> Bool
scaleZero (a -> Bool) -> ((Int, a) -> a) -> (Int, a) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, a) -> a
forall a b. (a, b) -> b
snd) ([(Int, a)] -> [(Int, a)]) -> [(Int, a)] -> [(Int, a)]
forall a b. (a -> b) -> a -> b
$ IntMap a -> [(Int, a)]
forall a. IntMap a -> [(Int, a)]
I.assocs IntMap a
b)) [([Int], AnsVar a)]
l
where
l :: [([Int], AnsVar a)]
l = AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar a)
-> [([Int], AnsVar a)]
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v -> [([Int], v)]
toListShow6 AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar a)
t
toListShowVar7 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd a) => AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar a) -> [([Int], [(Int, a)])]
toListShowVar7 :: AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar a)
-> [([Int], [(Int, a)])]
toListShowVar7 AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar a)
t = (([Int], [(Int, a)]) -> Bool)
-> [([Int], [(Int, a)])] -> [([Int], [(Int, a)])]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool)
-> (([Int], [(Int, a)]) -> Bool) -> ([Int], [(Int, a)]) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [(Int, a)] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null ([(Int, a)] -> Bool)
-> (([Int], [(Int, a)]) -> [(Int, a)])
-> ([Int], [(Int, a)])
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [(Int, a)]) -> [(Int, a)]
forall a b. (a, b) -> b
snd) ([([Int], [(Int, a)])] -> [([Int], [(Int, a)])])
-> [([Int], [(Int, a)])] -> [([Int], [(Int, a)])]
forall a b. (a -> b) -> a -> b
$ (([Int], AnsVar a) -> ([Int], [(Int, a)]))
-> [([Int], AnsVar a)] -> [([Int], [(Int, a)])]
forall a b. (a -> b) -> [a] -> [b]
map (\([Int]
a,AnsVar IntMap a
b) -> ([Int]
a, ((Int, a) -> Bool) -> [(Int, a)] -> [(Int, a)]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool) -> ((Int, a) -> Bool) -> (Int, a) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> Bool
forall a. TAdd a => a -> Bool
scaleZero (a -> Bool) -> ((Int, a) -> a) -> (Int, a) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, a) -> a
forall a b. (a, b) -> b
snd) ([(Int, a)] -> [(Int, a)]) -> [(Int, a)] -> [(Int, a)]
forall a b. (a -> b) -> a -> b
$ IntMap a -> [(Int, a)]
forall a. IntMap a -> [(Int, a)]
I.assocs IntMap a
b)) [([Int], AnsVar a)]
l
where
l :: [([Int], AnsVar a)]
l = AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar a)
-> [([Int], AnsVar a)]
forall k1 k2 k3 k4 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat)
(n4 :: Nat) (n5 :: Nat) (n6 :: Nat) (n7 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) =>
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v -> [([Int], v)]
toListShow7 AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar a)
t
toListShowVar8 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd a) => AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar a) -> [([Int], [(Int, a)])]
toListShowVar8 :: AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar a)
-> [([Int], [(Int, a)])]
toListShowVar8 AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar a)
t = (([Int], [(Int, a)]) -> Bool)
-> [([Int], [(Int, a)])] -> [([Int], [(Int, a)])]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool)
-> (([Int], [(Int, a)]) -> Bool) -> ([Int], [(Int, a)]) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [(Int, a)] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null ([(Int, a)] -> Bool)
-> (([Int], [(Int, a)]) -> [(Int, a)])
-> ([Int], [(Int, a)])
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int], [(Int, a)]) -> [(Int, a)]
forall a b. (a, b) -> b
snd) ([([Int], [(Int, a)])] -> [([Int], [(Int, a)])])
-> [([Int], [(Int, a)])] -> [([Int], [(Int, a)])]
forall a b. (a -> b) -> a -> b
$ (([Int], AnsVar a) -> ([Int], [(Int, a)]))
-> [([Int], AnsVar a)] -> [([Int], [(Int, a)])]
forall a b. (a -> b) -> [a] -> [b]
map (\([Int]
a,AnsVar IntMap a
b) -> ([Int]
a, ((Int, a) -> Bool) -> [(Int, a)] -> [(Int, a)]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool) -> ((Int, a) -> Bool) -> (Int, a) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> Bool
forall a. TAdd a => a -> Bool
scaleZero (a -> Bool) -> ((Int, a) -> a) -> (Int, a) -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Int, a) -> a
forall a b. (a, b) -> b
snd) ([(Int, a)] -> [(Int, a)]) -> [(Int, a)] -> [(Int, a)]
forall a b. (a -> b) -> a -> b
$ IntMap a -> [(Int, a)]
forall a. IntMap a -> [(Int, a)]
I.assocs IntMap a
b)) [([Int], AnsVar a)]
l
where
l :: [([Int], AnsVar a)]
l = AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar a)
-> [([Int], AnsVar a)]
forall k1 k2 k3 k4 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat)
(n4 :: Nat) (n5 :: Nat) (n6 :: Nat) (n7 :: Nat) (n8 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd v) =>
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v -> [([Int], v)]
toListShow8 AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar a)
t
toMatList1' :: (TIndex k1, TAdd a) => AbsTensor1 n1 k1 (AnsVar a) -> [[(Int, a)]]
toMatList1' :: AbsTensor1 n1 k1 (AnsVar a) -> [[(Int, a)]]
toMatList1' AbsTensor1 n1 k1 (AnsVar a)
t = (([Int], [(Int, a)]) -> [(Int, a)])
-> [([Int], [(Int, a)])] -> [[(Int, a)]]
forall a b. (a -> b) -> [a] -> [b]
map ([Int], [(Int, a)]) -> [(Int, a)]
forall a b. (a, b) -> b
snd ([([Int], [(Int, a)])] -> [[(Int, a)]])
-> [([Int], [(Int, a)])] -> [[(Int, a)]]
forall a b. (a -> b) -> a -> b
$ AbsTensor1 n1 k1 (AnsVar a) -> [([Int], [(Int, a)])]
forall k1 a (n1 :: Nat).
(TIndex k1, TAdd a) =>
AbsTensor1 n1 k1 (AnsVar a) -> [([Int], [(Int, a)])]
toListShowVar1 AbsTensor1 n1 k1 (AnsVar a)
t
toMatList2' :: (TIndex k1, TAdd a) => AbsTensor2 n1 n2 k1 (AnsVar a) -> [[(Int, a)]]
toMatList2' :: AbsTensor2 n1 n2 k1 (AnsVar a) -> [[(Int, a)]]
toMatList2' AbsTensor2 n1 n2 k1 (AnsVar a)
t = (([Int], [(Int, a)]) -> [(Int, a)])
-> [([Int], [(Int, a)])] -> [[(Int, a)]]
forall a b. (a -> b) -> [a] -> [b]
map ([Int], [(Int, a)]) -> [(Int, a)]
forall a b. (a, b) -> b
snd ([([Int], [(Int, a)])] -> [[(Int, a)]])
-> [([Int], [(Int, a)])] -> [[(Int, a)]]
forall a b. (a -> b) -> a -> b
$ AbsTensor2 n1 n2 k1 (AnsVar a) -> [([Int], [(Int, a)])]
forall k1 a (n1 :: Nat) (n2 :: Nat).
(TIndex k1, TAdd a) =>
AbsTensor2 n1 n2 k1 (AnsVar a) -> [([Int], [(Int, a)])]
toListShowVar2 AbsTensor2 n1 n2 k1 (AnsVar a)
t
toMatList3' :: (TIndex k1, TIndex k2, TAdd a) => AbsTensor3 n1 n2 n3 k1 k2 (AnsVar a) -> [[(Int, a)]]
toMatList3' :: AbsTensor3 n1 n2 n3 k1 k2 (AnsVar a) -> [[(Int, a)]]
toMatList3' AbsTensor3 n1 n2 n3 k1 k2 (AnsVar a)
t = (([Int], [(Int, a)]) -> [(Int, a)])
-> [([Int], [(Int, a)])] -> [[(Int, a)]]
forall a b. (a -> b) -> [a] -> [b]
map ([Int], [(Int, a)]) -> [(Int, a)]
forall a b. (a, b) -> b
snd ([([Int], [(Int, a)])] -> [[(Int, a)]])
-> [([Int], [(Int, a)])] -> [[(Int, a)]]
forall a b. (a -> b) -> a -> b
$ AbsTensor3 n1 n2 n3 k1 k2 (AnsVar a) -> [([Int], [(Int, a)])]
forall k1 k2 a (n1 :: Nat) (n2 :: Nat) (n3 :: Nat).
(TIndex k1, TIndex k2, TAdd a) =>
AbsTensor3 n1 n2 n3 k1 k2 (AnsVar a) -> [([Int], [(Int, a)])]
toListShowVar3 AbsTensor3 n1 n2 n3 k1 k2 (AnsVar a)
t
toMatList4' :: (TIndex k1, TIndex k2, TAdd a) => AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar a) -> [[(Int, a)]]
toMatList4' :: AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar a) -> [[(Int, a)]]
toMatList4' AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar a)
t = (([Int], [(Int, a)]) -> [(Int, a)])
-> [([Int], [(Int, a)])] -> [[(Int, a)]]
forall a b. (a -> b) -> [a] -> [b]
map ([Int], [(Int, a)]) -> [(Int, a)]
forall a b. (a, b) -> b
snd ([([Int], [(Int, a)])] -> [[(Int, a)]])
-> [([Int], [(Int, a)])] -> [[(Int, a)]]
forall a b. (a -> b) -> a -> b
$ AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar a) -> [([Int], [(Int, a)])]
forall k1 k2 a (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat).
(TIndex k1, TIndex k2, TAdd a) =>
AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar a) -> [([Int], [(Int, a)])]
toListShowVar4 AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar a)
t
toMatList5' :: (TIndex k1, TIndex k2, TIndex k3, TAdd a) => AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar a) -> [[(Int, a)]]
toMatList5' :: AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar a) -> [[(Int, a)]]
toMatList5' AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar a)
t = (([Int], [(Int, a)]) -> [(Int, a)])
-> [([Int], [(Int, a)])] -> [[(Int, a)]]
forall a b. (a -> b) -> [a] -> [b]
map ([Int], [(Int, a)]) -> [(Int, a)]
forall a b. (a, b) -> b
snd ([([Int], [(Int, a)])] -> [[(Int, a)]])
-> [([Int], [(Int, a)])] -> [[(Int, a)]]
forall a b. (a -> b) -> a -> b
$ AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar a)
-> [([Int], [(Int, a)])]
forall k1 k2 k3 a (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd a) =>
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar a)
-> [([Int], [(Int, a)])]
toListShowVar5 AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar a)
t
toMatList6' :: (TIndex k1, TIndex k2, TIndex k3, TAdd a) => AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar a) -> [[(Int, a)]]
toMatList6' :: AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar a) -> [[(Int, a)]]
toMatList6' AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar a)
t = (([Int], [(Int, a)]) -> [(Int, a)])
-> [([Int], [(Int, a)])] -> [[(Int, a)]]
forall a b. (a -> b) -> [a] -> [b]
map ([Int], [(Int, a)]) -> [(Int, a)]
forall a b. (a, b) -> b
snd ([([Int], [(Int, a)])] -> [[(Int, a)]])
-> [([Int], [(Int, a)])] -> [[(Int, a)]]
forall a b. (a -> b) -> a -> b
$ AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar a)
-> [([Int], [(Int, a)])]
forall k1 k2 k3 a (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd a) =>
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar a)
-> [([Int], [(Int, a)])]
toListShowVar6 AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar a)
t
toMatList7' :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd a) => AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar a) -> [[(Int, a)]]
toMatList7' :: AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar a)
-> [[(Int, a)]]
toMatList7' AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar a)
t = (([Int], [(Int, a)]) -> [(Int, a)])
-> [([Int], [(Int, a)])] -> [[(Int, a)]]
forall a b. (a -> b) -> [a] -> [b]
map ([Int], [(Int, a)]) -> [(Int, a)]
forall a b. (a, b) -> b
snd ([([Int], [(Int, a)])] -> [[(Int, a)]])
-> [([Int], [(Int, a)])] -> [[(Int, a)]]
forall a b. (a -> b) -> a -> b
$ AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar a)
-> [([Int], [(Int, a)])]
forall k1 k2 k3 k4 a (n1 :: Nat) (n2 :: Nat) (n3 :: Nat)
(n4 :: Nat) (n5 :: Nat) (n6 :: Nat) (n7 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd a) =>
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar a)
-> [([Int], [(Int, a)])]
toListShowVar7 AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar a)
t
toMatList8' :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd a) => AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar a) -> [[(Int, a)]]
toMatList8' :: AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar a)
-> [[(Int, a)]]
toMatList8' AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar a)
t = (([Int], [(Int, a)]) -> [(Int, a)])
-> [([Int], [(Int, a)])] -> [[(Int, a)]]
forall a b. (a -> b) -> [a] -> [b]
map ([Int], [(Int, a)]) -> [(Int, a)]
forall a b. (a, b) -> b
snd ([([Int], [(Int, a)])] -> [[(Int, a)]])
-> [([Int], [(Int, a)])] -> [[(Int, a)]]
forall a b. (a -> b) -> a -> b
$ AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar a)
-> [([Int], [(Int, a)])]
forall k1 k2 k3 k4 a (n1 :: Nat) (n2 :: Nat) (n3 :: Nat)
(n4 :: Nat) (n5 :: Nat) (n6 :: Nat) (n7 :: Nat) (n8 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd a) =>
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar a)
-> [([Int], [(Int, a)])]
toListShowVar8 AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar a)
t
_normalize :: [(Int,Rational)] -> ([(Int,Rational)],Rational)
_normalize :: [(Int, Rational)] -> ([(Int, Rational)], Rational)
_normalize [] = ([],Rational
1)
_normalize ((Int
a,Rational
b) : [(Int, Rational)]
xs) = ((Int
a,Rational
1) (Int, Rational) -> [(Int, Rational)] -> [(Int, Rational)]
forall a. a -> [a] -> [a]
: ((Int, Rational) -> (Int, Rational))
-> [(Int, Rational)] -> [(Int, Rational)]
forall a b. (a -> b) -> [a] -> [b]
map (\(Int
x,Rational
y) -> (Int
x,Rational
y Rational -> Rational -> Rational
forall a. Fractional a => a -> a -> a
/ Rational
b)) [(Int, Rational)]
xs,Rational
b)
data TensList1 k1 v where
EmptyTList1 :: TensList1 k1 v
AppendTList1 :: AbsTensor1 n1 k1 v -> TensList1 k1 v -> TensList1 k1 v
data TensList2 k1 v where
EmptyTList2 :: TensList2 k1 v
AppendTList2 :: AbsTensor2 n1 n2 k1 v -> TensList2 k1 v -> TensList2 k1 v
data TensList3 k1 k2 v where
EmptyTList3 :: TensList3 k1 k2 v
AppendTList3 :: AbsTensor3 n1 n2 n3 k1 k2 v -> TensList3 k1 k2 v -> TensList3 k1 k2 v
data TensList4 k1 k2 v where
EmptyTList4 :: TensList4 k1 k2 v
AppendTList4 :: AbsTensor4 n1 n2 n3 n4 k1 k2 v -> TensList4 k1 k2 v -> TensList4 k1 k2 v
data TensList5 k1 k2 k3 v where
EmptyTList5 :: TensList5 k1 k2 k3 v
AppendTList5 :: AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v -> TensList5 k1 k2 k3 v -> TensList5 k1 k2 k3 v
data TensList6 k1 k2 k3 v where
EmptyTList6 :: TensList6 k1 k2 k3 v
AppendTList6 :: AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v -> TensList6 k1 k2 k3 v -> TensList6 k1 k2 k3 v
data TensList7 k1 k2 k3 k4 v where
EmptyTList7 :: TensList7 k1 k2 k3 k4 v
AppendTList7 :: AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v -> TensList7 k1 k2 k3 k4 v -> TensList7 k1 k2 k3 k4 v
data TensList8 k1 k2 k3 k4 v where
EmptyTList8 :: TensList8 k1 k2 k3 k4 v
AppendTList8 :: AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v -> TensList8 k1 k2 k3 k4 v -> TensList8 k1 k2 k3 k4 v
mapTensList1 :: (forall n1. AbsTensor1 n1 k1 v -> b ) -> TensList1 k1 v -> [b]
mapTensList1 :: (forall (n1 :: Nat). AbsTensor1 n1 k1 v -> b)
-> TensList1 k1 v -> [b]
mapTensList1 forall (n1 :: Nat). AbsTensor1 n1 k1 v -> b
_ TensList1 k1 v
EmptyTList1 = []
mapTensList1 forall (n1 :: Nat). AbsTensor1 n1 k1 v -> b
f (AppendTList1 AbsTensor1 n1 k1 v
t TensList1 k1 v
l) = AbsTensor1 n1 k1 v -> b
forall (n1 :: Nat). AbsTensor1 n1 k1 v -> b
f AbsTensor1 n1 k1 v
t b -> [b] -> [b]
forall a. a -> [a] -> [a]
: (forall (n1 :: Nat). AbsTensor1 n1 k1 v -> b)
-> TensList1 k1 v -> [b]
forall k1 v b.
(forall (n1 :: Nat). AbsTensor1 n1 k1 v -> b)
-> TensList1 k1 v -> [b]
mapTensList1 forall (n1 :: Nat). AbsTensor1 n1 k1 v -> b
f TensList1 k1 v
l
mapTensList2 :: (forall n1 n2. AbsTensor2 n1 n2 k1 v -> b ) -> TensList2 k1 v -> [b]
mapTensList2 :: (forall (n1 :: Nat) (n2 :: Nat). AbsTensor2 n1 n2 k1 v -> b)
-> TensList2 k1 v -> [b]
mapTensList2 forall (n1 :: Nat) (n2 :: Nat). AbsTensor2 n1 n2 k1 v -> b
_ TensList2 k1 v
EmptyTList2 = []
mapTensList2 forall (n1 :: Nat) (n2 :: Nat). AbsTensor2 n1 n2 k1 v -> b
f (AppendTList2 AbsTensor2 n1 n2 k1 v
t TensList2 k1 v
l) = AbsTensor2 n1 n2 k1 v -> b
forall (n1 :: Nat) (n2 :: Nat). AbsTensor2 n1 n2 k1 v -> b
f AbsTensor2 n1 n2 k1 v
t b -> [b] -> [b]
forall a. a -> [a] -> [a]
: (forall (n1 :: Nat) (n2 :: Nat). AbsTensor2 n1 n2 k1 v -> b)
-> TensList2 k1 v -> [b]
forall k1 v b.
(forall (n1 :: Nat) (n2 :: Nat). AbsTensor2 n1 n2 k1 v -> b)
-> TensList2 k1 v -> [b]
mapTensList2 forall (n1 :: Nat) (n2 :: Nat). AbsTensor2 n1 n2 k1 v -> b
f TensList2 k1 v
l
mapTensList3 :: (forall n1 n2 n3. AbsTensor3 n1 n2 n3 k1 k2 v -> b ) -> TensList3 k1 k2 v -> [b]
mapTensList3 :: (forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat).
AbsTensor3 n1 n2 n3 k1 k2 v -> b)
-> TensList3 k1 k2 v -> [b]
mapTensList3 forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat).
AbsTensor3 n1 n2 n3 k1 k2 v -> b
_ TensList3 k1 k2 v
EmptyTList3 = []
mapTensList3 forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat).
AbsTensor3 n1 n2 n3 k1 k2 v -> b
f (AppendTList3 AbsTensor3 n1 n2 n3 k1 k2 v
t TensList3 k1 k2 v
l) = AbsTensor3 n1 n2 n3 k1 k2 v -> b
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat).
AbsTensor3 n1 n2 n3 k1 k2 v -> b
f AbsTensor3 n1 n2 n3 k1 k2 v
t b -> [b] -> [b]
forall a. a -> [a] -> [a]
: (forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat).
AbsTensor3 n1 n2 n3 k1 k2 v -> b)
-> TensList3 k1 k2 v -> [b]
forall k1 k2 v b.
(forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat).
AbsTensor3 n1 n2 n3 k1 k2 v -> b)
-> TensList3 k1 k2 v -> [b]
mapTensList3 forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat).
AbsTensor3 n1 n2 n3 k1 k2 v -> b
f TensList3 k1 k2 v
l
mapTensList4 :: (forall n1 n2 n3 n4. AbsTensor4 n1 n2 n3 n4 k1 k2 v -> b ) -> TensList4 k1 k2 v -> [b]
mapTensList4 :: (forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat).
AbsTensor4 n1 n2 n3 n4 k1 k2 v -> b)
-> TensList4 k1 k2 v -> [b]
mapTensList4 forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat).
AbsTensor4 n1 n2 n3 n4 k1 k2 v -> b
_ TensList4 k1 k2 v
EmptyTList4 = []
mapTensList4 forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat).
AbsTensor4 n1 n2 n3 n4 k1 k2 v -> b
f (AppendTList4 AbsTensor4 n1 n2 n3 n4 k1 k2 v
t TensList4 k1 k2 v
l) = AbsTensor4 n1 n2 n3 n4 k1 k2 v -> b
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat).
AbsTensor4 n1 n2 n3 n4 k1 k2 v -> b
f AbsTensor4 n1 n2 n3 n4 k1 k2 v
t b -> [b] -> [b]
forall a. a -> [a] -> [a]
: (forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat).
AbsTensor4 n1 n2 n3 n4 k1 k2 v -> b)
-> TensList4 k1 k2 v -> [b]
forall k1 k2 v b.
(forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat).
AbsTensor4 n1 n2 n3 n4 k1 k2 v -> b)
-> TensList4 k1 k2 v -> [b]
mapTensList4 forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat).
AbsTensor4 n1 n2 n3 n4 k1 k2 v -> b
f TensList4 k1 k2 v
l
mapTensList5 :: (forall n1 n2 n3 n4 n5. AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v -> b ) -> TensList5 k1 k2 k3 v -> [b]
mapTensList5 :: (forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat).
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v -> b)
-> TensList5 k1 k2 k3 v -> [b]
mapTensList5 forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat).
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v -> b
_ TensList5 k1 k2 k3 v
EmptyTList5 = []
mapTensList5 forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat).
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v -> b
f (AppendTList5 AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
t TensList5 k1 k2 k3 v
l) = AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v -> b
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat).
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v -> b
f AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
t b -> [b] -> [b]
forall a. a -> [a] -> [a]
: (forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat).
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v -> b)
-> TensList5 k1 k2 k3 v -> [b]
forall k1 k2 k3 v b.
(forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat).
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v -> b)
-> TensList5 k1 k2 k3 v -> [b]
mapTensList5 forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat).
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v -> b
f TensList5 k1 k2 k3 v
l
mapTensList6 :: (forall n1 n2 n3 n4 n5 n6. AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v -> b ) -> TensList6 k1 k2 k3 v -> [b]
mapTensList6 :: (forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat).
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v -> b)
-> TensList6 k1 k2 k3 v -> [b]
mapTensList6 forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat).
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v -> b
_ TensList6 k1 k2 k3 v
EmptyTList6 = []
mapTensList6 forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat).
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v -> b
f (AppendTList6 AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
t TensList6 k1 k2 k3 v
l) = AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v -> b
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat).
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v -> b
f AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
t b -> [b] -> [b]
forall a. a -> [a] -> [a]
: (forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat).
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v -> b)
-> TensList6 k1 k2 k3 v -> [b]
forall k1 k2 k3 v b.
(forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat).
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v -> b)
-> TensList6 k1 k2 k3 v -> [b]
mapTensList6 forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat).
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v -> b
f TensList6 k1 k2 k3 v
l
mapTensList7 :: (forall n1 n2 n3 n4 n5 n6 n7. AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v -> b ) -> TensList7 k1 k2 k3 k4 v -> [b]
mapTensList7 :: (forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat).
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v -> b)
-> TensList7 k1 k2 k3 k4 v -> [b]
mapTensList7 forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat).
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v -> b
_ TensList7 k1 k2 k3 k4 v
EmptyTList7 = []
mapTensList7 forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat).
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v -> b
f (AppendTList7 AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
t TensList7 k1 k2 k3 k4 v
l) = AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v -> b
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat).
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v -> b
f AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
t b -> [b] -> [b]
forall a. a -> [a] -> [a]
: (forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat).
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v -> b)
-> TensList7 k1 k2 k3 k4 v -> [b]
forall k1 k2 k3 k4 v b.
(forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat).
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v -> b)
-> TensList7 k1 k2 k3 k4 v -> [b]
mapTensList7 forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat).
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v -> b
f TensList7 k1 k2 k3 k4 v
l
mapTensList8 :: (forall n1 n2 n3 n4 n5 n6 n7 n8. AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v -> b ) -> TensList8 k1 k2 k3 k4 v -> [b]
mapTensList8 :: (forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat) (n8 :: Nat).
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v -> b)
-> TensList8 k1 k2 k3 k4 v -> [b]
mapTensList8 forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat) (n8 :: Nat).
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v -> b
_ TensList8 k1 k2 k3 k4 v
EmptyTList8 = []
mapTensList8 forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat) (n8 :: Nat).
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v -> b
f (AppendTList8 AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
t TensList8 k1 k2 k3 k4 v
l) = AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v -> b
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat) (n8 :: Nat).
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v -> b
f AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
t b -> [b] -> [b]
forall a. a -> [a] -> [a]
: (forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat) (n8 :: Nat).
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v -> b)
-> TensList8 k1 k2 k3 k4 v -> [b]
forall k1 k2 k3 k4 v b.
(forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat) (n8 :: Nat).
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v -> b)
-> TensList8 k1 k2 k3 k4 v -> [b]
mapTensList8 forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat) (n8 :: Nat).
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v -> b
f TensList8 k1 k2 k3 k4 v
l
infixr 5 ...>
(...>) :: AbsTensor1 n1 k1 v -> TensList1 k1 v -> TensList1 k1 v
...> :: AbsTensor1 n1 k1 v -> TensList1 k1 v -> TensList1 k1 v
(...>) = AbsTensor1 n1 k1 v -> TensList1 k1 v -> TensList1 k1 v
forall (n1 :: Nat) k1 v.
AbsTensor1 n1 k1 v -> TensList1 k1 v -> TensList1 k1 v
AppendTList1
singletonTList1 :: AbsTensor1 n1 k1 v -> TensList1 k1 v
singletonTList1 :: AbsTensor1 n1 k1 v -> TensList1 k1 v
singletonTList1 AbsTensor1 n1 k1 v
t = AbsTensor1 n1 k1 v
t AbsTensor1 n1 k1 v -> TensList1 k1 v -> TensList1 k1 v
forall (n1 :: Nat) k1 v.
AbsTensor1 n1 k1 v -> TensList1 k1 v -> TensList1 k1 v
...> TensList1 k1 v
forall k1 v. TensList1 k1 v
EmptyTList1
infixr 5 ...+
(...+) :: TensList1 k1 v -> TensList1 k1 v -> TensList1 k1 v
...+ :: TensList1 k1 v -> TensList1 k1 v -> TensList1 k1 v
(...+) TensList1 k1 v
EmptyTList1 TensList1 k1 v
t1 = TensList1 k1 v
t1
(...+) TensList1 k1 v
t1 TensList1 k1 v
EmptyTList1 = TensList1 k1 v
t1
(...+) (AppendTList1 AbsTensor1 n1 k1 v
t1 TensList1 k1 v
EmptyTList1) TensList1 k1 v
t2 = AbsTensor1 n1 k1 v -> TensList1 k1 v -> TensList1 k1 v
forall (n1 :: Nat) k1 v.
AbsTensor1 n1 k1 v -> TensList1 k1 v -> TensList1 k1 v
AppendTList1 AbsTensor1 n1 k1 v
t1 TensList1 k1 v
t2
(...+) (AppendTList1 AbsTensor1 n1 k1 v
t1 TensList1 k1 v
t1') TensList1 k1 v
t2 = AbsTensor1 n1 k1 v -> TensList1 k1 v -> TensList1 k1 v
forall (n1 :: Nat) k1 v.
AbsTensor1 n1 k1 v -> TensList1 k1 v -> TensList1 k1 v
AppendTList1 AbsTensor1 n1 k1 v
t1 (TensList1 k1 v
t1' TensList1 k1 v -> TensList1 k1 v -> TensList1 k1 v
forall k1 v. TensList1 k1 v -> TensList1 k1 v -> TensList1 k1 v
...+ TensList1 k1 v
t2)
infixr 5 ..&>
(..&>) :: AbsTensor2 n1 n2 k1 v -> TensList2 k1 v -> TensList2 k1 v
..&> :: AbsTensor2 n1 n2 k1 v -> TensList2 k1 v -> TensList2 k1 v
(..&>) = AbsTensor2 n1 n2 k1 v -> TensList2 k1 v -> TensList2 k1 v
forall (n1 :: Nat) (n2 :: Nat) k1 v.
AbsTensor2 n1 n2 k1 v -> TensList2 k1 v -> TensList2 k1 v
AppendTList2
singletonTList2 :: AbsTensor2 n1 n2 k1 v -> TensList2 k1 v
singletonTList2 :: AbsTensor2 n1 n2 k1 v -> TensList2 k1 v
singletonTList2 AbsTensor2 n1 n2 k1 v
t = AbsTensor2 n1 n2 k1 v
t AbsTensor2 n1 n2 k1 v -> TensList2 k1 v -> TensList2 k1 v
forall (n1 :: Nat) (n2 :: Nat) k1 v.
AbsTensor2 n1 n2 k1 v -> TensList2 k1 v -> TensList2 k1 v
..&> TensList2 k1 v
forall k1 v. TensList2 k1 v
EmptyTList2
infixr 5 ..&+
(..&+) :: TensList2 k1 v -> TensList2 k1 v -> TensList2 k1 v
..&+ :: TensList2 k1 v -> TensList2 k1 v -> TensList2 k1 v
(..&+) TensList2 k1 v
EmptyTList2 TensList2 k1 v
t1 = TensList2 k1 v
t1
(..&+) TensList2 k1 v
t1 TensList2 k1 v
EmptyTList2 = TensList2 k1 v
t1
(..&+) (AppendTList2 AbsTensor2 n1 n2 k1 v
t1 TensList2 k1 v
EmptyTList2) TensList2 k1 v
t2 = AbsTensor2 n1 n2 k1 v -> TensList2 k1 v -> TensList2 k1 v
forall (n1 :: Nat) (n2 :: Nat) k1 v.
AbsTensor2 n1 n2 k1 v -> TensList2 k1 v -> TensList2 k1 v
AppendTList2 AbsTensor2 n1 n2 k1 v
t1 TensList2 k1 v
t2
(..&+) (AppendTList2 AbsTensor2 n1 n2 k1 v
t1 TensList2 k1 v
t1') TensList2 k1 v
t2 = AbsTensor2 n1 n2 k1 v -> TensList2 k1 v -> TensList2 k1 v
forall (n1 :: Nat) (n2 :: Nat) k1 v.
AbsTensor2 n1 n2 k1 v -> TensList2 k1 v -> TensList2 k1 v
AppendTList2 AbsTensor2 n1 n2 k1 v
t1 (TensList2 k1 v
t1' TensList2 k1 v -> TensList2 k1 v -> TensList2 k1 v
forall k1 v. TensList2 k1 v -> TensList2 k1 v -> TensList2 k1 v
..&+ TensList2 k1 v
t2)
infixr 5 .&.>
(.&.>) :: AbsTensor3 n1 n2 n3 k1 k2 v -> TensList3 k1 k2 v -> TensList3 k1 k2 v
.&.> :: AbsTensor3 n1 n2 n3 k1 k2 v
-> TensList3 k1 k2 v -> TensList3 k1 k2 v
(.&.>) = AbsTensor3 n1 n2 n3 k1 k2 v
-> TensList3 k1 k2 v -> TensList3 k1 k2 v
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2 v.
AbsTensor3 n1 n2 n3 k1 k2 v
-> TensList3 k1 k2 v -> TensList3 k1 k2 v
AppendTList3
singletonTList3 :: AbsTensor3 n1 n2 n3 k1 k2 v -> TensList3 k1 k2 v
singletonTList3 :: AbsTensor3 n1 n2 n3 k1 k2 v -> TensList3 k1 k2 v
singletonTList3 AbsTensor3 n1 n2 n3 k1 k2 v
t = AbsTensor3 n1 n2 n3 k1 k2 v
t AbsTensor3 n1 n2 n3 k1 k2 v
-> TensList3 k1 k2 v -> TensList3 k1 k2 v
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2 v.
AbsTensor3 n1 n2 n3 k1 k2 v
-> TensList3 k1 k2 v -> TensList3 k1 k2 v
.&.> TensList3 k1 k2 v
forall k1 k2 v. TensList3 k1 k2 v
EmptyTList3
infixr 5 .&.+
(.&.+) :: TensList3 k1 k2 v -> TensList3 k1 k2 v -> TensList3 k1 k2 v
.&.+ :: TensList3 k1 k2 v -> TensList3 k1 k2 v -> TensList3 k1 k2 v
(.&.+) TensList3 k1 k2 v
EmptyTList3 TensList3 k1 k2 v
t1 = TensList3 k1 k2 v
t1
(.&.+) TensList3 k1 k2 v
t1 TensList3 k1 k2 v
EmptyTList3 = TensList3 k1 k2 v
t1
(.&.+) (AppendTList3 AbsTensor3 n1 n2 n3 k1 k2 v
t1 TensList3 k1 k2 v
EmptyTList3) TensList3 k1 k2 v
t2 = AbsTensor3 n1 n2 n3 k1 k2 v
-> TensList3 k1 k2 v -> TensList3 k1 k2 v
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2 v.
AbsTensor3 n1 n2 n3 k1 k2 v
-> TensList3 k1 k2 v -> TensList3 k1 k2 v
AppendTList3 AbsTensor3 n1 n2 n3 k1 k2 v
t1 TensList3 k1 k2 v
t2
(.&.+) (AppendTList3 AbsTensor3 n1 n2 n3 k1 k2 v
t1 TensList3 k1 k2 v
t1') TensList3 k1 k2 v
t2 = AbsTensor3 n1 n2 n3 k1 k2 v
-> TensList3 k1 k2 v -> TensList3 k1 k2 v
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2 v.
AbsTensor3 n1 n2 n3 k1 k2 v
-> TensList3 k1 k2 v -> TensList3 k1 k2 v
AppendTList3 AbsTensor3 n1 n2 n3 k1 k2 v
t1 (TensList3 k1 k2 v
t1' TensList3 k1 k2 v -> TensList3 k1 k2 v -> TensList3 k1 k2 v
forall k1 k2 v.
TensList3 k1 k2 v -> TensList3 k1 k2 v -> TensList3 k1 k2 v
.&.+ TensList3 k1 k2 v
t2)
infixr 5 .&&>
(.&&>) :: AbsTensor4 n1 n2 n3 n4 k1 k2 v -> TensList4 k1 k2 v -> TensList4 k1 k2 v
.&&> :: AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> TensList4 k1 k2 v -> TensList4 k1 k2 v
(.&&>) = AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> TensList4 k1 k2 v -> TensList4 k1 k2 v
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2 v.
AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> TensList4 k1 k2 v -> TensList4 k1 k2 v
AppendTList4
singletonTList4 :: AbsTensor4 n1 n2 n3 n4 k1 k2 v -> TensList4 k1 k2 v
singletonTList4 :: AbsTensor4 n1 n2 n3 n4 k1 k2 v -> TensList4 k1 k2 v
singletonTList4 AbsTensor4 n1 n2 n3 n4 k1 k2 v
t = AbsTensor4 n1 n2 n3 n4 k1 k2 v
t AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> TensList4 k1 k2 v -> TensList4 k1 k2 v
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2 v.
AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> TensList4 k1 k2 v -> TensList4 k1 k2 v
.&&> TensList4 k1 k2 v
forall k1 k2 v. TensList4 k1 k2 v
EmptyTList4
infixr 5 .&&+
(.&&+) :: TensList4 k1 k2 v -> TensList4 k1 k2 v -> TensList4 k1 k2 v
.&&+ :: TensList4 k1 k2 v -> TensList4 k1 k2 v -> TensList4 k1 k2 v
(.&&+) TensList4 k1 k2 v
EmptyTList4 TensList4 k1 k2 v
t1 = TensList4 k1 k2 v
t1
(.&&+) TensList4 k1 k2 v
t1 TensList4 k1 k2 v
EmptyTList4 = TensList4 k1 k2 v
t1
(.&&+) (AppendTList4 AbsTensor4 n1 n2 n3 n4 k1 k2 v
t1 TensList4 k1 k2 v
EmptyTList4) TensList4 k1 k2 v
t2 = AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> TensList4 k1 k2 v -> TensList4 k1 k2 v
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2 v.
AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> TensList4 k1 k2 v -> TensList4 k1 k2 v
AppendTList4 AbsTensor4 n1 n2 n3 n4 k1 k2 v
t1 TensList4 k1 k2 v
t2
(.&&+) (AppendTList4 AbsTensor4 n1 n2 n3 n4 k1 k2 v
t1 TensList4 k1 k2 v
t1') TensList4 k1 k2 v
t2 = AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> TensList4 k1 k2 v -> TensList4 k1 k2 v
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2 v.
AbsTensor4 n1 n2 n3 n4 k1 k2 v
-> TensList4 k1 k2 v -> TensList4 k1 k2 v
AppendTList4 AbsTensor4 n1 n2 n3 n4 k1 k2 v
t1 (TensList4 k1 k2 v
t1' TensList4 k1 k2 v -> TensList4 k1 k2 v -> TensList4 k1 k2 v
forall k1 k2 v.
TensList4 k1 k2 v -> TensList4 k1 k2 v -> TensList4 k1 k2 v
.&&+ TensList4 k1 k2 v
t2)
infixr 5 &..>
(&..>) :: AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v -> TensList5 k1 k2 k3 v -> TensList5 k1 k2 k3 v
&..> :: AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> TensList5 k1 k2 k3 v -> TensList5 k1 k2 k3 v
(&..>) = AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> TensList5 k1 k2 k3 v -> TensList5 k1 k2 k3 v
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
k1 k2 k3 v.
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> TensList5 k1 k2 k3 v -> TensList5 k1 k2 k3 v
AppendTList5
singletonTList5 :: AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v -> TensList5 k1 k2 k3 v
singletonTList5 :: AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v -> TensList5 k1 k2 k3 v
singletonTList5 AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
t = AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
t AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> TensList5 k1 k2 k3 v -> TensList5 k1 k2 k3 v
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
k1 k2 k3 v.
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> TensList5 k1 k2 k3 v -> TensList5 k1 k2 k3 v
&..> TensList5 k1 k2 k3 v
forall k1 k2 k3 v. TensList5 k1 k2 k3 v
EmptyTList5
infixr 5 &..+
(&..+) :: TensList5 k1 k2 k3 v -> TensList5 k1 k2 k3 v -> TensList5 k1 k2 k3 v
&..+ :: TensList5 k1 k2 k3 v
-> TensList5 k1 k2 k3 v -> TensList5 k1 k2 k3 v
(&..+) TensList5 k1 k2 k3 v
EmptyTList5 TensList5 k1 k2 k3 v
t1 = TensList5 k1 k2 k3 v
t1
(&..+) TensList5 k1 k2 k3 v
t1 TensList5 k1 k2 k3 v
EmptyTList5 = TensList5 k1 k2 k3 v
t1
(&..+) (AppendTList5 AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
t1 TensList5 k1 k2 k3 v
EmptyTList5) TensList5 k1 k2 k3 v
t2 = AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> TensList5 k1 k2 k3 v -> TensList5 k1 k2 k3 v
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
k1 k2 k3 v.
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> TensList5 k1 k2 k3 v -> TensList5 k1 k2 k3 v
AppendTList5 AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
t1 TensList5 k1 k2 k3 v
t2
(&..+) (AppendTList5 AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
t1 TensList5 k1 k2 k3 v
t1') TensList5 k1 k2 k3 v
t2 = AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> TensList5 k1 k2 k3 v -> TensList5 k1 k2 k3 v
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
k1 k2 k3 v.
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> TensList5 k1 k2 k3 v -> TensList5 k1 k2 k3 v
AppendTList5 AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
t1 (TensList5 k1 k2 k3 v
t1' TensList5 k1 k2 k3 v
-> TensList5 k1 k2 k3 v -> TensList5 k1 k2 k3 v
forall k1 k2 k3 v.
TensList5 k1 k2 k3 v
-> TensList5 k1 k2 k3 v -> TensList5 k1 k2 k3 v
&..+ TensList5 k1 k2 k3 v
t2)
infixr 5 &.&>
(&.&>) :: AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v -> TensList6 k1 k2 k3 v -> TensList6 k1 k2 k3 v
&.&> :: AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> TensList6 k1 k2 k3 v -> TensList6 k1 k2 k3 v
(&.&>) = AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> TensList6 k1 k2 k3 v -> TensList6 k1 k2 k3 v
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) k1 k2 k3 v.
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> TensList6 k1 k2 k3 v -> TensList6 k1 k2 k3 v
AppendTList6
singletonTList6 :: AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v -> TensList6 k1 k2 k3 v
singletonTList6 :: AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v -> TensList6 k1 k2 k3 v
singletonTList6 AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
t = AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
t AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> TensList6 k1 k2 k3 v -> TensList6 k1 k2 k3 v
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) k1 k2 k3 v.
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> TensList6 k1 k2 k3 v -> TensList6 k1 k2 k3 v
&.&> TensList6 k1 k2 k3 v
forall k1 k2 k3 v. TensList6 k1 k2 k3 v
EmptyTList6
infixr 5 &.&+
(&.&+) :: TensList6 k1 k2 k3 v -> TensList6 k1 k2 k3 v -> TensList6 k1 k2 k3 v
&.&+ :: TensList6 k1 k2 k3 v
-> TensList6 k1 k2 k3 v -> TensList6 k1 k2 k3 v
(&.&+) TensList6 k1 k2 k3 v
EmptyTList6 TensList6 k1 k2 k3 v
t1 = TensList6 k1 k2 k3 v
t1
(&.&+) TensList6 k1 k2 k3 v
t1 TensList6 k1 k2 k3 v
EmptyTList6 = TensList6 k1 k2 k3 v
t1
(&.&+) (AppendTList6 AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
t1 TensList6 k1 k2 k3 v
EmptyTList6) TensList6 k1 k2 k3 v
t2 = AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> TensList6 k1 k2 k3 v -> TensList6 k1 k2 k3 v
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) k1 k2 k3 v.
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> TensList6 k1 k2 k3 v -> TensList6 k1 k2 k3 v
AppendTList6 AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
t1 TensList6 k1 k2 k3 v
t2
(&.&+) (AppendTList6 AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
t1 TensList6 k1 k2 k3 v
t1') TensList6 k1 k2 k3 v
t2 = AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> TensList6 k1 k2 k3 v -> TensList6 k1 k2 k3 v
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) k1 k2 k3 v.
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> TensList6 k1 k2 k3 v -> TensList6 k1 k2 k3 v
AppendTList6 AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
t1 (TensList6 k1 k2 k3 v
t1' TensList6 k1 k2 k3 v
-> TensList6 k1 k2 k3 v -> TensList6 k1 k2 k3 v
forall k1 k2 k3 v.
TensList6 k1 k2 k3 v
-> TensList6 k1 k2 k3 v -> TensList6 k1 k2 k3 v
&.&+ TensList6 k1 k2 k3 v
t2)
infixr 5 &&.>
(&&.>) :: AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v -> TensList7 k1 k2 k3 k4 v -> TensList7 k1 k2 k3 k4 v
&&.> :: AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> TensList7 k1 k2 k3 k4 v -> TensList7 k1 k2 k3 k4 v
(&&.>) = AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> TensList7 k1 k2 k3 k4 v -> TensList7 k1 k2 k3 k4 v
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat) k1 k2 k3 k4 v.
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> TensList7 k1 k2 k3 k4 v -> TensList7 k1 k2 k3 k4 v
AppendTList7
singletonTList7 :: AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v -> TensList7 k1 k2 k3 k4 v
singletonTList7 :: AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> TensList7 k1 k2 k3 k4 v
singletonTList7 AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
t = AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
t AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> TensList7 k1 k2 k3 k4 v -> TensList7 k1 k2 k3 k4 v
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat) k1 k2 k3 k4 v.
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> TensList7 k1 k2 k3 k4 v -> TensList7 k1 k2 k3 k4 v
&&.> TensList7 k1 k2 k3 k4 v
forall k1 k2 k3 k4 v. TensList7 k1 k2 k3 k4 v
EmptyTList7
infixr 5 &&.+
(&&.+) :: TensList7 k1 k2 k3 k4 v -> TensList7 k1 k2 k3 k4 v -> TensList7 k1 k2 k3 k4 v
&&.+ :: TensList7 k1 k2 k3 k4 v
-> TensList7 k1 k2 k3 k4 v -> TensList7 k1 k2 k3 k4 v
(&&.+) TensList7 k1 k2 k3 k4 v
EmptyTList7 TensList7 k1 k2 k3 k4 v
t1 = TensList7 k1 k2 k3 k4 v
t1
(&&.+) TensList7 k1 k2 k3 k4 v
t1 TensList7 k1 k2 k3 k4 v
EmptyTList7 = TensList7 k1 k2 k3 k4 v
t1
(&&.+) (AppendTList7 AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
t1 TensList7 k1 k2 k3 k4 v
EmptyTList7) TensList7 k1 k2 k3 k4 v
t2 = AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> TensList7 k1 k2 k3 k4 v -> TensList7 k1 k2 k3 k4 v
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat) k1 k2 k3 k4 v.
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> TensList7 k1 k2 k3 k4 v -> TensList7 k1 k2 k3 k4 v
AppendTList7 AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
t1 TensList7 k1 k2 k3 k4 v
t2
(&&.+) (AppendTList7 AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
t1 TensList7 k1 k2 k3 k4 v
t1') TensList7 k1 k2 k3 k4 v
t2 = AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> TensList7 k1 k2 k3 k4 v -> TensList7 k1 k2 k3 k4 v
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat) k1 k2 k3 k4 v.
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> TensList7 k1 k2 k3 k4 v -> TensList7 k1 k2 k3 k4 v
AppendTList7 AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
t1 (TensList7 k1 k2 k3 k4 v
t1' TensList7 k1 k2 k3 k4 v
-> TensList7 k1 k2 k3 k4 v -> TensList7 k1 k2 k3 k4 v
forall k1 k2 k3 k4 v.
TensList7 k1 k2 k3 k4 v
-> TensList7 k1 k2 k3 k4 v -> TensList7 k1 k2 k3 k4 v
&&.+ TensList7 k1 k2 k3 k4 v
t2)
infixr 5 &&&>
(&&&>) :: AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v -> TensList8 k1 k2 k3 k4 v -> TensList8 k1 k2 k3 k4 v
&&&> :: AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> TensList8 k1 k2 k3 k4 v -> TensList8 k1 k2 k3 k4 v
(&&&>) = AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> TensList8 k1 k2 k3 k4 v -> TensList8 k1 k2 k3 k4 v
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat) (n8 :: Nat) k1 k2 k3 k4 v.
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> TensList8 k1 k2 k3 k4 v -> TensList8 k1 k2 k3 k4 v
AppendTList8
singletonTList8 :: AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v -> TensList8 k1 k2 k3 k4 v
singletonTList8 :: AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> TensList8 k1 k2 k3 k4 v
singletonTList8 AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
t = AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
t AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> TensList8 k1 k2 k3 k4 v -> TensList8 k1 k2 k3 k4 v
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat) (n8 :: Nat) k1 k2 k3 k4 v.
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> TensList8 k1 k2 k3 k4 v -> TensList8 k1 k2 k3 k4 v
&&&> TensList8 k1 k2 k3 k4 v
forall k1 k2 k3 k4 v. TensList8 k1 k2 k3 k4 v
EmptyTList8
infixr 5 &&&+
(&&&+) :: TensList8 k1 k2 k3 k4 v -> TensList8 k1 k2 k3 k4 v -> TensList8 k1 k2 k3 k4 v
&&&+ :: TensList8 k1 k2 k3 k4 v
-> TensList8 k1 k2 k3 k4 v -> TensList8 k1 k2 k3 k4 v
(&&&+) TensList8 k1 k2 k3 k4 v
EmptyTList8 TensList8 k1 k2 k3 k4 v
t1 = TensList8 k1 k2 k3 k4 v
t1
(&&&+) TensList8 k1 k2 k3 k4 v
t1 TensList8 k1 k2 k3 k4 v
EmptyTList8 = TensList8 k1 k2 k3 k4 v
t1
(&&&+) (AppendTList8 AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
t1 TensList8 k1 k2 k3 k4 v
EmptyTList8) TensList8 k1 k2 k3 k4 v
t2 = AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> TensList8 k1 k2 k3 k4 v -> TensList8 k1 k2 k3 k4 v
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat) (n8 :: Nat) k1 k2 k3 k4 v.
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> TensList8 k1 k2 k3 k4 v -> TensList8 k1 k2 k3 k4 v
AppendTList8 AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
t1 TensList8 k1 k2 k3 k4 v
t2
(&&&+) (AppendTList8 AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
t1 TensList8 k1 k2 k3 k4 v
t1') TensList8 k1 k2 k3 k4 v
t2 = AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> TensList8 k1 k2 k3 k4 v -> TensList8 k1 k2 k3 k4 v
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat) (n8 :: Nat) k1 k2 k3 k4 v.
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> TensList8 k1 k2 k3 k4 v -> TensList8 k1 k2 k3 k4 v
AppendTList8 AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
t1 (TensList8 k1 k2 k3 k4 v
t1' TensList8 k1 k2 k3 k4 v
-> TensList8 k1 k2 k3 k4 v -> TensList8 k1 k2 k3 k4 v
forall k1 k2 k3 k4 v.
TensList8 k1 k2 k3 k4 v
-> TensList8 k1 k2 k3 k4 v -> TensList8 k1 k2 k3 k4 v
&&&+ TensList8 k1 k2 k3 k4 v
t2)
collectMatList :: [[(Int, a)]] -> [((Int, Int), a)]
collectMatList :: [[(Int, a)]] -> [((Int, Int), a)]
collectMatList [[(Int, a)]]
matList = [((Int, Int), a)]
l
where
l :: [((Int, Int), a)]
l = [[((Int, Int), a)]] -> [((Int, Int), a)]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[((Int, Int), a)]] -> [((Int, Int), a)])
-> [[((Int, Int), a)]] -> [((Int, Int), a)]
forall a b. (a -> b) -> a -> b
$ ([(Int, a)] -> Int -> [((Int, Int), a)])
-> [[(Int, a)]] -> [Int] -> [[((Int, Int), a)]]
forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith (\[(Int, a)]
r Int
z -> ((Int, a) -> ((Int, Int), a)) -> [(Int, a)] -> [((Int, Int), a)]
forall a b. (a -> b) -> [a] -> [b]
map (\(Int
x,a
y) -> ((Int
z, Int
x), a
y)) [(Int, a)]
r) [[(Int, a)]]
matList [Int
1..]
toMatListT1 :: (TIndex k1, TAdd a) => TensList1 k1 (AnsVar a) -> [((Int,Int),a)]
toMatListT1 :: TensList1 k1 (AnsVar a) -> [((Int, Int), a)]
toMatListT1 TensList1 k1 (AnsVar a)
t = [[(Int, a)]] -> [((Int, Int), a)]
forall a. [[(Int, a)]] -> [((Int, Int), a)]
collectMatList [[(Int, a)]]
matList
where
matList :: [[(Int, a)]]
matList = [[[(Int, a)]]] -> [[(Int, a)]]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[[(Int, a)]]] -> [[(Int, a)]]) -> [[[(Int, a)]]] -> [[(Int, a)]]
forall a b. (a -> b) -> a -> b
$ (forall (n1 :: Nat). AbsTensor1 n1 k1 (AnsVar a) -> [[(Int, a)]])
-> TensList1 k1 (AnsVar a) -> [[[(Int, a)]]]
forall k1 v b.
(forall (n1 :: Nat). AbsTensor1 n1 k1 v -> b)
-> TensList1 k1 v -> [b]
mapTensList1 forall k1 a (n1 :: Nat).
(TIndex k1, TAdd a) =>
AbsTensor1 n1 k1 (AnsVar a) -> [[(Int, a)]]
forall (n1 :: Nat). AbsTensor1 n1 k1 (AnsVar a) -> [[(Int, a)]]
toMatList1' TensList1 k1 (AnsVar a)
t
toMatListT2 :: (TIndex k1, TAdd a) => TensList2 k1 (AnsVar a) -> [((Int,Int),a)]
toMatListT2 :: TensList2 k1 (AnsVar a) -> [((Int, Int), a)]
toMatListT2 TensList2 k1 (AnsVar a)
t = [[(Int, a)]] -> [((Int, Int), a)]
forall a. [[(Int, a)]] -> [((Int, Int), a)]
collectMatList [[(Int, a)]]
matList
where
matList :: [[(Int, a)]]
matList = [[[(Int, a)]]] -> [[(Int, a)]]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[[(Int, a)]]] -> [[(Int, a)]]) -> [[[(Int, a)]]] -> [[(Int, a)]]
forall a b. (a -> b) -> a -> b
$ (forall (n1 :: Nat) (n2 :: Nat).
AbsTensor2 n1 n2 k1 (AnsVar a) -> [[(Int, a)]])
-> TensList2 k1 (AnsVar a) -> [[[(Int, a)]]]
forall k1 v b.
(forall (n1 :: Nat) (n2 :: Nat). AbsTensor2 n1 n2 k1 v -> b)
-> TensList2 k1 v -> [b]
mapTensList2 forall k1 a (n1 :: Nat) (n2 :: Nat).
(TIndex k1, TAdd a) =>
AbsTensor2 n1 n2 k1 (AnsVar a) -> [[(Int, a)]]
forall (n1 :: Nat) (n2 :: Nat).
AbsTensor2 n1 n2 k1 (AnsVar a) -> [[(Int, a)]]
toMatList2' TensList2 k1 (AnsVar a)
t
toMatListT3 :: (TIndex k1, TIndex k2, TAdd a) => TensList3 k1 k2 (AnsVar a) -> [((Int,Int),a)]
toMatListT3 :: TensList3 k1 k2 (AnsVar a) -> [((Int, Int), a)]
toMatListT3 TensList3 k1 k2 (AnsVar a)
t = [[(Int, a)]] -> [((Int, Int), a)]
forall a. [[(Int, a)]] -> [((Int, Int), a)]
collectMatList [[(Int, a)]]
matList
where
matList :: [[(Int, a)]]
matList = [[[(Int, a)]]] -> [[(Int, a)]]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[[(Int, a)]]] -> [[(Int, a)]]) -> [[[(Int, a)]]] -> [[(Int, a)]]
forall a b. (a -> b) -> a -> b
$ (forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat).
AbsTensor3 n1 n2 n3 k1 k2 (AnsVar a) -> [[(Int, a)]])
-> TensList3 k1 k2 (AnsVar a) -> [[[(Int, a)]]]
forall k1 k2 v b.
(forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat).
AbsTensor3 n1 n2 n3 k1 k2 v -> b)
-> TensList3 k1 k2 v -> [b]
mapTensList3 forall k1 k2 a (n1 :: Nat) (n2 :: Nat) (n3 :: Nat).
(TIndex k1, TIndex k2, TAdd a) =>
AbsTensor3 n1 n2 n3 k1 k2 (AnsVar a) -> [[(Int, a)]]
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat).
AbsTensor3 n1 n2 n3 k1 k2 (AnsVar a) -> [[(Int, a)]]
toMatList3' TensList3 k1 k2 (AnsVar a)
t
toMatListT4 :: (TIndex k1, TIndex k2, TAdd a) => TensList4 k1 k2 (AnsVar a) -> [((Int,Int),a)]
toMatListT4 :: TensList4 k1 k2 (AnsVar a) -> [((Int, Int), a)]
toMatListT4 TensList4 k1 k2 (AnsVar a)
t = [[(Int, a)]] -> [((Int, Int), a)]
forall a. [[(Int, a)]] -> [((Int, Int), a)]
collectMatList [[(Int, a)]]
matList
where
matList :: [[(Int, a)]]
matList = [[[(Int, a)]]] -> [[(Int, a)]]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[[(Int, a)]]] -> [[(Int, a)]]) -> [[[(Int, a)]]] -> [[(Int, a)]]
forall a b. (a -> b) -> a -> b
$ (forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat).
AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar a) -> [[(Int, a)]])
-> TensList4 k1 k2 (AnsVar a) -> [[[(Int, a)]]]
forall k1 k2 v b.
(forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat).
AbsTensor4 n1 n2 n3 n4 k1 k2 v -> b)
-> TensList4 k1 k2 v -> [b]
mapTensList4 forall k1 k2 a (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat).
(TIndex k1, TIndex k2, TAdd a) =>
AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar a) -> [[(Int, a)]]
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat).
AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar a) -> [[(Int, a)]]
toMatList4' TensList4 k1 k2 (AnsVar a)
t
toMatListT5 :: (TIndex k1, TIndex k2, TIndex k3, TAdd a) => TensList5 k1 k2 k3 (AnsVar a) -> [((Int,Int),a)]
toMatListT5 :: TensList5 k1 k2 k3 (AnsVar a) -> [((Int, Int), a)]
toMatListT5 TensList5 k1 k2 k3 (AnsVar a)
t = [[(Int, a)]] -> [((Int, Int), a)]
forall a. [[(Int, a)]] -> [((Int, Int), a)]
collectMatList [[(Int, a)]]
matList
where
matList :: [[(Int, a)]]
matList = [[[(Int, a)]]] -> [[(Int, a)]]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[[(Int, a)]]] -> [[(Int, a)]]) -> [[[(Int, a)]]] -> [[(Int, a)]]
forall a b. (a -> b) -> a -> b
$ (forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat).
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar a) -> [[(Int, a)]])
-> TensList5 k1 k2 k3 (AnsVar a) -> [[[(Int, a)]]]
forall k1 k2 k3 v b.
(forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat).
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v -> b)
-> TensList5 k1 k2 k3 v -> [b]
mapTensList5 forall k1 k2 k3 a (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd a) =>
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar a) -> [[(Int, a)]]
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat).
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar a) -> [[(Int, a)]]
toMatList5' TensList5 k1 k2 k3 (AnsVar a)
t
toMatListT6 :: (TIndex k1, TIndex k2, TIndex k3, TAdd a) => TensList6 k1 k2 k3 (AnsVar a) -> [((Int,Int),a)]
toMatListT6 :: TensList6 k1 k2 k3 (AnsVar a) -> [((Int, Int), a)]
toMatListT6 TensList6 k1 k2 k3 (AnsVar a)
t = [[(Int, a)]] -> [((Int, Int), a)]
forall a. [[(Int, a)]] -> [((Int, Int), a)]
collectMatList [[(Int, a)]]
matList
where
matList :: [[(Int, a)]]
matList = [[[(Int, a)]]] -> [[(Int, a)]]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[[(Int, a)]]] -> [[(Int, a)]]) -> [[[(Int, a)]]] -> [[(Int, a)]]
forall a b. (a -> b) -> a -> b
$ (forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat).
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar a) -> [[(Int, a)]])
-> TensList6 k1 k2 k3 (AnsVar a) -> [[[(Int, a)]]]
forall k1 k2 k3 v b.
(forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat).
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v -> b)
-> TensList6 k1 k2 k3 v -> [b]
mapTensList6 forall k1 k2 k3 a (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd a) =>
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar a) -> [[(Int, a)]]
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat).
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar a) -> [[(Int, a)]]
toMatList6' TensList6 k1 k2 k3 (AnsVar a)
t
toMatListT7 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd a) => TensList7 k1 k2 k3 k4 (AnsVar a) -> [((Int,Int),a)]
toMatListT7 :: TensList7 k1 k2 k3 k4 (AnsVar a) -> [((Int, Int), a)]
toMatListT7 TensList7 k1 k2 k3 k4 (AnsVar a)
t = [[(Int, a)]] -> [((Int, Int), a)]
forall a. [[(Int, a)]] -> [((Int, Int), a)]
collectMatList [[(Int, a)]]
matList
where
matList :: [[(Int, a)]]
matList = [[[(Int, a)]]] -> [[(Int, a)]]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[[(Int, a)]]] -> [[(Int, a)]]) -> [[[(Int, a)]]] -> [[(Int, a)]]
forall a b. (a -> b) -> a -> b
$ (forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat).
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar a)
-> [[(Int, a)]])
-> TensList7 k1 k2 k3 k4 (AnsVar a) -> [[[(Int, a)]]]
forall k1 k2 k3 k4 v b.
(forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat).
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v -> b)
-> TensList7 k1 k2 k3 k4 v -> [b]
mapTensList7 forall k1 k2 k3 k4 a (n1 :: Nat) (n2 :: Nat) (n3 :: Nat)
(n4 :: Nat) (n5 :: Nat) (n6 :: Nat) (n7 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd a) =>
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar a)
-> [[(Int, a)]]
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat).
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar a)
-> [[(Int, a)]]
toMatList7' TensList7 k1 k2 k3 k4 (AnsVar a)
t
toMatListT8 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd a) => TensList8 k1 k2 k3 k4 (AnsVar a) -> [((Int,Int),a)]
toMatListT8 :: TensList8 k1 k2 k3 k4 (AnsVar a) -> [((Int, Int), a)]
toMatListT8 TensList8 k1 k2 k3 k4 (AnsVar a)
t = [[(Int, a)]] -> [((Int, Int), a)]
forall a. [[(Int, a)]] -> [((Int, Int), a)]
collectMatList [[(Int, a)]]
matList
where
matList :: [[(Int, a)]]
matList = [[[(Int, a)]]] -> [[(Int, a)]]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[[(Int, a)]]] -> [[(Int, a)]]) -> [[[(Int, a)]]] -> [[(Int, a)]]
forall a b. (a -> b) -> a -> b
$ (forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat) (n8 :: Nat).
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar a)
-> [[(Int, a)]])
-> TensList8 k1 k2 k3 k4 (AnsVar a) -> [[[(Int, a)]]]
forall k1 k2 k3 k4 v b.
(forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat) (n8 :: Nat).
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v -> b)
-> TensList8 k1 k2 k3 k4 v -> [b]
mapTensList8 forall k1 k2 k3 k4 a (n1 :: Nat) (n2 :: Nat) (n3 :: Nat)
(n4 :: Nat) (n5 :: Nat) (n6 :: Nat) (n7 :: Nat) (n8 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd a) =>
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar a)
-> [[(Int, a)]]
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat) (n8 :: Nat).
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar a)
-> [[(Int, a)]]
toMatList8' TensList8 k1 k2 k3 k4 (AnsVar a)
t
dims :: [((Int, Int), a)] -> (Int, Int)
dims :: [((Int, Int), a)] -> (Int, Int)
dims [((Int, Int), a)]
xs = (Int
rows, Int
cols)
where
rows :: Int
rows = [Int] -> Int
forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a
maximum ([Int] -> Int) -> [Int] -> Int
forall a b. (a -> b) -> a -> b
$ (((Int, Int), a) -> Int) -> [((Int, Int), a)] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map ((Int, Int) -> Int
forall a b. (a, b) -> a
fst((Int, Int) -> Int)
-> (((Int, Int), a) -> (Int, Int)) -> ((Int, Int), a) -> Int
forall b c a. (b -> c) -> (a -> b) -> a -> c
.((Int, Int), a) -> (Int, Int)
forall a b. (a, b) -> a
fst) [((Int, Int), a)]
xs
cols :: Int
cols = [Int] -> Int
forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a
maximum ([Int] -> Int) -> [Int] -> Int
forall a b. (a -> b) -> a -> b
$ (((Int, Int), a) -> Int) -> [((Int, Int), a)] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
map ((Int, Int) -> Int
forall a b. (a, b) -> b
snd((Int, Int) -> Int)
-> (((Int, Int), a) -> (Int, Int)) -> ((Int, Int), a) -> Int
forall b c a. (b -> c) -> (a -> b) -> a -> c
.((Int, Int), a) -> (Int, Int)
forall a b. (a, b) -> a
fst) [((Int, Int), a)]
xs
assocsToMatrix :: Real a => [((Int, Int), SField a)] -> HM.Matrix Double
assocsToMatrix :: [((Int, Int), SField a)] -> Matrix Double
assocsToMatrix [] = (Int
1 Int -> Int -> [Double] -> Matrix Double
forall a. Storable a => Int -> Int -> [a] -> Matrix a
HM.>< Int
1) [Double
0]
assocsToMatrix [((Int, Int), SField a)]
assocs = IndexOf Matrix
-> Double -> [(IndexOf Matrix, Double)] -> Matrix Double
forall (c :: * -> *) e.
Container c e =>
IndexOf c -> e -> [(IndexOf c, e)] -> c e
HM.assoc (Int
rows, Int
cols) Double
0 [((Int, Int), Double)]
[(IndexOf Matrix, Double)]
els
where
(Int
rows, Int
cols) = [((Int, Int), SField a)] -> (Int, Int)
forall a. [((Int, Int), a)] -> (Int, Int)
dims [((Int, Int), SField a)]
assocs
els :: [((Int, Int), Double)]
els = (((Int, Int), SField a) -> ((Int, Int), Double))
-> [((Int, Int), SField a)] -> [((Int, Int), Double)]
forall a b. (a -> b) -> [a] -> [b]
map (\((Int
x, Int
y), SField a
z) -> ((Int
xInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1, Int
yInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1), Rational -> Double
forall a. Fractional a => Rational -> a
fromRational (Rational -> Double) -> Rational -> Double
forall a b. (a -> b) -> a -> b
$ a -> Rational
forall a. Real a => a -> Rational
toRational a
z)) [((Int, Int), SField a)]
assocs
toMatrixT1 :: (TIndex k1, Real a) => TensList1 k1 (AnsVar (SField a)) -> HM.Matrix Double
toMatrixT1 :: TensList1 k1 (AnsVar (SField a)) -> Matrix Double
toMatrixT1 = [((Int, Int), SField a)] -> Matrix Double
forall a. Real a => [((Int, Int), SField a)] -> Matrix Double
assocsToMatrix ([((Int, Int), SField a)] -> Matrix Double)
-> (TensList1 k1 (AnsVar (SField a)) -> [((Int, Int), SField a)])
-> TensList1 k1 (AnsVar (SField a))
-> Matrix Double
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TensList1 k1 (AnsVar (SField a)) -> [((Int, Int), SField a)]
forall k1 a.
(TIndex k1, TAdd a) =>
TensList1 k1 (AnsVar a) -> [((Int, Int), a)]
toMatListT1
toMatrixT2 :: (TIndex k1, Real a) => TensList2 k1 (AnsVar (SField a)) -> HM.Matrix Double
toMatrixT2 :: TensList2 k1 (AnsVar (SField a)) -> Matrix Double
toMatrixT2 = [((Int, Int), SField a)] -> Matrix Double
forall a. Real a => [((Int, Int), SField a)] -> Matrix Double
assocsToMatrix ([((Int, Int), SField a)] -> Matrix Double)
-> (TensList2 k1 (AnsVar (SField a)) -> [((Int, Int), SField a)])
-> TensList2 k1 (AnsVar (SField a))
-> Matrix Double
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TensList2 k1 (AnsVar (SField a)) -> [((Int, Int), SField a)]
forall k1 a.
(TIndex k1, TAdd a) =>
TensList2 k1 (AnsVar a) -> [((Int, Int), a)]
toMatListT2
toMatrixT3 :: (TIndex k1, TIndex k2, Real a) => TensList3 k1 k2 (AnsVar (SField a)) -> HM.Matrix Double
toMatrixT3 :: TensList3 k1 k2 (AnsVar (SField a)) -> Matrix Double
toMatrixT3 = [((Int, Int), SField a)] -> Matrix Double
forall a. Real a => [((Int, Int), SField a)] -> Matrix Double
assocsToMatrix ([((Int, Int), SField a)] -> Matrix Double)
-> (TensList3 k1 k2 (AnsVar (SField a))
-> [((Int, Int), SField a)])
-> TensList3 k1 k2 (AnsVar (SField a))
-> Matrix Double
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TensList3 k1 k2 (AnsVar (SField a)) -> [((Int, Int), SField a)]
forall k1 k2 a.
(TIndex k1, TIndex k2, TAdd a) =>
TensList3 k1 k2 (AnsVar a) -> [((Int, Int), a)]
toMatListT3
toMatrixT4 :: (TIndex k1, TIndex k2, Real a) => TensList4 k1 k2 (AnsVar (SField a)) -> HM.Matrix Double
toMatrixT4 :: TensList4 k1 k2 (AnsVar (SField a)) -> Matrix Double
toMatrixT4 = [((Int, Int), SField a)] -> Matrix Double
forall a. Real a => [((Int, Int), SField a)] -> Matrix Double
assocsToMatrix ([((Int, Int), SField a)] -> Matrix Double)
-> (TensList4 k1 k2 (AnsVar (SField a))
-> [((Int, Int), SField a)])
-> TensList4 k1 k2 (AnsVar (SField a))
-> Matrix Double
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TensList4 k1 k2 (AnsVar (SField a)) -> [((Int, Int), SField a)]
forall k1 k2 a.
(TIndex k1, TIndex k2, TAdd a) =>
TensList4 k1 k2 (AnsVar a) -> [((Int, Int), a)]
toMatListT4
toMatrixT5 :: (TIndex k1, TIndex k2, TIndex k3, Real a) => TensList5 k1 k2 k3 (AnsVar (SField a)) -> HM.Matrix Double
toMatrixT5 :: TensList5 k1 k2 k3 (AnsVar (SField a)) -> Matrix Double
toMatrixT5 = [((Int, Int), SField a)] -> Matrix Double
forall a. Real a => [((Int, Int), SField a)] -> Matrix Double
assocsToMatrix ([((Int, Int), SField a)] -> Matrix Double)
-> (TensList5 k1 k2 k3 (AnsVar (SField a))
-> [((Int, Int), SField a)])
-> TensList5 k1 k2 k3 (AnsVar (SField a))
-> Matrix Double
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TensList5 k1 k2 k3 (AnsVar (SField a)) -> [((Int, Int), SField a)]
forall k1 k2 k3 a.
(TIndex k1, TIndex k2, TIndex k3, TAdd a) =>
TensList5 k1 k2 k3 (AnsVar a) -> [((Int, Int), a)]
toMatListT5
toMatrixT6 :: (TIndex k1, TIndex k2, TIndex k3, Real a) => TensList6 k1 k2 k3 (AnsVar (SField a)) -> HM.Matrix Double
toMatrixT6 :: TensList6 k1 k2 k3 (AnsVar (SField a)) -> Matrix Double
toMatrixT6 = [((Int, Int), SField a)] -> Matrix Double
forall a. Real a => [((Int, Int), SField a)] -> Matrix Double
assocsToMatrix ([((Int, Int), SField a)] -> Matrix Double)
-> (TensList6 k1 k2 k3 (AnsVar (SField a))
-> [((Int, Int), SField a)])
-> TensList6 k1 k2 k3 (AnsVar (SField a))
-> Matrix Double
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TensList6 k1 k2 k3 (AnsVar (SField a)) -> [((Int, Int), SField a)]
forall k1 k2 k3 a.
(TIndex k1, TIndex k2, TIndex k3, TAdd a) =>
TensList6 k1 k2 k3 (AnsVar a) -> [((Int, Int), a)]
toMatListT6
toMatrixT7 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, Real a) => TensList7 k1 k2 k3 k4 (AnsVar (SField a)) -> HM.Matrix Double
toMatrixT7 :: TensList7 k1 k2 k3 k4 (AnsVar (SField a)) -> Matrix Double
toMatrixT7 = [((Int, Int), SField a)] -> Matrix Double
forall a. Real a => [((Int, Int), SField a)] -> Matrix Double
assocsToMatrix ([((Int, Int), SField a)] -> Matrix Double)
-> (TensList7 k1 k2 k3 k4 (AnsVar (SField a))
-> [((Int, Int), SField a)])
-> TensList7 k1 k2 k3 k4 (AnsVar (SField a))
-> Matrix Double
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TensList7 k1 k2 k3 k4 (AnsVar (SField a))
-> [((Int, Int), SField a)]
forall k1 k2 k3 k4 a.
(TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd a) =>
TensList7 k1 k2 k3 k4 (AnsVar a) -> [((Int, Int), a)]
toMatListT7
toMatrixT8 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, Real a) => TensList8 k1 k2 k3 k4 (AnsVar (SField a)) -> HM.Matrix Double
toMatrixT8 :: TensList8 k1 k2 k3 k4 (AnsVar (SField a)) -> Matrix Double
toMatrixT8 = [((Int, Int), SField a)] -> Matrix Double
forall a. Real a => [((Int, Int), SField a)] -> Matrix Double
assocsToMatrix ([((Int, Int), SField a)] -> Matrix Double)
-> (TensList8 k1 k2 k3 k4 (AnsVar (SField a))
-> [((Int, Int), SField a)])
-> TensList8 k1 k2 k3 k4 (AnsVar (SField a))
-> Matrix Double
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TensList8 k1 k2 k3 k4 (AnsVar (SField a))
-> [((Int, Int), SField a)]
forall k1 k2 k3 k4 a.
(TIndex k1, TIndex k2, TIndex k3, TIndex k4, TAdd a) =>
TensList8 k1 k2 k3 k4 (AnsVar a) -> [((Int, Int), a)]
toMatListT8
tensorRank1' :: (TIndex k1, Real a, Real a) => AbsTensor1 n1 k1 (AnsVar (SField a)) -> Int
tensorRank1' :: AbsTensor1 n1 k1 (AnsVar (SField a)) -> Int
tensorRank1' AbsTensor1 n1 k1 (AnsVar (SField a))
t = Matrix Double -> Int
forall t. Field t => Matrix t -> Int
rank (Matrix Double -> Int) -> Matrix Double -> Int
forall a b. (a -> b) -> a -> b
$ TensList1 k1 (AnsVar (SField a)) -> Matrix Double
forall k1 a.
(TIndex k1, Real a) =>
TensList1 k1 (AnsVar (SField a)) -> Matrix Double
toMatrixT1 (AbsTensor1 n1 k1 (AnsVar (SField a))
-> TensList1 k1 (AnsVar (SField a))
forall (n1 :: Nat) k1 v. AbsTensor1 n1 k1 v -> TensList1 k1 v
singletonTList1 AbsTensor1 n1 k1 (AnsVar (SField a))
t)
tensorRank1 :: (TIndex k1, Real a) => TensList1 k1 (AnsVar (SField a)) -> Int
tensorRank1 :: TensList1 k1 (AnsVar (SField a)) -> Int
tensorRank1 TensList1 k1 (AnsVar (SField a))
t = Matrix Double -> Int
forall t. Field t => Matrix t -> Int
rank (Matrix Double -> Int) -> Matrix Double -> Int
forall a b. (a -> b) -> a -> b
$ TensList1 k1 (AnsVar (SField a)) -> Matrix Double
forall k1 a.
(TIndex k1, Real a) =>
TensList1 k1 (AnsVar (SField a)) -> Matrix Double
toMatrixT1 TensList1 k1 (AnsVar (SField a))
t
tensorRank2' :: (TIndex k1, Real a) => AbsTensor2 n1 n2 k1 (AnsVar (SField a)) -> Int
tensorRank2' :: AbsTensor2 n1 n2 k1 (AnsVar (SField a)) -> Int
tensorRank2' AbsTensor2 n1 n2 k1 (AnsVar (SField a))
t = Matrix Double -> Int
forall t. Field t => Matrix t -> Int
rank (Matrix Double -> Int) -> Matrix Double -> Int
forall a b. (a -> b) -> a -> b
$ TensList2 k1 (AnsVar (SField a)) -> Matrix Double
forall k1 a.
(TIndex k1, Real a) =>
TensList2 k1 (AnsVar (SField a)) -> Matrix Double
toMatrixT2 (AbsTensor2 n1 n2 k1 (AnsVar (SField a))
-> TensList2 k1 (AnsVar (SField a))
forall (n1 :: Nat) (n2 :: Nat) k1 v.
AbsTensor2 n1 n2 k1 v -> TensList2 k1 v
singletonTList2 AbsTensor2 n1 n2 k1 (AnsVar (SField a))
t)
tensorRank2 :: (TIndex k1, Real a) => TensList2 k1 (AnsVar (SField a)) -> Int
tensorRank2 :: TensList2 k1 (AnsVar (SField a)) -> Int
tensorRank2 TensList2 k1 (AnsVar (SField a))
t = Matrix Double -> Int
forall t. Field t => Matrix t -> Int
rank (Matrix Double -> Int) -> Matrix Double -> Int
forall a b. (a -> b) -> a -> b
$ TensList2 k1 (AnsVar (SField a)) -> Matrix Double
forall k1 a.
(TIndex k1, Real a) =>
TensList2 k1 (AnsVar (SField a)) -> Matrix Double
toMatrixT2 TensList2 k1 (AnsVar (SField a))
t
tensorRank3' :: (TIndex k1, TIndex k2, Real a) => AbsTensor3 n1 n2 n3 k1 k2 (AnsVar (SField a)) -> Int
tensorRank3' :: AbsTensor3 n1 n2 n3 k1 k2 (AnsVar (SField a)) -> Int
tensorRank3' AbsTensor3 n1 n2 n3 k1 k2 (AnsVar (SField a))
t = Matrix Double -> Int
forall t. Field t => Matrix t -> Int
rank (Matrix Double -> Int) -> Matrix Double -> Int
forall a b. (a -> b) -> a -> b
$ TensList3 k1 k2 (AnsVar (SField a)) -> Matrix Double
forall k1 k2 a.
(TIndex k1, TIndex k2, Real a) =>
TensList3 k1 k2 (AnsVar (SField a)) -> Matrix Double
toMatrixT3 (AbsTensor3 n1 n2 n3 k1 k2 (AnsVar (SField a))
-> TensList3 k1 k2 (AnsVar (SField a))
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) k1 k2 v.
AbsTensor3 n1 n2 n3 k1 k2 v -> TensList3 k1 k2 v
singletonTList3 AbsTensor3 n1 n2 n3 k1 k2 (AnsVar (SField a))
t)
tensorRank3 :: (TIndex k1, TIndex k2, Real a) => TensList3 k1 k2 (AnsVar (SField a)) -> Int
tensorRank3 :: TensList3 k1 k2 (AnsVar (SField a)) -> Int
tensorRank3 TensList3 k1 k2 (AnsVar (SField a))
t = Matrix Double -> Int
forall t. Field t => Matrix t -> Int
rank (Matrix Double -> Int) -> Matrix Double -> Int
forall a b. (a -> b) -> a -> b
$ TensList3 k1 k2 (AnsVar (SField a)) -> Matrix Double
forall k1 k2 a.
(TIndex k1, TIndex k2, Real a) =>
TensList3 k1 k2 (AnsVar (SField a)) -> Matrix Double
toMatrixT3 TensList3 k1 k2 (AnsVar (SField a))
t
tensorRank4' :: (TIndex k1, TIndex k2, Real a) => AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar (SField a)) -> Int
tensorRank4' :: AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar (SField a)) -> Int
tensorRank4' AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar (SField a))
t = Matrix Double -> Int
forall t. Field t => Matrix t -> Int
rank (Matrix Double -> Int) -> Matrix Double -> Int
forall a b. (a -> b) -> a -> b
$ TensList4 k1 k2 (AnsVar (SField a)) -> Matrix Double
forall k1 k2 a.
(TIndex k1, TIndex k2, Real a) =>
TensList4 k1 k2 (AnsVar (SField a)) -> Matrix Double
toMatrixT4 (AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar (SField a))
-> TensList4 k1 k2 (AnsVar (SField a))
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) k1 k2 v.
AbsTensor4 n1 n2 n3 n4 k1 k2 v -> TensList4 k1 k2 v
singletonTList4 AbsTensor4 n1 n2 n3 n4 k1 k2 (AnsVar (SField a))
t)
tensorRank4 :: (TIndex k1, TIndex k2, Real a) => TensList4 k1 k2 (AnsVar (SField a)) -> Int
tensorRank4 :: TensList4 k1 k2 (AnsVar (SField a)) -> Int
tensorRank4 TensList4 k1 k2 (AnsVar (SField a))
t = Matrix Double -> Int
forall t. Field t => Matrix t -> Int
rank (Matrix Double -> Int) -> Matrix Double -> Int
forall a b. (a -> b) -> a -> b
$ TensList4 k1 k2 (AnsVar (SField a)) -> Matrix Double
forall k1 k2 a.
(TIndex k1, TIndex k2, Real a) =>
TensList4 k1 k2 (AnsVar (SField a)) -> Matrix Double
toMatrixT4 TensList4 k1 k2 (AnsVar (SField a))
t
tensorRank5' :: (TIndex k1, TIndex k2, TIndex k3, Real a) => AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar (SField a)) -> Int
tensorRank5' :: AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar (SField a)) -> Int
tensorRank5' AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar (SField a))
t = Matrix Double -> Int
forall t. Field t => Matrix t -> Int
rank (Matrix Double -> Int) -> Matrix Double -> Int
forall a b. (a -> b) -> a -> b
$ TensList5 k1 k2 k3 (AnsVar (SField a)) -> Matrix Double
forall k1 k2 k3 a.
(TIndex k1, TIndex k2, TIndex k3, Real a) =>
TensList5 k1 k2 k3 (AnsVar (SField a)) -> Matrix Double
toMatrixT5 (AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar (SField a))
-> TensList5 k1 k2 k3 (AnsVar (SField a))
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
k1 k2 k3 v.
AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v -> TensList5 k1 k2 k3 v
singletonTList5 AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 (AnsVar (SField a))
t)
tensorRank5 :: (TIndex k1, TIndex k2, TIndex k3, Real a) => TensList5 k1 k2 k3 (AnsVar (SField a)) -> Int
tensorRank5 :: TensList5 k1 k2 k3 (AnsVar (SField a)) -> Int
tensorRank5 TensList5 k1 k2 k3 (AnsVar (SField a))
t = Matrix Double -> Int
forall t. Field t => Matrix t -> Int
rank (Matrix Double -> Int) -> Matrix Double -> Int
forall a b. (a -> b) -> a -> b
$ TensList5 k1 k2 k3 (AnsVar (SField a)) -> Matrix Double
forall k1 k2 k3 a.
(TIndex k1, TIndex k2, TIndex k3, Real a) =>
TensList5 k1 k2 k3 (AnsVar (SField a)) -> Matrix Double
toMatrixT5 TensList5 k1 k2 k3 (AnsVar (SField a))
t
tensorRank6' :: (TIndex k1, TIndex k2, TIndex k3, Real a) => AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar (SField a)) -> Int
tensorRank6' :: AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar (SField a)) -> Int
tensorRank6' AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar (SField a))
t = Matrix Double -> Int
forall t. Field t => Matrix t -> Int
rank (Matrix Double -> Int) -> Matrix Double -> Int
forall a b. (a -> b) -> a -> b
$ TensList6 k1 k2 k3 (AnsVar (SField a)) -> Matrix Double
forall k1 k2 k3 a.
(TIndex k1, TIndex k2, TIndex k3, Real a) =>
TensList6 k1 k2 k3 (AnsVar (SField a)) -> Matrix Double
toMatrixT6 (AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar (SField a))
-> TensList6 k1 k2 k3 (AnsVar (SField a))
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) k1 k2 k3 v.
AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v -> TensList6 k1 k2 k3 v
singletonTList6 AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 (AnsVar (SField a))
t)
tensorRank6 :: (TIndex k1, TIndex k2, TIndex k3, Real a) => TensList6 k1 k2 k3 (AnsVar (SField a)) -> Int
tensorRank6 :: TensList6 k1 k2 k3 (AnsVar (SField a)) -> Int
tensorRank6 TensList6 k1 k2 k3 (AnsVar (SField a))
t = Matrix Double -> Int
forall t. Field t => Matrix t -> Int
rank (Matrix Double -> Int) -> Matrix Double -> Int
forall a b. (a -> b) -> a -> b
$ TensList6 k1 k2 k3 (AnsVar (SField a)) -> Matrix Double
forall k1 k2 k3 a.
(TIndex k1, TIndex k2, TIndex k3, Real a) =>
TensList6 k1 k2 k3 (AnsVar (SField a)) -> Matrix Double
toMatrixT6 TensList6 k1 k2 k3 (AnsVar (SField a))
t
tensorRank7' :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, Real a) => AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar (SField a)) -> Int
tensorRank7' :: AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar (SField a))
-> Int
tensorRank7' AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar (SField a))
t = Matrix Double -> Int
forall t. Field t => Matrix t -> Int
rank (Matrix Double -> Int) -> Matrix Double -> Int
forall a b. (a -> b) -> a -> b
$ TensList7 k1 k2 k3 k4 (AnsVar (SField a)) -> Matrix Double
forall k1 k2 k3 k4 a.
(TIndex k1, TIndex k2, TIndex k3, TIndex k4, Real a) =>
TensList7 k1 k2 k3 k4 (AnsVar (SField a)) -> Matrix Double
toMatrixT7 (AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar (SField a))
-> TensList7 k1 k2 k3 k4 (AnsVar (SField a))
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat) k1 k2 k3 k4 v.
AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 v
-> TensList7 k1 k2 k3 k4 v
singletonTList7 AbsTensor7 n1 n2 n3 n4 n5 n6 n7 k1 k2 k3 k4 (AnsVar (SField a))
t)
tensorRank7 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, Real a) => TensList7 k1 k2 k3 k4 (AnsVar (SField a)) -> Int
tensorRank7 :: TensList7 k1 k2 k3 k4 (AnsVar (SField a)) -> Int
tensorRank7 TensList7 k1 k2 k3 k4 (AnsVar (SField a))
t = Matrix Double -> Int
forall t. Field t => Matrix t -> Int
rank (Matrix Double -> Int) -> Matrix Double -> Int
forall a b. (a -> b) -> a -> b
$ TensList7 k1 k2 k3 k4 (AnsVar (SField a)) -> Matrix Double
forall k1 k2 k3 k4 a.
(TIndex k1, TIndex k2, TIndex k3, TIndex k4, Real a) =>
TensList7 k1 k2 k3 k4 (AnsVar (SField a)) -> Matrix Double
toMatrixT7 TensList7 k1 k2 k3 k4 (AnsVar (SField a))
t
tensorRank8' :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, Real a) => AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar (SField a)) -> Int
tensorRank8' :: AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar (SField a))
-> Int
tensorRank8' AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar (SField a))
t = Matrix Double -> Int
forall t. Field t => Matrix t -> Int
rank (Matrix Double -> Int) -> Matrix Double -> Int
forall a b. (a -> b) -> a -> b
$ TensList8 k1 k2 k3 k4 (AnsVar (SField a)) -> Matrix Double
forall k1 k2 k3 k4 a.
(TIndex k1, TIndex k2, TIndex k3, TIndex k4, Real a) =>
TensList8 k1 k2 k3 k4 (AnsVar (SField a)) -> Matrix Double
toMatrixT8 (AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar (SField a))
-> TensList8 k1 k2 k3 k4 (AnsVar (SField a))
forall (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat) (n5 :: Nat)
(n6 :: Nat) (n7 :: Nat) (n8 :: Nat) k1 k2 k3 k4 v.
AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 v
-> TensList8 k1 k2 k3 k4 v
singletonTList8 AbsTensor8 n1 n2 n3 n4 n5 n6 n7 n8 k1 k2 k3 k4 (AnsVar (SField a))
t)
tensorRank8 :: (TIndex k1, TIndex k2, TIndex k3, TIndex k4, Real a) => TensList8 k1 k2 k3 k4 (AnsVar (SField a)) -> Int
tensorRank8 :: TensList8 k1 k2 k3 k4 (AnsVar (SField a)) -> Int
tensorRank8 TensList8 k1 k2 k3 k4 (AnsVar (SField a))
t = Matrix Double -> Int
forall t. Field t => Matrix t -> Int
rank (Matrix Double -> Int) -> Matrix Double -> Int
forall a b. (a -> b) -> a -> b
$ TensList8 k1 k2 k3 k4 (AnsVar (SField a)) -> Matrix Double
forall k1 k2 k3 k4 a.
(TIndex k1, TIndex k2, TIndex k3, TIndex k4, Real a) =>
TensList8 k1 k2 k3 k4 (AnsVar (SField a)) -> Matrix Double
toMatrixT8 TensList8 k1 k2 k3 k4 (AnsVar (SField a))
t