Skip to content

Commit ea7419e

Browse files
refactor: Move Method to a more sensible place.
1 parent eee00a7 commit ea7419e

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/Math-Numerical/PMNewtonZeroFinder.class.st

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ PMNewtonZeroFinder class >> function: aBlock1 derivative: aBlock2 [
3939
^(self new) setFunction: aBlock1; setDerivative: aBlock2; yourself
4040
]
4141

42+
{ #category : #information }
43+
PMNewtonZeroFinder class >> rootFindingAlgorithmWith: precision [
44+
45+
| rootFinder |
46+
rootFinder := PMNewtonZeroFinder new.
47+
rootFinder desiredPrecision: precision.
48+
^ rootFinder
49+
]
50+
4251
{ #category : #operation }
4352
PMNewtonZeroFinder >> computeInitialValues [
4453
"Private - If no derivative has been defined, take an ad-hoc definition.

src/Math-Polynomials/PMPolynomial.class.st

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,6 @@ PMPolynomial class >> coefficients: anArray [
2626
^self new initialize: anArray reverse
2727
]
2828

29-
{ #category : #information }
30-
PMPolynomial class >> rootFindingAlgorithmWith: precision [
31-
32-
| rootFinder |
33-
rootFinder := PMNewtonZeroFinder new.
34-
rootFinder desiredPrecision: precision.
35-
^ rootFinder
36-
]
37-
3829
{ #category : #operation }
3930
PMPolynomial >> * aNumberOrPolynomial [
4031

@@ -250,7 +241,7 @@ PMPolynomial >> reciprocal [
250241

251242
{ #category : #information }
252243
PMPolynomial >> rootFindingAlgorithmWith: precision [
253-
^ self class rootFindingAlgorithmWith: precision
244+
^ PMNewtonZeroFinder rootFindingAlgorithmWith: precision
254245
]
255246

256247
{ #category : #information }

0 commit comments

Comments
 (0)