aern2-real 0.2.15.1 → 0.2.16.0
raw patch · 6 files changed
+27/−13 lines, 6 filesdep ~aern2-mpdep ~mixed-types-numPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: aern2-mp, mixed-types-num
API changes (from Hackage documentation)
+ AERN2.Real.Type: instance Numeric.MixedTypes.Literals.ConvertibleExactly (Numeric.MixedTypes.Literals.WithSample AERN2.Real.Type.CReal GHC.Num.Integer.Integer) AERN2.Real.Type.CReal
+ AERN2.Real.Type: instance Numeric.MixedTypes.Literals.ConvertibleExactly (Numeric.MixedTypes.Literals.WithSample AERN2.Real.Type.CReal GHC.Real.Rational) AERN2.Real.Type.CReal
- AERN2.Real: class (OrderedField r, HasLimitsSameType Int r, HasLimitsSameType Integer r, HasLimitsSameType Rational r, CanTakeCNErrors r, CanSelectCNBool (OrderCompareType r r), EqCompareType Integer r ~ OrderCompareType r r, EqCompareType r Integer ~ OrderCompareType r r, EqCompareType Int r ~ OrderCompareType r r, EqCompareType r Int ~ OrderCompareType r r, EqCompareType Rational r ~ OrderCompareType r r, EqCompareType r Rational ~ OrderCompareType r r, OrderCompareType Integer r ~ OrderCompareType r r, OrderCompareType r Integer ~ OrderCompareType r r, OrderCompareType Int r ~ OrderCompareType r r, OrderCompareType r Int ~ OrderCompareType r r, OrderCompareType Rational r ~ OrderCompareType r r, OrderCompareType r Rational ~ OrderCompareType r r) => RealNumber r
+ AERN2.Real: class (OrderedField r, HasIntegers r, HasLimitsSameType Int r, HasLimitsSameType Integer r, HasLimitsSameType Rational r, CanTakeCNErrors r, CanSelectCNBool (OrderCompareType r r), EqCompareType Integer r ~ OrderCompareType r r, EqCompareType r Integer ~ OrderCompareType r r, EqCompareType Int r ~ OrderCompareType r r, EqCompareType r Int ~ OrderCompareType r r, EqCompareType Rational r ~ OrderCompareType r r, EqCompareType r Rational ~ OrderCompareType r r, OrderCompareType Integer r ~ OrderCompareType r r, OrderCompareType r Integer ~ OrderCompareType r r, OrderCompareType Int r ~ OrderCompareType r r, OrderCompareType r Int ~ OrderCompareType r r, OrderCompareType Rational r ~ OrderCompareType r r, OrderCompareType r Rational ~ OrderCompareType r r) => RealNumber r
- AERN2.Real.Examples.Introduction: logistic1 :: RealNumber t => Integer -> t
+ AERN2.Real.Examples.Introduction: logistic1 :: RealNumber t => t -> Integer -> t
Files
- aern2-real.cabal +6/−6
- changelog.md +3/−1
- examples/AERN2/Real/Examples/Introduction.hs +9/−5
- src/AERN2/Real.hs +1/−0
- src/AERN2/Real/Tests.hs +2/−1
- src/AERN2/Real/Type.hs +6/−0
aern2-real.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: aern2-real-version: 0.2.15.1+version: 0.2.16.0 synopsis: Real numbers as convergent sequences of intervals description: Please see the README on GitHub at <https://github.com/michalkonecny/aern2/#readme> category: Math@@ -13,7 +13,7 @@ bug-reports: https://github.com/michalkonecny/aern2/issues author: Michal Konecny maintainer: mikkonecny@gmail.com-copyright: 2015-2023 Michal Konecny+copyright: 2015-2024 Michal Konecny license: BSD3 license-file: LICENSE build-type: Simple@@ -61,12 +61,12 @@ ghc-options: -Wall build-depends: QuickCheck- , aern2-mp >=0.2.15.0+ , aern2-mp >=0.2.16.0 , base ==4.* , collect-errors >=0.1.5 , hspec , integer-logarithms- , mixed-types-num >=0.5.11+ , mixed-types-num >=0.6.1 default-language: Haskell2010 test-suite aern2-real-test@@ -93,11 +93,11 @@ ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall build-depends: QuickCheck- , aern2-mp >=0.2.15.0+ , aern2-mp >=0.2.16.0 , aern2-real , base ==4.* , collect-errors >=0.1.5 , hspec , integer-logarithms- , mixed-types-num >=0.5.11+ , mixed-types-num >=0.6.1 default-language: Haskell2010
changelog.md view
@@ -1,7 +1,9 @@ # Change log for aern2-real * current-* v 0.2.15.1 2024-??+* v 0.2.16.0 2024-09-21+ * adapt to int / rat conversion with sample+* v 0.2.15.1 2024-09-20 * an implementation of continuity principles for coq-aern * v 0.2.15 2023-04-11 * CanSelectCountable instance for CKleenean
examples/AERN2/Real/Examples/Introduction.hs view
@@ -271,20 +271,24 @@ where lg x = c * x * (1-x) -logistic1 :: (RealNumber t) => Integer -> t-logistic1 n = logistic 3.82 n (convertExactly 0.5)+logistic1 :: (RealNumber t) => t -> Integer -> t+logistic1 sample n = logistic 3.82 n (convertExactly (WithSample sample 0.5)) logistic1_CReal_run :: Integer -> CReal logistic1_CReal_run n = - logistic1 n+ logistic1 (creal 0) n logistic1_WithCurrentPrec_run :: Integer -> CReal logistic1_WithCurrentPrec_run n = - crealFromWithCurrentPrec $ logistic1 n+ crealFromWithCurrentPrec $ logistic1 sample n+ where+ sample = undefined logistic1_WithCurrentPrec_p_run :: Integer -> Precision -> CN MPBall logistic1_WithCurrentPrec_p_run n p = - runWithPrec p $ logistic1 n+ runWithPrec p $ logistic1 sample n+ where+ sample = undefined {- Example uses:
src/AERN2/Real.hs view
@@ -57,6 +57,7 @@ class (OrderedField r+ , HasIntegers r , HasLimitsSameType Int r , HasLimitsSameType Integer r , HasLimitsSameType Rational r
src/AERN2/Real/Tests.hs view
@@ -47,6 +47,7 @@ import AERN2.Real.Field () import AERN2.Real.Elementary () import AERN2.Real.Limit ()+import AERN2.MP.Ball (CentreRadius(..)) instance Arbitrary CReal where arbitrary =@@ -61,7 +62,7 @@ signedBinary2Real sbits = crealFromPrecFunction $ \ p -> cn $ balls !! p where- balls = nextBit (mpBall (0,1)) $ zip sbits (map prec [10..])+ balls = nextBit (mpBall (CentreRadius 0 1)) $ zip sbits (map prec [10..]) nextBit ball ((sbit, p):rest) = ball : nextBit newBall rest where
src/AERN2/Real/Type.hs view
@@ -161,8 +161,14 @@ safeConvertExactly x = Right $ crealFromPrecFunction (cn . flip mpBallP x) +instance ConvertibleExactly (WithSample CReal Rational) CReal where+ safeConvertExactly (WithSample _ value) = safeConvertExactly value+ instance ConvertibleExactly Integer CReal where safeConvertExactly = safeConvertExactly . rational++instance ConvertibleExactly (WithSample CReal Integer) CReal where+ safeConvertExactly (WithSample _ value) = safeConvertExactly value instance ConvertibleExactly Int CReal where safeConvertExactly = safeConvertExactly . rational