Skip to content

Implement gausslobatto / gaussradau and Monic #199

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

Merged
merged 7 commits into from
Aug 6, 2024

Conversation

DanielVandH
Copy link
Member

Implements gaussradau and gausslobatto for computing quadrature weights using Gauss-Radau or Gauss-Lobatto quadrature, respectively.

Is there a proper way I should be getting the monic polynomials? Or are my loops fine?

@dlfivefifty
Copy link
Member

There is a routine forwardrecurrence! that builds OPs fast. The benefit over the for-loop is it special cases Zeros, Vcat, etc. to get high-efficiency. Whereas your for-loop will need to do slow checks.

But the cost of building the OPs is so fast compared to computing eigenvalues it wouldn't matter anyways.

Though perhaps its worth making a Monic type a la Normalized to just abstract away this step?

Copy link

codecov bot commented Jul 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.06%. Comparing base (cc668ce) to head (dcb37b7).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #199      +/-   ##
==========================================
+ Coverage   90.75%   91.06%   +0.31%     
==========================================
  Files          17       18       +1     
  Lines        1936     1992      +56     
==========================================
+ Hits         1757     1814      +57     
+ Misses        179      178       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@DanielVandH
Copy link
Member Author

DanielVandH commented Jul 22, 2024

Would you prefer I rewrite it using forwardrecurrence!? I didn't know about that function I forgot it can be used for that. Is it still as fast if I need to store pn and pn-1? If not maybe coming back to Monic eventually and rewriting this would be a good approach too.

@dlfivefifty
Copy link
Member

I think making a type for Monic and just using your for loop implementation for getindex with a comment about rewriting in the future would be good. This way if we need monic OPs for something in the future we remember that code is there!

@DanielVandH
Copy link
Member Author

Alright. I'll add Monic to this PR (or I can make a second PR if you prefer?) and reuse it, good idea.

@DanielVandH
Copy link
Member Author

Now added Monic. Just added the basics for now and I guess if/when another need for it comes up we can figure out the details a bit better

@DanielVandH DanielVandH changed the title Implement gausslobatto / gaussradau Implement gausslobatto / gaussradau and Monic Jul 23, 2024
@DanielVandH DanielVandH requested a review from dlfivefifty July 23, 2024 10:59
@DanielVandH
Copy link
Member Author

Anything left to do here?

@@ -0,0 +1,38 @@
struct Monic{T,OPs<:AbstractQuasiMatrix{T},NL} <: OrthogonalPolynomial{T}
P::Normalized{T,OPs,NL}
Copy link
Member

Choose a reason for hiding this comment

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

Does this actually benefit from requiring normalized OPs?

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes the code for getting the recurrence coefficients simpler I think

@dlfivefifty dlfivefifty merged commit 3dbb5db into JuliaApproximation:main Aug 6, 2024
6 checks passed
@DanielVandH DanielVandH deleted the quad branch August 7, 2024 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants