-
Notifications
You must be signed in to change notification settings - Fork 13
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
Use ContinuumArrays.jl #44
base: master
Are you sure you want to change the base?
Conversation
I wanted to test this PR, but the unit tests fail. For example, the following code taken from the unit tests generates an error: julia> using ApproxFunBase, ContinuumArrays, OrthogonalPolynomialsQuasi
julia> f = Fun(Chebyshev(), [1.,2.,3.])
ERROR: MethodError: no method matching InfiniteArrays.Infinity(::Int64)
... Could you make the unit tests work? Also, most of the required packages described in |
Ah yes it's really old... might work if OrthogonalPolynomialsQuasi -> ClassicalOrthogonalPolynomials |
@jishnub Could we have a Zoom call at some point to discuss this PR? I want to see how it fits into your plans. I still need to decide what to do about operators. One plan is to make operators "linear functions of functions", which support algebraic manipulations and domains and ranges, but now there is no longer a notion of f = Fun(exp, ChebyshevT())
D = Derivative(ChebyshevT())
@test domain(D) == ChebyshevT() # Should this be more pedantic and be ColumnSpan(ChebyshevT())?
@test range(D) == ChebyshevU()
@test D(f) == f'
N = D*f; @test N(g) == g' * f
N = f*D; @test N(g) == f*g'
N = D ∘ D; @test N(f) == f'' # Note this actually makes sense since ColumnSpan(ChebyshevU()) ⊂ ColumnSpan(ChebyshevT())
@test D^2 == D ∘ D # debatable overloading
B = Dirichlet(Chebyshev())
@test B(f) == [f(-1),f(1)]
# Airy example
L = [B; D^2 - x*I]
@test L(f) == [f(-1); f(1); f'' - x*f]
u = L \ [airyai(-1); airyai(1); 0] # debatable overloading Behind the scenes the last line would be lowered to T = domain(L)
C = range(L)
D̃ = Diff(axes(T,1)) # Currently ContinuumArrays.Derivative but can change name
L̃ = [T[[begin,end],:]; C \ D̃^2 * T - C \ (x .* T)] # This an ∞ Matrix, which takes the place of `getindex`
c = L̃ \ [airyai(-1); airyai(1); zeros(∞)] # this is an ∞ vector
Fun(T, c) But we may want to abandon operators completely to focus on auto-differentiation (which would also support nonlinear). |
Sorry for the delayed reply, I've been a bit preoccupied. I think I would have time to look into this in the second half of October and November. Perhaps we can schedule something for a weekend? |
Sounds good, just propose a time. I'll try to get the conflicts fixed (though we might want to think of a different way of utilising ContinuumArrays.jl than what I did here) |
No description provided.