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

\ should choose a space if none is inferrable #65

Closed
dlfivefifty opened this issue Dec 10, 2014 · 2 comments
Closed

\ should choose a space if none is inferrable #65

dlfivefifty opened this issue Dec 10, 2014 · 2 comments

Comments

@dlfivefifty
Copy link
Member

I wish I could type

D=Derivative()
B=dirichlet()
x=Fun(identity)
u=[B,D^2+x][1.,0.]

and it chooses the space from x. At the moment, the x is interpreted as Multiplication(x,AnySpace()) so that spaces can be inferred from other operators. (Since Chebyshev can multiply other spaces like Jacobi). Some system for choosing a default space should exist when it returns AnySpace.

@dlfivefifty
Copy link
Member Author

I’m thinking of adding

choosedomainspace(operator,rangespace)

that will choose a domain space given the range space, but where the range space can be changed in the process. So we’d have

choosedomainspace(Derivative(),Ultrasperical{0}()) == Ultraspherical{0}()
choosedomainspace(Derivative(),Ultrasperical{1}()) == Ultraspherical{0}()
choosedomainspace(Derivative(),Ultrasperical{2}()) == Ultraspherical{1}()

choosedomainspace(RealOperator(),Laurent()) == ReImSpace(Laurent())

choosedomainspace(::,ds)=ds     # default, and equivalent to current situation

This would navigate down the tree and promote the spaces as neccesary on the way back up. One use case that's not clear is the original question: should

choosedomainsace(Multiplication(x,UnsetSpace()),AnySpace())

return domainspace(x)? there could be an issue with the "correct" space coming from another part of the tree... but maybe this is an edge situation where its fine to insist that spaces are specified by hand.

@dlfivefifty
Copy link
Member Author

That was easier than expected :) It defaults to

choosedomainspace(A::Operator,::)=domainspace(A)

but operators that support UnsetSpace can override it. Right now only Multiplication does, but RealOperator is next

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

1 participant