Make small adjustments to code

This commit is contained in:
Kiana Sheibani 2022-09-02 21:45:10 -04:00
parent c9dada5206
commit da4bb5873c
Signed by: toki
GPG key ID: 6CB106C25E86A9F7
2 changed files with 3 additions and 3 deletions

View file

@ -350,7 +350,7 @@ detWithLUP : (Ord a, Abs a, Neg a, Fractional a) =>
(mat : Matrix' n a) -> DecompLUP mat -> a
detWithLUP {n} mat lup =
(if numSwaps lup `mod` 2 == 0 then 1 else -1)
* product (diagonal lup.lower) * product (diagonal lup.upper)
* product (diagonal lup.lu)
export
det : (Ord a, Abs a, Neg a, Fractional a) => Matrix' n a -> a

View file

@ -56,7 +56,7 @@ namespace Monoid
||| Raise a multiplicative value (e.g. a matrix or a transformation) to a natural
||| number power.
public export
power : MultGroup a => Nat -> a -> a
power : MultMonoid a => Nat -> a -> a
power 0 _ = identity
power 1 x = x
power (S n@(S _)) x = x *. power n x
@ -66,5 +66,5 @@ power (S n@(S _)) x = x *. power n x
|||
||| This is the operator form of `power`.
public export %inline
(^) : MultGroup a => a -> Nat -> a
(^) : MultMonoid a => a -> Nat -> a
a ^ n = power n a