Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Polynomials: Extract Method to Introduce RootFinder Factory Method and Tighten Encapsulation #322

Merged
merged 20 commits into from
Dec 25, 2023

Conversation

hemalvarambhia
Copy link
Contributor

@hemalvarambhia hemalvarambhia commented Dec 24, 2023

  • Extracted a factory method that generates a root finder with a given precision;
  • added some missing tests that felt interesting.
    Another test might be to test roots that are in the Complex plane.

@hemalvarambhia hemalvarambhia changed the title Polynomials: Extract Method Refactoring: RootFinder Factory Method Refactor Polynomials: Extract Method to Introduce RootFinder Factory Method and Tighten Encapsulation Dec 24, 2023
@@ -26,6 +26,15 @@ PMPolynomial class >> coefficients: anArray [
^self new initialize: anArray reverse
]

{ #category : #information }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I would put this method on the class side but I could understand.
Now why the PMNewtonZeroFinder does not define a creation class method desiredPrecision: like that you do not need this method and the class PMNewtonZeroFinder gets improved.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw that you did it :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I had to take smaller steps in order to keep our tests green.

@Ducasse Ducasse merged commit 761fb9a into master Dec 25, 2023
8 checks passed
@hemalvarambhia hemalvarambhia deleted the refactor-polynomials-tests branch December 25, 2023 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants