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

Integral of (basis) functions #125

Closed
jagot opened this issue Dec 6, 2021 · 1 comment
Closed

Integral of (basis) functions #125

jagot opened this issue Dec 6, 2021 · 1 comment

Comments

@jagot
Copy link
Member

jagot commented Dec 6, 2021

What would be a sensible interface for computing integrals? If 'B' is a Basis (or suitable QuasiMatrix), c the expansion coefficients of a function, and f = B*c the function expanded over B, I'm thinking

  • integral(f) would give me the integral of the function,
  • integral(B) would give me an adjoint vector with the integral of each individual basis function, which I can dot with c to get the same as integral(f),
  • integral(B[Inclusion(a..b),:]) would integrate the basis functions on a subinterval a..b,
  • integral(B*QuasiDiagonal(f.(axes(B,1))) would integrate each basis function, weighted by the function f(x).

Instead of integral, I guess sum would be a good name, but that's already taken for something I am not completely sure what it does (maybe exactly this?).

In any case, it tells me I need to Override for ContinuumArrays.BasisLayout(). If this is what I want, what is the canonical way to do this?

@dlfivefifty
Copy link
Member

sum and sum(B; dims=1) is what you want

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

No branches or pull requests

2 participants