New linear algebra algorithm#1122
Merged
cclauss merged 10 commits intoTheAlgorithms:masterfrom Aug 12, 2019
nic-dern:new-lin-alg
Merged
New linear algebra algorithm#1122cclauss merged 10 commits intoTheAlgorithms:masterfrom nic-dern:new-lin-alg
cclauss merged 10 commits intoTheAlgorithms:masterfrom
nic-dern:new-lin-alg
Conversation
cclauss
requested changes
Aug 11, 2019
Member
There was a problem hiding this comment.
Thanks for the contribution!! Since we are building up a library of algotithms, it would be really cool of you could create a function like def points_to_polynomial(points): that takes in some points and returns a polynomial. That will make it easier for others to move you algorithm into their own programs and will allow us to write tests for that function. Leave all the input() and print() statements outside of that function.
cclauss
requested changes
Aug 11, 2019
cclauss
reviewed
Aug 11, 2019
Member
|
Current behavior... python3 linear_algebra/src/python-polynom-for-points.py The program cannot work out a fitting polynomial.
The program cannot work out a fitting polynomial.
Traceback (most recent call last):
File "linear_algebra/src/python-polynom-for-points.py", line 107, in <module>
print(points_to_polynomial([[1, 5], [2, 2], [3, 9]]))
File "linear_algebra/src/python-polynom-for-points.py", line 35, in points_to_polynomial
if check==1:
UnboundLocalError: local variable 'check' referenced before assignment |
cclauss
approved these changes
Aug 12, 2019
stokhos
pushed a commit
to stokhos/Python
that referenced
this pull request
Jan 3, 2021
* Added new algorithm which takes points as an input and outputs a polynom connecting them * Rename Python-Polynom-for-points.py to python-polynom-for-points.py * Update python-polynom-for-points.py * Update python-polynom-for-points.py * Update python-polynom-for-points.py * Update python-polynom-for-points.py * Update python-polynom-for-points.py * Update python-polynom-for-points.py * Update python-polynom-for-points.py * Add doctests and run thru psf/black
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey,
I added a new linear algebra algorithm which takes a number of x and y coordinates as input and then outputs a polynomial function that connects them.
Thank you for taking a look at it.