summaryrefslogtreecommitdiff
path: root/packages/base
diff options
context:
space:
mode:
authorSidharth Kapur <sidharthkapur1@gmail.com>2015-12-31 11:27:29 -0600
committerSidharth Kapur <sidharthkapur1@gmail.com>2015-12-31 11:27:29 -0600
commit24f6bdb3b6ab2ae0f664162588aa8840b417333f (patch)
tree891da452c8aea20bdce538d82df2376367059fc5 /packages/base
parentec519ba507cff7ef3f7385315ea3511f8116f368 (diff)
Add Normed instance for Static matrix and vector
Diffstat (limited to 'packages/base')
-rw-r--r--packages/base/src/Numeric/LinearAlgebra/Static.hs15
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
648instance 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
655instance (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)