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

Stackoverflow when applying adjoint of blockbanded operator on function #659

Closed
Jilhg opened this issue Aug 4, 2024 · 1 comment
Closed

Comments

@Jilhg
Copy link
Contributor

Jilhg commented Aug 4, 2024

I get an stackoverflow error when I try to apply an adjoint of a blockbanded operator on a function. For instance

Op=Derivative(Chebyshev())⊗Derivative(Chebyshev())
f=Fun(sin)⊗Fun(sin)
Op*f # works fine
Op'*f # Stackoverflow

I believe this is due to blockbandwidths(P::AdjointOperator) not being implemented for adjoint operators (while bandwidths(P::AdjointOperator) is implemented in OperatorLayout.jl) and thus the operator is not considered blockbanded. Indeed

println(ApproxFunBase.blockbandwidths(Op)) # (-2, 2)
println(ApproxFunBase.blockbandwidths(Op')) # (ℵ₀, ℵ₀)

The following implementation did the job for me:

ApproxFunBase.blockbandwidths(A::AdjointOperator) = reverse(ApproxFunBase.blockbandwidths(A.op))
println(ApproxFunBase.blockbandwidths(Op')) # (2,-2)

and Op'*f works.

@jishnub
Copy link
Member

jishnub commented Aug 4, 2024

Would you mind submitting a PR?

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