linear 1.15.5 → 1.16
raw patch · 4 files changed
+16/−8 lines, 4 files
Files
- CHANGELOG.markdown +4/−0
- linear.cabal +1/−1
- src/Linear/Matrix.hs +4/−3
- src/Linear/Vector.hs +7/−4
CHANGELOG.markdown view
@@ -1,3 +1,7 @@+1.16+----+* Renamed `kronecker` to `scaled`.+ 1.15.5 ------ * Added `Metric` instances for `[]`, `ZipList`, `Maybe`
linear.cabal view
@@ -1,6 +1,6 @@ name: linear category: Math, Algebra-version: 1.15.5+version: 1.16 license: BSD3 cabal-version: >= 1.8 license-file: LICENSE
src/Linear/Matrix.hs view
@@ -5,9 +5,6 @@ {-# LANGUAGE Trustworthy #-} #endif -#ifdef HLINT-{-# ANN module "HLint: ignore Reduce duplication" #-}-#endif --------------------------------------------------------------------------- -- | -- Copyright : (C) 2012-2013 Edward Kmett,@@ -50,6 +47,10 @@ import Linear.Vector import Linear.Conjugate import Linear.Trace++#ifdef HLINT+{-# ANN module "HLint: ignore Reduce duplication" #-}+#endif -- | This is a generalization of 'Control.Lens.inside' to work over any corepresentable 'Functor'. --
src/Linear/Vector.hs view
@@ -28,7 +28,7 @@ , sumV , basis , basisFor- , kronecker+ , scaled , outer , unit ) where@@ -384,9 +384,12 @@ basisFor :: (Traversable t, Num a) => t b -> [t a] basisFor = choices . traverse (\_ -> SetOne 0 [1]) --- | Produce a diagonal matrix from a vector.-kronecker :: (Traversable t, Num a) => t a -> t (t a)-kronecker v = fillFromList (choices $ traverse (\a -> SetOne 0 [a]) v) v+-- | Produce a diagonal (scale) matrix from a vector.+--+-- >>> scaled (V2 2 3)+-- V2 (V2 2 0) (V2 0 3)+scaled :: (Traversable t, Num a) => t a -> t (t a)+scaled v = fillFromList (choices $ traverse (\a -> SetOne 0 [a]) v) v -- | Create a unit vector. --