Repository navigation
bisection method for minimization added - #1
Conversation
|
Thanks for the patch! I don't like this coding style... we should improve it somehow. @MohawkJohn what do you think about adopting GitHub coding styleguide? Apart from that, it's all good. :) |
|
Thanks @agarie |
|
So I'm not @clbustos, and he may say otherwise, but I'd like to see a little bit clearer variable names. If not, if the bisection method names its variables like this, then you should include a description of what the variables do. Regardless, can you please cite the source of your code / this method? It's important for us to verify with all patches that we're honoring other people's licenses. |
|
The Bisection method is implemented taking directives from the book Numerical Analysis by R.L. Burden, J. Faires. I have mentioned the names of the authors in the comments just after the usage examples. I will also comment the code so as to mention the importance of each of the variables soon. Please let me know if I could change anything else for the betterment of the code. |
|
And just to check, does the licensing on the book say anything about how On Wed, Feb 19, 2014 at 1:53 PM, Rajat Kapoor notifications@github.comwrote:
|
|
The licensing on the book does not say anything about the algorithms, it just states a general statement: But I really don't think that this algorithm is the intellectual property of the writer, because it is a widely used algorithm. Also the wikipedia page for the algorithm states the same book as the source. I could cite the source as the wiki article, which would not be a problem, as WIki uses Creative Commons ShareAlike license. |
|
Yeah, I'd say mention in the comments both places, and that you assume the Wikipedia editor who added it there had permission from the author. Another option is to figure out where the author of the book got it (usually they cite these things) and look that up. Probably a peer-reviewed paper or something, which you can cite. |
|
The book, unfortunately, does not mention any sources of the algorithm. Maybe it is because that is algorithm is very basic and is based on the concept of binary search algorithm and intermediate value theorem. I will cite the wiki page for this one. |
bisection method for minimization added
I have added the bisection method for minimization.
Below is the output log for first 15 iterations compared to the results given on the wikipedia page (https://en.wikipedia.org/wiki/Bisection_method#Example:_Finding_the_root_of_a_polynomial).
The results match.
NOTE:
The wikipedia page mentions the first iteration in the state before the iteration, but my log mentions the state of the interval after the iteration, because that was the convention followed in the previously implemented Golden Section Method. Also, the
Cnmentioned on the wikipedia page is equivalent tobxin my code(again following the convention of the previously written code)PS: I will come up with a test suite for all methods soon.
Thanks