diff options
author | Sidharth Kapur <sidharthkapur1@gmail.com> | 2015-12-31 11:27:29 -0600 |
---|---|---|
committer | Sidharth Kapur <sidharthkapur1@gmail.com> | 2015-12-31 11:27:29 -0600 |
commit | 24f6bdb3b6ab2ae0f664162588aa8840b417333f (patch) | |
tree | 891da452c8aea20bdce538d82df2376367059fc5 | |
parent | ec519ba507cff7ef3f7385315ea3511f8116f368 (diff) |
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) | ||