diff options
author | Alberto Ruiz <aruiz@um.es> | 2016-01-04 20:53:39 +0100 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2016-01-04 20:53:39 +0100 |
commit | dd262e728a5390962ad4592e23b3e2cdac4214be (patch) | |
tree | f768d3d09a4801bf573401482dbe15cb5061fb2d | |
parent | 5703cb1fac1259fda6ac8c2c461a4c416f9597de (diff) | |
parent | 24f6bdb3b6ab2ae0f664162588aa8840b417333f (diff) |
Merge pull request #166 from sid-kap/normed_static
Add Normed instance for Static matrix and vector
-rw-r--r-- | packages/base/src/Numeric/LinearAlgebra/Static.hs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/packages/base/src/Numeric/LinearAlgebra/Static.hs b/packages/base/src/Numeric/LinearAlgebra/Static.hs index 4de4d7a..3b7282a 100644 --- a/packages/base/src/Numeric/LinearAlgebra/Static.hs +++ b/packages/base/src/Numeric/LinearAlgebra/Static.hs | |||
@@ -643,3 +643,18 @@ instance (KnownNat n', KnownNat m') => Testable (L n' m') | |||
643 | where | 643 | where |
644 | checkT _ = test | 644 | checkT _ = test |
645 | 645 | ||
646 | -------------------------------------------------------------------------------- | ||
647 | |||
648 | instance KnownNat n => Normed (R n) | ||
649 | where | ||
650 | norm_0 v = norm_0 (extract v) | ||
651 | norm_1 v = norm_1 (extract v) | ||
652 | norm_2 v = norm_2 (extract v) | ||
653 | norm_Inf v = norm_Inf (extract v) | ||
654 | |||
655 | instance (KnownNat m, KnownNat n) => Normed (L m n) | ||
656 | where | ||
657 | norm_0 m = norm_0 (extract m) | ||
658 | norm_1 m = norm_1 (extract m) | ||
659 | norm_2 m = norm_2 (extract m) | ||
660 | norm_Inf m = norm_Inf (extract m) | ||