From aa0bca8ae0c6a3fda8c1f38ed64faa87e5e53c8a Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 1 Mar 2023 11:18:32 +0100 Subject: [PATCH 1/3] Update dependency name --- .../BaselineOfPolyMath.class.st | 197 ++++++++---------- 1 file changed, 87 insertions(+), 110 deletions(-) diff --git a/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st b/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st index bd9e67ae..a0b639c1 100644 --- a/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st +++ b/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st @@ -17,112 +17,89 @@ Class { { #category : #baseline } BaselineOfPolyMath >> baseline: spec [ + - 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' '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 - 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' ) ]; @@ -130,12 +107,6 @@ BaselineOfPolyMath >> baseline: spec [ 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 ] @@ -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 [ From c2a3e7b9d784f5f65d485f97041e779d28946dd3 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 1 Mar 2023 11:20:56 +0100 Subject: [PATCH 2/3] Replace old names --- .../BaselineOfPolyMath.class.st | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st b/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st index a0b639c1..40945368 100644 --- a/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st +++ b/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st @@ -31,30 +31,30 @@ BaselineOfPolyMath >> baseline: spec [ 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-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: #( 'PolyMathDataStructures' ) ]; - package: 'Math-Clustering' with: [ spec requires: #( 'Math-Numerical' 'Math-Core-Process' 'PolyMathDataStructures' ) ]; + 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: #( 'PolyMathDataStructures' 'Math-Quantile' 'Math-Core-Process' ) ]; + 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: #( 'PolyMathDataStructures' 'Math-Helpers' 'Math-Core-Process' 'Math-Distributions' 'Math-StatisticalMoments' + with: [ spec requires: #( 'MathVectorMatrix' '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' + 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' 'PolyMathDataStructures' 'Math-Helpers' 'Math-Polynomials' ) ]; + 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' 'PolyMathDataStructures' 'Math-Polynomials' ) ]; - package: 'Math-Permutation' with: [ spec requires: #( 'PolyMathDataStructures' 'Math-Core-Process' ) ]; + 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' 'PolyMathDataStructures' 'Math-Polynomials' ) ]; + 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'; @@ -62,7 +62,7 @@ BaselineOfPolyMath >> baseline: spec [ 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-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' ) ]; @@ -87,7 +87,7 @@ BaselineOfPolyMath >> baseline: spec [ 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' ); + 'Math-Helpers' 'MathVectorMatrix' 'Math-Distributions' ); group: 'Extensions' with: #( 'Math-Clustering' 'Math-Number-Extensions' 'Math-Chromosome' 'Math-PrincipalComponentAnalysis' 'Math-FunctionFit' 'Math-AutomaticDifferenciation' 'Math-Permutation' ); From 6a458b63ed299ba258c5c1268ea89675a166e815 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 9 Mar 2023 15:31:46 +0100 Subject: [PATCH 3/3] Try to use Pharo precision to see if Polymath can handle that --- .../PMIterativeProcess.class.st | 11 ++--- .../PMIncompleteBetaFunction.class.st | 32 +++++++------- .../PMIncompleteGammaFunction.class.st | 28 ++++++------ .../PMAnotherGeneticOptimizer.class.st | 5 ++- .../PMGeneralFunctionFit.class.st | 2 +- .../PMFloatingPointMachine.class.st | 33 +------------- src/Math-Numerical/Number.extension.st | 6 +-- .../PMOneVariableFunctionOptimizer.class.st | 5 ++- .../PMSimplexOptimizer.class.st | 5 ++- src/Math-Polynomials/PMPolynomial.class.st | 6 +-- .../PMFloatingPointMachineTestCase.class.st | 43 ------------------- .../PMNumericalMethodsTestCase.class.st | 24 +++++------ .../PMPolynomialTest.class.st | 19 +++----- 13 files changed, 67 insertions(+), 152 deletions(-) diff --git a/src/Math-Core-Process/PMIterativeProcess.class.st b/src/Math-Core-Process/PMIterativeProcess.class.st index 7c7b8f19..81c24a31 100644 --- a/src/Math-Core-Process/PMIterativeProcess.class.st +++ b/src/Math-Core-Process/PMIterativeProcess.class.st @@ -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 } @@ -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 } diff --git a/src/Math-Distributions/PMIncompleteBetaFunction.class.st b/src/Math-Distributions/PMIncompleteBetaFunction.class.st index 6e28d3f5..15571d3e 100644 --- a/src/Math-Distributions/PMIncompleteBetaFunction.class.st +++ b/src/Math-Distributions/PMIncompleteBetaFunction.class.st @@ -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 } diff --git a/src/Math-Distributions/PMIncompleteGammaFunction.class.st b/src/Math-Distributions/PMIncompleteGammaFunction.class.st index 321b11e4..d15912fa 100644 --- a/src/Math-Distributions/PMIncompleteGammaFunction.class.st +++ b/src/Math-Distributions/PMIncompleteGammaFunction.class.st @@ -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 } diff --git a/src/Math-FunctionFit/PMAnotherGeneticOptimizer.class.st b/src/Math-FunctionFit/PMAnotherGeneticOptimizer.class.st index fefe31be..791e3dc3 100644 --- a/src/Math-FunctionFit/PMAnotherGeneticOptimizer.class.st +++ b/src/Math-FunctionFit/PMAnotherGeneticOptimizer.class.st @@ -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' } diff --git a/src/Math-FunctionFit/PMGeneralFunctionFit.class.st b/src/Math-FunctionFit/PMGeneralFunctionFit.class.st index 15791cd8..43dd37e6 100644 --- a/src/Math-FunctionFit/PMGeneralFunctionFit.class.st +++ b/src/Math-FunctionFit/PMGeneralFunctionFit.class.st @@ -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: [ diff --git a/src/Math-Helpers/PMFloatingPointMachine.class.st b/src/Math-Helpers/PMFloatingPointMachine.class.st index 5f0f53ab..00821dcf 100644 --- a/src/Math-Helpers/PMFloatingPointMachine.class.st +++ b/src/Math-Helpers/PMFloatingPointMachine.class.st @@ -19,9 +19,7 @@ Class { #name : #PMFloatingPointMachine, #superclass : #Object, #instVars : [ - 'defaultNumericalPrecision', 'radix', - 'machinePrecision', 'negativeMachinePrecision', 'smallestNumber', 'largestNumber', @@ -60,19 +58,6 @@ PMFloatingPointMachine >> computeLargestNumber [ ] on: Error do: [ :signal | signal return: nil] ] -{ #category : #information } -PMFloatingPointMachine >> computeMachinePrecision [ - - | one zero inverseRadix tmp | - one := 1.0. - zero := 0.0. - inverseRadix := one / self radix asFloat. - machinePrecision := one. - [ tmp := one + machinePrecision. - tmp - one = zero] - whileFalse:[ machinePrecision := machinePrecision * inverseRadix] -] - { #category : #information } PMFloatingPointMachine >> computeNegativeMachinePrecision [ @@ -122,14 +107,6 @@ PMFloatingPointMachine >> computeSmallestNumber [ on: Error do: [:signal | signal return: nil] ] -{ #category : #information } -PMFloatingPointMachine >> defaultNumericalPrecision [ - - defaultNumericalPrecision isNil - ifTrue: [ defaultNumericalPrecision := self machinePrecision sqrt]. - ^defaultNumericalPrecision -] - { #category : #information } PMFloatingPointMachine >> largestExponentArgument [ @@ -146,14 +123,6 @@ PMFloatingPointMachine >> largestNumber [ ^largestNumber ] -{ #category : #information } -PMFloatingPointMachine >> machinePrecision [ - - machinePrecision isNil - ifTrue: [ self computeMachinePrecision]. - ^machinePrecision -] - { #category : #information } PMFloatingPointMachine >> negativeMachinePrecision [ @@ -179,7 +148,7 @@ PMFloatingPointMachine >> showParameters [ nextPutAll: 'Radix: '. self radix printOn: Transcript. Transcript cr; nextPutAll: 'Machine precision: '. - self machinePrecision printOn: Transcript. + Float machineEpsilon printOn: Transcript. Transcript cr; nextPutAll: 'Negative machine precision: '. self negativeMachinePrecision printOn: Transcript. Transcript cr; nextPutAll: 'Smallest number: '. diff --git a/src/Math-Numerical/Number.extension.st b/src/Math-Numerical/Number.extension.st index 52141b85..0156e4b2 100644 --- a/src/Math-Numerical/Number.extension.st +++ b/src/Math-Numerical/Number.extension.st @@ -64,12 +64,12 @@ Number >> logGamma [ { #category : #'*Math-Numerical' } Number >> relativelyEqualsTo: aNumber upTo: aSmallNumber [ - "compare to Float>>closeTo: + "compare to Float>>closeTo: generally called from Number>>equalsTo:" + | norm | norm := self abs max: aNumber abs. - ^norm <= PMFloatingPointMachine new defaultNumericalPrecision - or: [ (self - aNumber) abs < ( aSmallNumber * norm)] + ^ norm <= Float machineEpsilon or: [ (self - aNumber) abs < (aSmallNumber * norm) ] ] { #category : #'*Math-Numerical' } diff --git a/src/Math-Numerical/PMOneVariableFunctionOptimizer.class.st b/src/Math-Numerical/PMOneVariableFunctionOptimizer.class.st index b5982e19..f14b3b99 100644 --- a/src/Math-Numerical/PMOneVariableFunctionOptimizer.class.st +++ b/src/Math-Numerical/PMOneVariableFunctionOptimizer.class.st @@ -9,8 +9,9 @@ Class { { #category : #information } PMOneVariableFunctionOptimizer class >> defaultPrecision [ - "Private" - ^PMFloatingPointMachine new defaultNumericalPrecision * 10 + "Private" + + ^ Float machineEpsilon * 10 ] { #category : #information } diff --git a/src/Math-Numerical/PMSimplexOptimizer.class.st b/src/Math-Numerical/PMSimplexOptimizer.class.st index f1ebe50f..3e438375 100644 --- a/src/Math-Numerical/PMSimplexOptimizer.class.st +++ b/src/Math-Numerical/PMSimplexOptimizer.class.st @@ -9,8 +9,9 @@ Class { { #category : #information } PMSimplexOptimizer class >> defaultPrecision [ - "Private" - ^PMFloatingPointMachine new defaultNumericalPrecision * 1000 + "Private" + + ^ Float machineEpsilon * 1000 ] { #category : #operation } diff --git a/src/Math-Polynomials/PMPolynomial.class.st b/src/Math-Polynomials/PMPolynomial.class.st index 6ce3dafc..813692ef 100644 --- a/src/Math-Polynomials/PMPolynomial.class.st +++ b/src/Math-Polynomials/PMPolynomial.class.st @@ -17,7 +17,7 @@ Class { #instVars : [ 'coefficients' ], - #category : 'Math-Polynomials' + #category : #'Math-Polynomials' } { #category : #creation } @@ -233,8 +233,8 @@ PMPolynomial >> reciprocal [ { #category : #information } PMPolynomial >> roots [ - - ^self roots: PMFloatingPointMachine new defaultNumericalPrecision + + ^ self roots: Float machineEpsilon ] { #category : #information } diff --git a/src/Math-Tests-Numerical/PMFloatingPointMachineTestCase.class.st b/src/Math-Tests-Numerical/PMFloatingPointMachineTestCase.class.st index c6f885e8..2d009b15 100644 --- a/src/Math-Tests-Numerical/PMFloatingPointMachineTestCase.class.st +++ b/src/Math-Tests-Numerical/PMFloatingPointMachineTestCase.class.st @@ -4,49 +4,6 @@ Class { #category : #'Math-Tests-Numerical' } -{ #category : #precision } -PMFloatingPointMachineTestCase >> testMachinePrecision [ - | mach | - mach := PMFloatingPointMachine new. - self assert: mach machinePrecision > 0. - self assert: mach machinePrecision < 1. - self assert: mach negativeMachinePrecision > 0. - self assert: mach negativeMachinePrecision < 1. - self - assert: (mach radix raisedTo: mach negativeMachinePrecision) - equals: 1.0. - self assert: (mach radix raisedTo: mach machinePrecision) equals: 1.0 -] - -{ #category : #precision } -PMFloatingPointMachineTestCase >> testMachinePrecisionIsFloatPrecision [ - "sanity check. Take logs to find the exponent, then compare to Float's method" - - | prec | - prec := (PMFloatingPointMachine new machinePrecision ln - / PMFloatingPointMachine new radix ln) negated. - self assert: prec equals: Float precision -] - -{ #category : #precision } -PMFloatingPointMachineTestCase >> testMachinePrecisionLargestNumberGreaterThanAnyFractionOfItself [ - | mach | - mach := PMFloatingPointMachine new. - self - assert: - mach largestNumber * (1 - mach defaultNumericalPrecision) - < mach largestNumber -] - -{ #category : #precision } -PMFloatingPointMachineTestCase >> testMachinePrecisionLargestNumberIsLargest [ - | mach | - mach := PMFloatingPointMachine new. - self - assert: mach largestNumber * (1 + mach defaultNumericalPrecision) - equals: Float infinity -] - { #category : #precision } PMFloatingPointMachineTestCase >> testMachinePrecisionLargestNumberNotInfinity [ | mach | diff --git a/src/Math-Tests-Numerical/PMNumericalMethodsTestCase.class.st b/src/Math-Tests-Numerical/PMNumericalMethodsTestCase.class.st index d81c8e91..e68d5ca0 100644 --- a/src/Math-Tests-Numerical/PMNumericalMethodsTestCase.class.st +++ b/src/Math-Tests-Numerical/PMNumericalMethodsTestCase.class.st @@ -94,16 +94,10 @@ PMNumericalMethodsTestCase >> testErrorFunction [ "simple cases to expect" self assert: 0 errorFunction equals: 1 / 2. - self - assert: - PMFloatingPointMachine new largestNumber errorFunction - > (1 - PMFloatingPointMachine new machinePrecision). + self assert: PMFloatingPointMachine new largestNumber errorFunction > (1 - Float machineEpsilon). "add some code to require initialize to run" PMErfApproximation reset. - self - assert: - PMFloatingPointMachine new largestNumber negated errorFunction - < PMFloatingPointMachine new smallestNumber + self assert: PMFloatingPointMachine new largestNumber negated errorFunction < PMFloatingPointMachine new smallestNumber ] { #category : #estimation } @@ -461,19 +455,23 @@ PMNumericalMethodsTestCase >> testLineSearch3 [ This case does not require line search, should return 1. " + | xOld eps p functionBlock g0 g1 dg0 lineSearch xAnswer | - eps := PMFloatingPointMachine new defaultNumericalPrecision. + eps := Float machineEpsilon. xOld := -1.0 + eps. p := eps. - functionBlock := [ :t | 0.5 * ((t * p + xOld) + 1) squared ]. + functionBlock := [ :t | 0.5 * (t * p + xOld + 1) squared ]. g0 := functionBlock value: 0. g1 := functionBlock value: 1. dg0 := 2.0 * g0 negated. - lineSearch := PMLineSearch function: functionBlock valueAtZero: g0 derivativeAtZero: dg0 valueAtOne: g1. + lineSearch := PMLineSearch + function: functionBlock + valueAtZero: g0 + derivativeAtZero: dg0 + valueAtOne: g1. lineSearch desiredPrecision: eps. xAnswer := lineSearch evaluate. - self assert: xAnswer equals: 1.0. - + self assert: xAnswer equals: 1.0 ] { #category : #'linear algebra' } diff --git a/src/Math-Tests-Polynomials/PMPolynomialTest.class.st b/src/Math-Tests-Polynomials/PMPolynomialTest.class.st index b9599314..b98c1089 100644 --- a/src/Math-Tests-Polynomials/PMPolynomialTest.class.st +++ b/src/Math-Tests-Polynomials/PMPolynomialTest.class.st @@ -1,7 +1,7 @@ Class { #name : #PMPolynomialTest, #superclass : #TestCase, - #category : 'Math-Tests-Polynomials' + #category : #'Math-Tests-Polynomials' } { #category : #comparing } @@ -234,21 +234,12 @@ PMPolynomialTest >> testPolynomialRoots [ "Code Example 5.5" | polynomial roots | - polynomial := PMPolynomial coefficients: #(-10 -13 -2 1). + polynomial := PMPolynomial coefficients: #( -10 -13 -2 1 ). roots := polynomial roots asSortedCollection asArray. self assert: roots size equals: 3. - self - assert: - ((roots at: 1) + 2) abs - < PMFloatingPointMachine new defaultNumericalPrecision. - self - assert: - ((roots at: 2) + 1) abs - < PMFloatingPointMachine new defaultNumericalPrecision. - self - assert: - ((roots at: 3) - 5) abs - < PMFloatingPointMachine new defaultNumericalPrecision + self assert: ((roots at: 1) + 2) abs < Float machineEpsilon. + self assert: ((roots at: 2) + 1) abs < Float machineEpsilon. + self assert: ((roots at: 3) - 5) abs < Float machineEpsilon ] { #category : #'function evaluation' }