uniqueness-periods-vector-filters 0.1.1.0 → 0.2.0.0
raw patch · 3 files changed
+13/−5 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- ChangeLog.md +4/−0
- Languages/UniquenessPeriods/Vector/Filters.hs +8/−4
- uniqueness-periods-vector-filters.cabal +1/−1
ChangeLog.md view
@@ -7,3 +7,7 @@ ## 0.1.1.0 -- 2020-09-17 * First version revised A. Defined intervalNRealFrac for the equal two first arguments (though this can be rarely useful). ++## 0.2.0.0 -- 2020-09-19++* Second version. Some code re-defining for special cases.
Languages/UniquenessPeriods/Vector/Filters.hs view
@@ -30,7 +30,7 @@ -> b -> Int intervalNRealFrac minE maxE n x - | maxE == minE = round (0.5 * fromIntegral n)+ | maxE == minE = ceiling (0.5 * fromIntegral n) | otherwise = zero2One . ceiling $ fromIntegral n * (x - minE) / (maxE - minE) {-# INLINE intervalNRealFrac #-} @@ -49,7 +49,9 @@ -> b -> b -> b-unsafeTransfer1I5 minE0 maxE0 minE1 maxE1 x = minE1 + (x - minE0) * (maxE1 - minE1) / (maxE0 - minE0) +unsafeTransfer1I5 minE0 maxE0 minE1 maxE1 x + | minE0 == maxE0 = x+ | otherwise = minE1 + (x - minE0) * (maxE1 - minE1) / (maxE0 - minE0) {-# INLINE unsafeTransfer1I5 #-} -- | A variant of the 'unsafeTransfer1I5' where the lengths of the both intervals (the old and the new ones) are equal.@@ -74,8 +76,10 @@ -> V.Vector (Int,Int) -> b -> b-unsafeRearrangeIG minE maxE n v x = x + fromIntegral (getBFst' (n0, v) n0 - n0) * (maxE - minE) / fromIntegral n- where n0 = intervalNRealFrac minE maxE n x+unsafeRearrangeIG minE maxE n v x + | minE == maxE = x+ | otherwise = x + fromIntegral (getBFst' (n0, v) n0 - n0) * (maxE - minE) / fromIntegral n+ where n0 = intervalNRealFrac minE maxE n x -- | An unzipped variant of the 'unsafeRearrangeIG' function where the 'V.Vector' argument is internally 'V.zip'ped as the second argument with the 'V.Vector' @[1..n]@. -- This allows to shorten the time of the arguments writing given only the resulting backpermutted indexes in the 'V.Vector'.
uniqueness-periods-vector-filters.cabal view
@@ -2,7 +2,7 @@ -- For further documentation, see http://haskell.org/cabal/users-guide/ name: uniqueness-periods-vector-filters-version: 0.1.1.0+version: 0.2.0.0 synopsis: A library allows to change the structure of the 'RealFrac' function output. description: A library allows to change the structure of the 'RealFrac' function output. At the moment only the equal intervals are supported.