diff --git a/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st b/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st
index 74732584..edfbb475 100644
--- a/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st
+++ b/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st
@@ -25,7 +25,8 @@ BaselineOfPolyMath >> baseline: spec [
self
sMark: spec;
xmlWriter: spec;
- polyMathDataStructures: spec.
+ polyMathDataStructures: spec;
+ randomNumbers: spec.
spec
package: 'ExtendedNumberParser';
@@ -74,7 +75,6 @@ BaselineOfPolyMath >> baseline: spec [
package: 'Math-Quaternion'
with:
[ spec requires: #('Math-Complex' 'Math-Numerical' 'Math-Polynomials') ];
- package: 'Math-Random';
package: 'Math-Series';
package: 'Math-StatisticalMoments' with: [ spec requires: #('Math-Helpers' 'Math-DistributionForHistogram') ];
package: 'Math-TSNE';
@@ -116,8 +116,6 @@ BaselineOfPolyMath >> baseline: spec [
with: [ spec requires: #('Math-Polynomials') ];
package: 'Math-Tests-Quaternion'
with: [ spec requires: #('Math-Quaternion') ];
- package: 'Math-Tests-Random'
- with: [ spec requires: #('Math-Random') ];
package: 'Math-Tests-TSNE'
with: [ spec requires: #('Math-TSNE') ];
package: 'Math-UtilsDataServer'.
@@ -128,13 +126,13 @@ BaselineOfPolyMath >> baseline: spec [
with: #('Math-Benchmarks-ODE' 'Math-Benchmarks-KDTree');
group: 'Core'
with:
- #('Math-Complex' 'Math-Quaternion' 'Math-Numerical' 'Math-Random' 'Math-KDTree' 'Math-ODE' 'Math-ArbitraryPrecisionFloat' 'Math-FastFourierTransform' 'ExtendedNumberParser' 'Math-Quantile' 'Math-Physics-Constants' 'Math-Polynomials' 'Math-TSNE' 'Math-Core-Process' 'Math-Helpers' 'PolyMathDataStructures' 'Math-Core-Distribution');
+ #('Math-Complex' 'Math-Quaternion' 'Math-Numerical' 'MathRandomNumbers' 'Math-KDTree' 'Math-ODE' 'Math-ArbitraryPrecisionFloat' 'Math-FastFourierTransform' 'ExtendedNumberParser' 'Math-Quantile' 'Math-Physics-Constants' 'Math-Polynomials' 'Math-TSNE' 'Math-Core-Process' 'Math-Helpers' 'PolyMathDataStructures' 'Math-Core-Distribution');
group: 'Extensions'
with:
#('Math-Clustering' 'Math-Number-Extensions' 'Math-Chromosome' 'Math-PrincipalComponentAnalysis' 'Math-FunctionFit' 'Math-AutomaticDifferenciation' 'Math-KernelSmoothing' 'Math-Permutation' 'Math-KolmogorovSmirnov');
group: 'Tests'
with:
- #('Math-Tests-Clustering' 'Math-Tests-Numerical' 'Math-Tests-Complex' 'Math-Tests-Quaternion' 'Math-Tests-Random' 'Math-Tests-ODE' 'Math-Tests-KDTree' 'Math-Tests-FunctionFit' 'Math-Tests-AutomaticDifferenciation' 'Math-Tests-FastFourierTransform' 'Math-Tests-Accuracy' 'Math-Tests-ArbitraryPrecisionFloat' 'Math-Tests-KolmogorovSmirnov' 'Math-Tests-Quantile' 'Math-Tests-Polynomials' 'Math-Tests-PrincipalComponentAnalysis' 'Math-Tests-KernelSmoothing' 'Math-Tests-Number-Extensions' 'Math-Tests-Permutation' 'Math-Tests-TSNE' 'Math-Tests-Core-Process' 'Math-Tests-Core-Distribution');
+ #('Math-Tests-Clustering' 'Math-Tests-Numerical' 'Math-Tests-Complex' 'Math-Tests-Quaternion' 'Math-Tests-ODE' 'Math-Tests-KDTree' 'Math-Tests-FunctionFit' 'Math-Tests-AutomaticDifferenciation' 'Math-Tests-FastFourierTransform' 'Math-Tests-Accuracy' 'Math-Tests-ArbitraryPrecisionFloat' 'Math-Tests-KolmogorovSmirnov' 'Math-Tests-Quantile' 'Math-Tests-Polynomials' 'Math-Tests-PrincipalComponentAnalysis' 'Math-Tests-KernelSmoothing' 'Math-Tests-Number-Extensions' 'Math-Tests-Permutation' 'Math-Tests-TSNE' 'Math-Tests-Core-Process' 'Math-Tests-Core-Distribution');
group: 'default'
with: #('Core' 'Extensions' 'Tests' 'Benchmarks' 'Accuracy') ].
@@ -159,6 +157,12 @@ BaselineOfPolyMath >> projectClass [
do: [ super projectClass ]
]
+{ #category : #dependencies }
+BaselineOfPolyMath >> randomNumbers: spec [
+
+ spec baseline: 'MathRandomNumbers' with: [ spec repository: 'github://PolyMathOrg/random-numbers:v1.x.x/src' ]
+]
+
{ #category : #dependencies }
BaselineOfPolyMath >> sMark: spec [
diff --git a/src/Math-Random/PMBernoulliGenerator.class.st b/src/Math-Random/PMBernoulliGenerator.class.st
deleted file mode 100644
index 2ca8a0c9..00000000
--- a/src/Math-Random/PMBernoulliGenerator.class.st
+++ /dev/null
@@ -1,71 +0,0 @@
-"
-A PMBernoulliGenerator is simulates a Bernoulli Process. This is a discrete process, with probability of p for success, and 1-p for failure.
-
-next
- answer 1 if success event, 0 otherwise
-
-generator:
- provide a uniform [0,1] random number generator
-
-p:
- set the probability of success events
-
-class methods
-
-withProbability:
- create a generator with probability set to p
-
-defaultGeneratorClass
- class used for generator in new instances
-"
-Class {
- #name : #PMBernoulliGenerator,
- #superclass : #PMNumberGenerator,
- #instVars : [
- 'probability'
- ],
- #category : #'Math-Random'
-}
-
-{ #category : #'instance creation' }
-PMBernoulliGenerator class >> fair [
- ^ self withProbability: 0.5
-]
-
-{ #category : #private }
-PMBernoulliGenerator class >> validProbability: aProbability [
- "reject probabilities outside of [0,1]"
-
- self assert: [ (aProbability < 0) not and: (aProbability > 1) not ]
-]
-
-{ #category : #'instance creation' }
-PMBernoulliGenerator class >> withProbability: p [
- self validProbability: p.
- ^ self new probability: p
-]
-
-{ #category : #initialization }
-PMBernoulliGenerator >> initialize [
- super initialize.
- self generator: self class defaultGeneratorClass new.
- self probability: 0.5
-]
-
-{ #category : #'stream accessing' }
-PMBernoulliGenerator >> next [
- ^ randomNumberGenerator next < probability
- ifTrue: [ 1 ]
- ifFalse: [ 0 ]
-]
-
-{ #category : #accessing }
-PMBernoulliGenerator >> probability [
- ^ probability
-]
-
-{ #category : #accessing }
-PMBernoulliGenerator >> probability: aProbability [
- self class validProbability: aProbability.
- probability := aProbability
-]
diff --git a/src/Math-Random/PMBinomialGenerator.class.st b/src/Math-Random/PMBinomialGenerator.class.st
deleted file mode 100644
index 7bead9d2..00000000
--- a/src/Math-Random/PMBinomialGenerator.class.st
+++ /dev/null
@@ -1,51 +0,0 @@
-"
-A PMBinomialGenerator yields results from a binomial distribution with probability p and n trials. The generator is the underlying random source.
-
-If each independent event has probability 0
> numberOfTrials: numberOfTrials probabilityOfSuccess: probabilityOfSuccess [
- ^ self new
- numberOfTrials: numberOfTrials;
- probability: probabilityOfSuccess;
- yourself
-]
-
-{ #category : #accessing }
-PMBinomialGenerator >> expectedValue [
- ^ numberOfTrials * probability
-]
-
-{ #category : #initialization }
-PMBinomialGenerator >> initialize [
- self generator: PMParkMillerMinimumRandomGenerator new.
- self numberOfTrials: 10; probability: 0.5
-]
-
-{ #category : #'stream access' }
-PMBinomialGenerator >> next [
- | x |
- x := 0.
- numberOfTrials timesRepeat: [ randomNumberGenerator next <= probability ifTrue: [ x := x + 1 ] ].
- ^ x
-]
-
-{ #category : #accessing }
-PMBinomialGenerator >> numberOfTrials: anInteger [
- numberOfTrials := anInteger
-]
-
-{ #category : #accessing }
-PMBinomialGenerator >> probability: aProbability [
- probability := aProbability
-]
diff --git a/src/Math-Random/PMCombinedRandomGenerator.class.st b/src/Math-Random/PMCombinedRandomGenerator.class.st
deleted file mode 100644
index d0b38525..00000000
--- a/src/Math-Random/PMCombinedRandomGenerator.class.st
+++ /dev/null
@@ -1,75 +0,0 @@
-"
-This Combined Random Number Generator is based on the algorithm described by PIERRE L'ECUYER in ""Efficient and Portable Combined Random Number Generators"" [Communications of the ACM, June 19, Volume 31, Number 6, pp. 742-749, references p.774]. Taking into account its two-dimensional behaviour (from abovementioned article), this generator is suitable to produce the pairs of consecutive numbers.
-For the first linear congruential generator (generator A):
-m = 2147483563; a = 40014; q = 53668; r = 12211.
-For the second linear congruential generator (generator B):
-m = 2147483399; a = 40692; q = 52774; r = 3791.
-
-To produce initial seedA (for the first generator) the method #nextInt: 2147483562 of Random is used; to produce seedB (for the second) - the method #nextInt: 2147483398. Corresponding seeds are represented as Floats. The result of work of two generators (the next seedA and seedB) are combined.
-
-Developed by Konstantin Nizheradze
-
-Instance Variables:
- random
- seedA
- seedB
-"
-Class {
- #name : #PMCombinedRandomGenerator,
- #superclass : #Random,
- #instVars : [
- 'random',
- 'seedA',
- 'seedB'
- ],
- #category : 'Math-Random'
-}
-
-{ #category : #initialize }
-PMCombinedRandomGenerator >> initialize [
-
- super initialize.
- random := Random new.
- seedA := (random nextInt: 2147483562) asFloat.
- seedB := (random nextInt: 2147483398) asFloat
-]
-
-{ #category : #accessing }
-PMCombinedRandomGenerator >> next [
- "Combine seedA and seedB to produce new seed. Seed is in the interval [0, 1]. "
-
- seed := (self nextValueA) - (self nextValueB).
- seed < 1 ifTrue: [seed := seed + 2.147483562e9].
- seed := seed * 4.656613057391769e-10.
- ^ seed
-
-
-]
-
-{ #category : #private }
-PMCombinedRandomGenerator >> nextValueA [
- "Evaluate next value of seedA using m and a of generatorA"
-
- | lo hi aLoRHi |
- hi := (seedA quo: 53668.0) asFloat.
- lo := seedA - (hi * 53668.0). " = seed rem: q"
- aLoRHi := ( 40014.0 * lo) - ( 12211.0 * hi).
- seedA := (aLoRHi > 0.0)
- ifTrue: [aLoRHi]
- ifFalse: [aLoRHi + 2.147483563e9].
- ^ seedA
-]
-
-{ #category : #private }
-PMCombinedRandomGenerator >> nextValueB [
- "Evaluate next value of seedB using m, a, q and r of generatorB"
-
- | lo hi aLoRHi |
- hi := (seedB quo: 52774.0) asFloat.
- lo := seedB - (hi * 52774.0). " = seed rem: q"
- aLoRHi := (40692.0 * lo) - (3791.0 * hi).
- seedB := (aLoRHi > 0.0)
- ifTrue: [aLoRHi]
- ifFalse: [aLoRHi + 2.147483399e9].
- ^ seedB
-]
diff --git a/src/Math-Random/PMConstantGenerator.class.st b/src/Math-Random/PMConstantGenerator.class.st
deleted file mode 100644
index 5c004c49..00000000
--- a/src/Math-Random/PMConstantGenerator.class.st
+++ /dev/null
@@ -1,32 +0,0 @@
-"
-A PMConstantGenerator is still a number generator but a simple one :)
-"
-Class {
- #name : #PMConstantGenerator,
- #superclass : #PMNumberGenerator,
- #instVars : [
- 'constant'
- ],
- #category : #'Math-Random'
-}
-
-{ #category : #'instance-creation' }
-PMConstantGenerator class >> constant: aNumber [
- ^ self new constant: aNumber ; yourself
-]
-
-{ #category : #accessing }
-PMConstantGenerator >> constant: aConstant [
- constant := aConstant
-]
-
-{ #category : #accessing }
-PMConstantGenerator >> generator: aRandomGenerator [
- "Do nothing."
- ^ self
-]
-
-{ #category : #'stream access' }
-PMConstantGenerator >> next [
- ^ constant
-]
diff --git a/src/Math-Random/PMExplicitInverseCongruentialRandomGenerator.class.st b/src/Math-Random/PMExplicitInverseCongruentialRandomGenerator.class.st
deleted file mode 100644
index 0345cda3..00000000
--- a/src/Math-Random/PMExplicitInverseCongruentialRandomGenerator.class.st
+++ /dev/null
@@ -1,96 +0,0 @@
-"
-A PMExplicitInverseCongruentialGenerator is an explicit inversive congruential generator, constructed according to ""Good random number generators are (not so) easy to find"" by P. Hellekalek (1998) and extended euclidean algorithm.
-Developed by Konstantin Nizheradze
-
-Instance Variables
- nextN: