Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
197 changes: 87 additions & 110 deletions src/BaselineOfPolyMath/BaselineOfPolyMath.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -17,125 +17,96 @@ Class {

{ #category : #baseline }
BaselineOfPolyMath >> baseline: spec [

<baseline>
spec
for: #common
do: [
"External dependencies"
self
sMark: spec;
xmlWriter: spec;
polyMathDataStructures: spec;
randomNumbers: spec.
spec for: #common do: [ "External dependencies"
self
sMark: spec;
xmlWriter: spec;
vectorMatrix: spec;
randomNumbers: spec.

spec
package: 'ExtendedNumberParser';
package: 'Math-Accuracy-Core';
package: 'Math-Accuracy-ODE' with: [ spec requires: #( 'Math-ODE' 'XMLWriter' ) ];
package: 'Math-ArbitraryPrecisionFloat' with: [ spec requires: #( 'ExtendedNumberParser' ) ];
package: 'Math-AutomaticDifferenciation' with: [ spec requires: #( 'Math-Numerical' 'MathVectorMatrix' ) ];
package: 'Math-Benchmarks-KDTree' with: [ spec requires: #( 'Math-KDTree' 'SMark' ) ];
package: 'Math-Benchmarks-ODE' with: [ spec requires: #( 'Math-ODE' 'SMark' 'XMLWriter' ) ];
package: 'Math-Chromosome' with: [ spec requires: #( 'MathVectorMatrix' ) ];
package: 'Math-Clustering' with: [ spec requires: #( 'Math-Numerical' 'Math-Core-Process' 'MathVectorMatrix' ) ];
package: 'Math-Complex' with: [ spec requires: #( 'Math-Numerical' 'Math-Polynomials' ) ];
package: 'Math-Helpers';
package: 'Math-Distributions' with: [ spec requires: #( 'MathVectorMatrix' 'Math-Quantile' 'Math-Core-Process' ) ];
package: 'Math-Core-Process' with: [ spec requires: #( 'Math-Helpers' ) ];
package: 'Math-Numerical'
with: [ spec requires: #( 'MathVectorMatrix' 'Math-Helpers' 'Math-Core-Process' 'Math-Distributions' 'Math-StatisticalMoments'
'Math-Series' ) ];
package: 'Math-Polynomials'
with: [ spec requires: #( 'MathVectorMatrix' 'Math-Helpers' 'Math-Core-Process' 'Math-Distributions' 'Math-StatisticalMoments'
'Math-Series' ) ];
package: 'Math-FastFourierTransform' with: [ spec requires: #( 'Math-Complex' ) ];
package: 'Math-FunctionFit'
with: [ spec requires: #( 'Math-Numerical' 'Math-Chromosome' 'Math-Accuracy-Core' 'MathVectorMatrix' 'Math-Helpers' 'Math-Polynomials' ) ];
package: 'Math-KDTree';
package: 'Math-Number-Extensions';
package: 'Math-ODE' with: [ spec requires: #( 'Math-Numerical' 'MathVectorMatrix' 'Math-Polynomials' ) ];
package: 'Math-Permutation' with: [ spec requires: #( 'MathVectorMatrix' 'Math-Core-Process' ) ];
package: 'Math-Physics-Constants';
package: 'Math-PrincipalComponentAnalysis' with: [ spec requires: #( 'Math-Numerical' 'MathVectorMatrix' 'Math-Polynomials' ) ];
package: 'Math-Quantile';
package: 'Math-Quaternion' with: [ spec requires: #( 'Math-Complex' 'Math-Numerical' 'Math-Polynomials' ) ];
package: 'Math-Series';
package: 'Math-StatisticalMoments' with: [ spec requires: #( 'Math-Helpers' 'Math-Distributions' ) ];
package: 'Math-TSNE';
package: 'Math-Tests-Accuracy' with: [ spec requires: #( 'Math-Accuracy-Core' ) ];
package: 'Math-Tests-ArbitraryPrecisionFloat' with: [ spec requires: #( 'Math-ArbitraryPrecisionFloat' ) ];
package: 'Math-Tests-AutomaticDifferenciation' with: [ spec requires: #( 'Math-AutomaticDifferenciation' 'MathVectorMatrix' ) ];
package: 'Math-Tests-Clustering' with: [ spec requires: #( 'Math-Clustering' 'Math-Distributions' 'Math-UtilsDataServer' ) ];
package: 'Math-Tests-Complex' with: [ spec requires: #( 'Math-Complex' ) ];
package: 'Math-Tests-Distributions' with: [ spec requires: #( 'Math-Distributions' ) ];
package: 'Math-Tests-Core-Process' with: [ spec requires: #( 'Math-Core-Process' ) ];
package: 'Math-Tests-Numerical' with: [ spec requires: #( 'Math-Numerical' 'Math-UtilsDataServer' ) ];
package: 'Math-Tests-FastFourierTransform' with: [ spec requires: #( 'Math-FastFourierTransform' 'Math-Numerical' 'Math-Polynomials' ) ];
package: 'Math-Tests-FunctionFit';
package: 'Math-Tests-KDTree' with: [ spec requires: #( 'Math-KDTree' ) ];
package: 'Math-Tests-Number-Extensions' with: [ spec requires: #( 'Math-Number-Extensions' ) ];
package: 'Math-Tests-ODE' with: [ spec requires: #( 'Math-ODE' ) ];
package: 'Math-Tests-Permutation' with: [ spec requires: #( 'Math-Permutation' ) ];
package: 'Math-Tests-PrincipalComponentAnalysis' with: [ spec requires: #( 'Math-PrincipalComponentAnalysis' ) ];
package: 'Math-Tests-Quantile' with: [ spec requires: #( 'Math-Quantile' ) ];
package: 'Math-Tests-Polynomials' with: [ spec requires: #( 'Math-Polynomials' ) ];
package: 'Math-Tests-Quaternion' with: [ spec requires: #( 'Math-Quaternion' ) ];
package: 'Math-Tests-TSNE' with: [ spec requires: #( 'Math-TSNE' ) ];
package: 'Math-UtilsDataServer'.
spec
group: 'Accuracy' with: #( 'Math-Accuracy-ODE' 'Math-Accuracy-Core' );
group: 'Benchmarks' with: #( 'Math-Benchmarks-ODE' 'Math-Benchmarks-KDTree' );
group: 'Core'
with:
#( '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' 'MathVectorMatrix' 'Math-Distributions' );
group: 'Extensions'
with: #( 'Math-Clustering' 'Math-Number-Extensions' 'Math-Chromosome' 'Math-PrincipalComponentAnalysis' 'Math-FunctionFit' 'Math-AutomaticDifferenciation'
'Math-Permutation' );
group: 'Tests'
with:
#( '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-Quantile' 'Math-Tests-Polynomials' 'Math-Tests-PrincipalComponentAnalysis' 'Math-Tests-Number-Extensions' 'Math-Tests-Permutation'
'Math-Tests-TSNE' 'Math-Tests-Core-Process' 'Math-Tests-Distributions' );
group: 'default' with: #( 'Core' 'Extensions' 'Tests' 'Benchmarks' 'Accuracy' ) ].

spec
package: 'ExtendedNumberParser';
package: 'Math-Accuracy-Core';
package: 'Math-Accuracy-ODE'
with: [ spec requires: #('Math-ODE' 'XMLWriter') ];
package: 'Math-ArbitraryPrecisionFloat'
with: [ spec requires: #('ExtendedNumberParser') ];
package: 'Math-AutomaticDifferenciation'
with: [ spec requires: #('Math-Numerical' 'PolyMathDataStructures') ];
package: 'Math-Benchmarks-KDTree'
with: [ spec requires: #('Math-KDTree' 'SMark') ];
package: 'Math-Benchmarks-ODE'
with: [ spec requires: #('Math-ODE' 'SMark' 'XMLWriter') ];
package: 'Math-Chromosome' with: [ spec requires: #('PolyMathDataStructures') ];
package: 'Math-Clustering' with: [ spec requires: #('Math-Numerical' 'Math-Core-Process' 'PolyMathDataStructures') ];
package: 'Math-Complex'
with: [ spec requires: #('Math-Numerical' 'Math-Polynomials') ];
package: 'Math-Helpers';
package: 'Math-Distributions' with: [ spec requires: #('PolyMathDataStructures' 'Math-Quantile' 'Math-Core-Process') ];
package: 'Math-Core-Process' with: [ spec requires: #('Math-Helpers') ];
package: 'Math-Numerical' with: [ spec requires: #('PolyMathDataStructures' 'Math-Helpers' 'Math-Core-Process' 'Math-Distributions' 'Math-StatisticalMoments' 'Math-Series') ];
package: 'Math-Polynomials' with: [ spec requires: #('PolyMathDataStructures' 'Math-Helpers' 'Math-Core-Process' 'Math-Distributions' 'Math-StatisticalMoments' 'Math-Series') ];
package: 'Math-FastFourierTransform'
with: [ spec requires: #('Math-Complex') ];
package: 'Math-FunctionFit'
with: [ spec
requires:
#('Math-Numerical' 'Math-Chromosome' 'Math-Accuracy-Core' 'PolyMathDataStructures' 'Math-Helpers' 'Math-Polynomials') ];
package: 'Math-KDTree';
package: 'Math-Number-Extensions';
package: 'Math-ODE' with: [ spec requires: #('Math-Numerical' 'PolyMathDataStructures' 'Math-Polynomials') ];
package: 'Math-Permutation' with: [ spec requires: #('PolyMathDataStructures' 'Math-Core-Process') ];
package: 'Math-Physics-Constants';
package: 'Math-PrincipalComponentAnalysis' with: [ spec requires: #('Math-Numerical' 'PolyMathDataStructures' 'Math-Polynomials') ];
package: 'Math-Quantile';
package: 'Math-Quaternion'
with:
[ spec requires: #('Math-Complex' 'Math-Numerical' 'Math-Polynomials') ];
package: 'Math-Series';
package: 'Math-StatisticalMoments' with: [ spec requires: #('Math-Helpers' 'Math-Distributions') ];
package: 'Math-TSNE';
package: 'Math-Tests-Accuracy'
with: [ spec requires: #('Math-Accuracy-Core') ];
package: 'Math-Tests-ArbitraryPrecisionFloat'
with: [ spec requires: #('Math-ArbitraryPrecisionFloat') ];
package: 'Math-Tests-AutomaticDifferenciation' with: [ spec requires: #('Math-AutomaticDifferenciation' 'PolyMathDataStructures') ];
package: 'Math-Tests-Clustering' with: [ spec requires: #('Math-Clustering' 'Math-Distributions' 'Math-UtilsDataServer') ];
package: 'Math-Tests-Complex'
with: [ spec requires: #('Math-Complex') ];
package: 'Math-Tests-Distributions'
with: [ spec requires: #('Math-Distributions') ];
package: 'Math-Tests-Core-Process'
with: [ spec requires: #('Math-Core-Process') ];
package: 'Math-Tests-Numerical'
with: [ spec requires: #('Math-Numerical' 'Math-UtilsDataServer') ];
package: 'Math-Tests-FastFourierTransform'
with: [ spec
requires: #('Math-FastFourierTransform' 'Math-Numerical' 'Math-Polynomials') ];
package: 'Math-Tests-FunctionFit';
package: 'Math-Tests-KDTree'
with: [ spec requires: #('Math-KDTree') ];
package: 'Math-Tests-Number-Extensions'
with: [ spec requires: #('Math-Number-Extensions') ];
package: 'Math-Tests-ODE' with: [ spec requires: #('Math-ODE') ];
package: 'Math-Tests-Permutation'
with: [ spec requires: #('Math-Permutation') ];
package: 'Math-Tests-PrincipalComponentAnalysis'
with: [ spec requires: #('Math-PrincipalComponentAnalysis') ];
package: 'Math-Tests-Quantile'
with: [ spec requires: #('Math-Quantile') ];
package: 'Math-Tests-Polynomials'
with: [ spec requires: #('Math-Polynomials') ];
package: 'Math-Tests-Quaternion'
with: [ spec requires: #('Math-Quaternion') ];
package: 'Math-Tests-TSNE'
with: [ spec requires: #('Math-TSNE') ];
package: 'Math-UtilsDataServer'.
spec
group: 'Accuracy'
with: #('Math-Accuracy-ODE' 'Math-Accuracy-Core');
group: 'Benchmarks'
with: #('Math-Benchmarks-ODE' 'Math-Benchmarks-KDTree');
group: 'Core'
with:
#('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-Distributions');
group: 'Extensions'
with:
#('Math-Clustering' 'Math-Number-Extensions' 'Math-Chromosome' 'Math-PrincipalComponentAnalysis' 'Math-FunctionFit' 'Math-AutomaticDifferenciation' 'Math-Permutation');
group: 'Tests'
with:
#('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-Quantile' 'Math-Tests-Polynomials' 'Math-Tests-PrincipalComponentAnalysis' 'Math-Tests-Number-Extensions' 'Math-Tests-Permutation' 'Math-Tests-TSNE' 'Math-Tests-Core-Process' 'Math-Tests-Distributions');
group: 'default'
with: #('Core' 'Extensions' 'Tests' 'Benchmarks' 'Accuracy') ].

spec for: #( #'pharo6.x' #'pharo7.x' #'pharo8.x' #'pharo9.x' #'pharo10.x' ) do: [
spec for: #( #'pharo6.x' #'pharo7.x' #'pharo8.x' #'pharo9.x' #'pharo10.x' ) do: [
spec
package: 'Math-Numerical' with: [ spec requires: #( 'Math-CompatibilityUpToPharo11' ) ];
package: 'Math-Benchmarks-KDTree' with: [ spec requires: #( 'Math-CompatibilityUpToPharo11' ) ];
package: 'Math-Tests-KDTree' with: [ spec requires: #( 'Math-CompatibilityUpToPharo11' ) ];
package: 'Math-CompatibilityUpToPharo11' ]
]

{ #category : #dependencies }
BaselineOfPolyMath >> polyMathDataStructures: spec [

spec baseline: 'PolyMathDataStructures' with: [ spec repository: 'github://PolyMathOrg/PolyMath-DataStructures:v1.x.x/src' ]
]

{ #category : #accessing }
BaselineOfPolyMath >> projectClass [
^ [ self class environment at: #MetacelloCypressBaselineProject ]
Expand All @@ -155,6 +126,12 @@ BaselineOfPolyMath >> sMark: spec [
spec baseline: 'SMark' with: [ spec repository: 'github://smarr/SMark:v1.0.4' ]
]

{ #category : #dependencies }
BaselineOfPolyMath >> vectorMatrix: spec [

spec baseline: 'MathVectorMatrix' with: [ spec repository: 'github://PolyMathOrg/vector-matrix:v1.x.x/src' ]
]

{ #category : #dependencies }
BaselineOfPolyMath >> xmlWriter: spec [

Expand Down
11 changes: 6 additions & 5 deletions src/Math-Core-Process/PMIterativeProcess.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ PMIterativeProcess class >> defaultMaximumIterations [
{ #category : #default }
PMIterativeProcess class >> defaultPrecision [
"Private - Answers the default precision for newly created instances."
^PMFloatingPointMachine new defaultNumericalPrecision

^ Float machineEpsilon
]

{ #category : #initialization }
Expand Down Expand Up @@ -119,10 +120,10 @@ PMIterativeProcess >> precision [

{ #category : #information }
PMIterativeProcess >> precisionOf: aNumber1 relativeTo: aNumber2 [
^aNumber2 > PMFloatingPointMachine new defaultNumericalPrecision
ifTrue: [ aNumber1 / aNumber2]
ifFalse:[ aNumber1]

^ aNumber2 > Float machineEpsilon
ifTrue: [ aNumber1 / aNumber2 ]
ifFalse: [ aNumber1 ]
]

{ #category : #information }
Expand Down
32 changes: 15 additions & 17 deletions src/Math-Distributions/PMIncompleteBetaFunction.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,27 @@ PMIncompleteBetaFunction class >> shape: aNumber1 shape: aNumber2 [
]

{ #category : #private }
PMIncompleteBetaFunction >> evaluateFraction: aNumber [
PMIncompleteBetaFunction >> evaluateFraction: aNumber [

fraction isNil
ifTrue:
[fraction := PMIncompleteBetaFractionTermServer new.
fraction setParameter: alpha1 second: alpha2].
fraction isNil ifTrue: [
fraction := PMIncompleteBetaFractionTermServer new.
fraction setParameter: alpha1 second: alpha2 ].
fraction setArgument: aNumber.
^(PMContinuedFraction server: fraction)
desiredPrecision: PMFloatingPointMachine new defaultNumericalPrecision;
evaluate
^ (PMContinuedFraction server: fraction)
desiredPrecision: Float machineEpsilon;
evaluate
]

{ #category : #private }
PMIncompleteBetaFunction >> evaluateInverseFraction: aNumber [
PMIncompleteBetaFunction >> evaluateInverseFraction: aNumber [

inverseFraction isNil
ifTrue:
[inverseFraction := PMIncompleteBetaFractionTermServer new.
inverseFraction setParameter: alpha2 second: alpha1].
inverseFraction setArgument: (1 - aNumber).
^(PMContinuedFraction server: inverseFraction)
desiredPrecision: PMFloatingPointMachine new defaultNumericalPrecision;
evaluate
inverseFraction isNil ifTrue: [
inverseFraction := PMIncompleteBetaFractionTermServer new.
inverseFraction setParameter: alpha2 second: alpha1 ].
inverseFraction setArgument: 1 - aNumber.
^ (PMContinuedFraction server: inverseFraction)
desiredPrecision: Float machineEpsilon;
evaluate
]

{ #category : #initialization }
Expand Down
28 changes: 13 additions & 15 deletions src/Math-Distributions/PMIncompleteGammaFunction.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,27 @@ PMIncompleteGammaFunction class >> shape: aNumber [
]

{ #category : #private }
PMIncompleteGammaFunction >> evaluateFraction: aNumber [
PMIncompleteGammaFunction >> evaluateFraction: aNumber [

fraction isNil
ifTrue:
[fraction := PMIncompleteGammaFractionTermServer new.
fraction setParameter: alpha].
fraction isNil ifTrue: [
fraction := PMIncompleteGammaFractionTermServer new.
fraction setParameter: alpha ].
fraction setArgument: aNumber.
^(PMContinuedFraction server: fraction)
desiredPrecision: PMFloatingPointMachine new defaultNumericalPrecision;
evaluate
^ (PMContinuedFraction server: fraction)
desiredPrecision: Float machineEpsilon;
evaluate
]

{ #category : #private }
PMIncompleteGammaFunction >> evaluateSeries: aNumber [

series isNil
ifTrue: [ series := PMIncompleteGammaSeriesTermServer new.
series setParameter: alpha.
].
series isNil ifTrue: [
series := PMIncompleteGammaSeriesTermServer new.
series setParameter: alpha ].
series setArgument: aNumber.
^(PMInfiniteSeries server: series)
desiredPrecision: PMFloatingPointMachine new defaultNumericalPrecision;
evaluate
^ (PMInfiniteSeries server: series)
desiredPrecision: Float machineEpsilon;
evaluate
]

{ #category : #initialization }
Expand Down
5 changes: 3 additions & 2 deletions src/Math-FunctionFit/PMAnotherGeneticOptimizer.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ Class {
'whateverHistory',
'originalFunction'
],
#category : 'Math-FunctionFit'
#category : #'Math-FunctionFit'
}

{ #category : #information }
PMAnotherGeneticOptimizer class >> defaultPrecision [
^PMFloatingPointMachine new machinePrecision

^ Float machineEpsilon
]

{ #category : #'instance creation' }
Expand Down
2 changes: 1 addition & 1 deletion src/Math-FunctionFit/PMGeneralFunctionFit.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ firstResult := go evaluate .
self errorType =#squared
ifTrue: [ff :=PMFunctionFit function: errorFunction function data: errorFunction data ].
ff parameters: firstResult.
ff desiredPrecision: PMFloatingPointMachine new machinePrecision.
ff desiredPrecision: Float machineEpsilon.
ff maximumIterations: 1000 .
result:=[ff evaluate .ff parameters]
onErrorDo: [
Expand Down
Loading