Make small adjustments to code
This commit is contained in:
parent
c9dada5206
commit
da4bb5873c
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue