on master help sign in
Fixed projections
e4dbb8fArmando Santos
src/LAoP/Matrix/Internal.hs+5−11
@@ -524,18 +524,12 @@ infixl 7 ./
524-- Projections
524-- Projections
525
525
526-- | Biproduct first component projection
526-- | Biproduct first component projection
527−p1 :: forall e m n. (Num e, CountableDimensions n m, FromLists e n m, FromLists e m m) => Matrix e (Either m n) m
527+p1 :: (Num e, CountableDimensions n m, FromLists e n m, FromLists e m m) => Matrix e (Either m n) m
528−p1 =
528+p1 = join iden zeros
529− let iden = iden :: Matrix e m m
530− zero = zeros :: Matrix e n m
531− in join iden zero
532
529
533-- | Biproduct second component projection
530-- | Biproduct second component projection
534−p2 :: forall e m n. (Num e, CountableDimensions n m, FromLists e m n, FromLists e n n) => Matrix e (Either m n) n
531+p2 :: (Num e, CountableDimensions n m, FromLists e m n, FromLists e n n) => Matrix e (Either m n) n
535−p2 =
532+p2 = join zeros iden
536− let iden = iden :: Matrix e n n
537− zero = zeros :: Matrix e m n
538− in join zero iden
539
533
540-- Injections
534-- Injections
541
535
@@ -642,7 +636,7 @@ kr ::
642kr a b =
636kr a b =
643 let fstM' = fstM @e @a @b
637 let fstM' = fstM @e @a @b
644 sndM' = sndM @e @a @b
638 sndM' = sndM @e @a @b
645− in tr fstM' . a * tr sndM' . b
639+ in (tr fstM' . a) * (tr sndM' . b)
646
640
647-- Product Bifunctor (Kronecker)
641-- Product Bifunctor (Kronecker)
648
642