Closed sid-kap closed 8 years ago
Yes, I think it is a good idea. Static could reexport Normed with these instances.
We can extract
the arrays and work with the dynamic norms, but it is a bit ugly:
import Numeric.LinearAlgebra.Static
import qualified Numeric.LinearAlgebra as LA
λ> let m = fromList [1,2,3,4] :: M 2 2
λ> print $ (LA.norm_nuclear . extract) m
5.8309518948453
λ> let v = vector [1,2,3] :: R 3
λ> print $ (LA.norm_2 . extract) v
3.7416573867739413
I noticed that real-valued statically-sized vectors and matrices (
R n
andL m n
) are not instances of theNormed
class, so it is not possible to use thenorm_0
,norm_1
,norm_2
,norm_Inf
,norm_Frob
, andnorm_nuclear
functions on these values.Would it be a good idea to add a
Normed
instance forR n
andL m n
? I would love to submit a PR if you believe this would be a useful addition.