Skip to content

Stackoverflow when applying adjoint of blockbanded operator on function #659

Closed
@Jilhg

Description

@Jilhg

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions