Skip to content

Commit e3f9926

Browse files
authored
Convert Operator/Space types (#398)
* Convert Operator types * convert Space * version bump to v0.8.4
1 parent 71dd5e5 commit e3f9926

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ApproxFunBase"
22
uuid = "fbd15aa5-315a-5a7d-a8a4-24992e37be05"
3-
version = "0.8.3"
3+
version = "0.8.4"
44

55
[deps]
66
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"

src/Operators/Operator.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,3 +897,6 @@ diagindshift(S::SubOperator) = diagindshift(S,parentindices(S)[1],parentindices(
897897
#TODO: Remove
898898
diagindrow(S,kr,jr) = bandwidth(S,2)+first(jr)-first(kr)+1
899899
diagindrow(S::SubOperator) = diagindrow(S,parentindices(S)[1],parentindices(S)[2])
900+
901+
# Conversion between operator types
902+
convert(::Type{O}, c::Operator) where {O<:Operator} = c isa O ? c : O(c)::O

src/Space.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ block(S::Space,k) = Block(k)
7373

7474
Space(s::Space) = s
7575

76+
convert(::Type{S}, s::Space) where {S<:Space} = s isa S ? s : S(s)::S
7677

7778

7879
abstract type AmbiguousSpace <: Space{AnyDomain,UnsetNumber} end

0 commit comments

Comments
 (0)