-
Notifications
You must be signed in to change notification settings - Fork 182
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
legendre polynomials and gaussian quadrature #313
Conversation
- Added preliminary implementation for Legendre polynomial first derivatives - Added preliminary implementation for Gauss-Legendre quadrature points/weights - Added preliminary implementation for Gauss-Legendre-Lobatto quadrature points/weights
src/stdlib_quadrature_gauss.f90
Outdated
w(N+1) = 2._dp/(N*(N+1._dp)) | ||
|
||
do i = 1, int(floor((N+1)/2._dp)-1) | ||
x(i+1) = -cos( (i+0.25_dp)*PI/N - 3/(8*N*PI*(i+0.25_dp))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A comment containing the source for the initial guess could be helpful.
I have a comment regarding the implementation --- what is the accuracy? I had bad experience with higher order (say Let's mainly discuss the API first. I would remove |
The
The default is
|
How so? I think you are mistaken here. Whether the actual arguments are allocatable is irrelevant. Are you thinking that the |
Co-authored-by: Sebastian Ehlert <[email protected]>
@nncarlson, you are right I am mistaken. The concern would only be valid, if the |
Thank you @hsnyder. I didn't do a proper review yet, but two things stood out on a cursory skim through:
|
Unfortunately, the lower-case |
|
Right... My next suggestion then are |
Thanks everyone for the input so far!
@milancurcic The only thing I can really think of is "special functions". Acceptable? |
"Special functions" is the general term that is used for this part of
mathematics. So I'd say it is certainly acceptable.
Op ma 8 feb. 2021 om 21:04 schreef Harris Snyder <[email protected]>:
… Thanks everyone for the input so far!
Thank you @hsnyder <https://github.com/hsnyder>. I didn't do a proper
review yet, but two things stood out on a cursory skim through:
1. stdlib_functions.f90 for the source file and `stdlib_functions` for the module are not informative IMO. Is there some descriptive name we can use? What kind of functions are these?
@milancurcic <https://github.com/milancurcic> The only thing I can really
think of is "special functions". Acceptable?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#313 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN6YR3LY6EDIRWOMNN6FRDS6A7TPANCNFSM4XIIGT3Q>
.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a remark: the do-loop at line 33 runs from 0 to newton_iters-1. As the do-loop variable is not explicitly used, I would say: let it run from 1 to newton_iters instead.
haha you can tell I'm a C programmer... I will fix this |
…in accordance to a review comment
sorry for the delay I have been very busy. other than resolving the makefile conflicts, what are the next steps towards getting this merged? I will try to get to the conflicts in the makefiles sometime this week but if I can't and someone else wants to, please feel free :) |
@awvwgk sorry for the delay. I think test cases and a spec are the outstanding items. In principle anyone could write them but it would obviously be easiest for me to do so. I’ve been very busy for the past few weeks but things are starting to ease up. I think I can finish this off this week. I will post again when I’ve done so. |
Sorry for the delay! I've added some tests and specs for the new quadrature functions and the special functions module. Please let me know if any revisions are required. note: I wasn't sure how to validate the the spec format is correct. I tried to follow the examples already present but I may have made errors and am not sure how to check it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot, looks good to me now. Only a few comments regarding the markup.
Co-authored-by: Sebastian Ehlert <[email protected]>
Co-authored-by: Sebastian Ehlert <[email protected]>
Co-authored-by: Sebastian Ehlert <[email protected]>
Co-authored-by: Sebastian Ehlert <[email protected]>
Co-authored-by: Sebastian Ehlert <[email protected]>
Co-authored-by: Sebastian Ehlert <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @hsnyder and reviewers!
I have one last minute question and suggestion: What do you think about renaming everything that's called stdlib_specialfunctions*
to stdlib_special*
? I find specialfunctions
quite long and a bit hard to read because two words are together, and special
is clear enough what it means IMO.
I think this PR can go forward either way, but I'd prefer if we called this just stdlib_special
.
Hi @milancurcic , I prefer specialfunctions because of clarity, but I don't have strong feelings about it. On the one hand, I agree that "special" is shorter, easier to type and read, but on the other hand it's not very descriptive (I don't think "special" on it's own is very clear - the stdlib includes more than just math, so I think "special what?" is a perfectly valid reaction). I'll wait ~ 24 hours for any additional opinions re: the name change and then I'll merge the request. Thanks very much for reviewing! |
An alternative might be "stdlib_specfunc" - though perhaps that is too
reminiscent of other packages/libraries in other languages?
Op di 29 jun. 2021 om 00:31 schreef Harris Snyder ***@***.***
…:
Hi @milancurcic <https://github.com/milancurcic> , I prefer
specialfunctions because of clarity, but I don't have strong feelings about
it. On the one hand, I agree that "special" is shorter, easier to type and
read, but on the other hand it's not very descriptive (I don't think
"special" on it's own is very clear - the stdlib includes more than just
math, so I think "special what?" is a perfectly valid reaction).
I'll wait ~ 24 hours for any additional opinions re: the name change and
then I'll merge the request. Thanks very much for reviewing!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#313 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN6YR3EK6PFZU6UA4MZVPTTVDZ5NANCNFSM4XIIGT3Q>
.
|
So it turns out I cannot merge this myself as I don't have write access. @milancurcic are you able to do so? Feel free to change the name if you want (though I still prefer "specialfunctions", or Arjen's suggestion instead of just "special"). Thanks! |
Thanks, @hsnyder, I'll merge as is. |
Unless I missed something, there should not be x(1) = interval(1) and x(size(x)) = interval(2) in gauss_legendre subroutines, this would only be relevant for gauss_legendre_lobatto. |
link to proposal: #277