packages feed

phladiprelio-general-datatype 0.4.0.0 → 0.4.1.0

raw patch · 3 files changed

+18/−1 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Phladiprelio.General.Distance: distanceSqrG2 :: (Real a, Floating a, Fractional a) => Int -> [a] -> [a] -> a

Files

CHANGELOG.md view
@@ -38,3 +38,7 @@ * Fourth version. Added a new module Phladiprelio.General.Distance with functionality to calculate   similarity of the two non-negative 'Real' numbers lists. +## 0.4.1.0 -- 2023-11-11++* Fourth version revised A. Added a new function Phladiprelio.General.Distance.distanceSqrG2.+ 
Phladiprelio/General/Distance.hs view
@@ -65,3 +65,16 @@          rs = map (/ my) ys {-# INLINE distanceSqrG #-} +-- | 'distanceSqrG2' is an partially optimized variant of the 'distanceSqrG' if length of the least+-- common multiplier of the two lists is known and provided as the first argument, besides if it is+-- equal to the length of the second argument, and if maximum element of the second argument here is+-- equal to 1.0.+distanceSqrG2 :: (Real a, Floating a, Fractional a) => Int -> [a] -> [a] -> a+distanceSqrG2 lc xs ys = sqrt (sum (zipWith (\x y -> (x - y) * (x - y)) xs qs) / fromIntegral lc)+   where my = maximum ys+         rs = map (/ my) ys+         lr = length rs+         dc = lc `quot` lr+         qs = concatMap (replicate dc) ys+{-# INLINE distanceSqrG2 #-}+
phladiprelio-general-datatype.cabal view
@@ -1,6 +1,6 @@ cabal-version:      1.24 name:               phladiprelio-general-datatype-version:            0.4.0.0+version:            0.4.1.0 synopsis:           Extended functionality of PhLADiPreLiO description:        Can be used not only for language, but also for simpler music and lyrics composing. homepage:           https://hackage.haskell.org/package/phladiprelio-general-datatype