Skip to content

Infinite default bandwidth for PartialInverseOperator #477

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 3 commits into from
Jun 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ApproxFunBase"
uuid = "fbd15aa5-315a-5a7d-a8a4-24992e37be05"
version = "0.8.31"
version = "0.8.32"

[deps]
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
Expand Down
34 changes: 17 additions & 17 deletions src/Operators/general/PartialInverseOperator.jl
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
export PartialInverseOperator

"""
PartialInverseOperator(O::Operator, bandwidths = bandwidths(O))
PartialInverseOperator(O::Operator, bandwidths = (0, Infinities.ℵ₀))

Return an approximate estimate for `inv(O)`, such that `PartialInverseOperator(O) * O` is banded, and
is approximately `I` up to a bandwidth that is one less than the sum of the bandwidths
of `O` and `PartialInverseOperator(O)`.

!!! note
Only upper triangular operators are supported as of now.
Only upper-triangular operators are supported as of now.

# Examples

```jldoctest
julia> C = Conversion(Chebyshev(), Ultraspherical(1));

julia> P = PartialInverseOperator(C); # default bandwidth = (0,2)
julia> P = PartialInverseOperator(C); # default bandwidth

julia> P * C
TimesOperator : Chebyshev() → Chebyshev()
1.0 0.0 0.0 0.0 -0.5 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅
⋅ 1.0 0.0 0.0 0.0 -1.0 ⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ 1.0 0.0 0.0 0.0 -1.0 ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ 1.0 0.0 0.0 0.0 -1.0 ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ 1.0 0.0 0.0 0.0 -1.0 ⋅ ⋅
⋅ ⋅ ⋅ ⋅ 1.0 0.0 0.0 0.0 -1.0
⋅ ⋅ ⋅ ⋅ 1.0 0.0 0.0 0.0 ⋱
⋅ ⋅ ⋅ ⋅ 1.0 0.0 0.0 ⋱
⋅ ⋅ ⋅ ⋅ 1.0 0.0 ⋱
⋅ ⋅ ⋅ ⋅ 1.0 ⋱
⋅ ⋅

julia> P = PartialInverseOperator(C, (0, 4)); # increase the upper bandwidth
1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ⋯
⋅ 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ⋱
⋅ ⋅ 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ⋱
⋅ ⋅ ⋅ 1.0 0.0 0.0 0.0 0.0 0.0 0.0 ⋱
⋅ ⋅ ⋅ ⋅ 1.0 0.0 0.0 0.0 0.0 0.0 ⋱
⋅ ⋅ ⋅ ⋅ ⋅ 1.0 0.0 0.0 0.0 0.0
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 1.0 0.0 0.0 0.0 ⋱
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 1.0 0.0 0.0 ⋱
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 1.0 0.0 ⋱
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 1.0 ⋱
⋱ ⋱

julia> P = PartialInverseOperator(C, (0, 4)); # specify an upper bandwidth

julia> P * C
TimesOperator : Chebyshev() → Chebyshev()
Expand All @@ -58,7 +58,7 @@ function PartialInverseOperator(CO::CachedOperator{T},bandwidths) where T<:Numbe
return PartialInverseOperator{T,typeof(CO),typeof(bandwidths)}(CO,bandwidths)
end

function PartialInverseOperator(B::Operator, bandwidths = bandwidths(B))
function PartialInverseOperator(B::Operator, bandwidths = (0,ℵ₀))
PartialInverseOperator(cache(B), bandwidths)
end

Expand Down