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

support fallbacks for non-array types #30

Open
stevengj opened this issue May 31, 2014 · 1 comment
Open

support fallbacks for non-array types #30

stevengj opened this issue May 31, 2014 · 1 comment

Comments

@stevengj
Copy link

It would be nice to be able to use the Devectorize package in cases where you want it to be fast for AbstractArray types, but in which you still want the code to work on more abstract types. i.e. you would like to be able to write, e.g.

@devec! a = b + γ*c

and have it be fast and in-place on a for arrays, but still work for arbitrary types supporting the requisite + and * operations. Note also that it would be nice to have @devec! a = ... rather than @devec a[:] = ..., to make it clearer that it works even when a is some more abstract type that doesn't necessarily support [:].

See e.g. JuliaLang/ODE.jl/#33 and JuliaLang/LinearAlgebra.jl#119

Could this be implementd by sprinkling a few method_exists checks here and there?

@stevengj
Copy link
Author

This may in some sense be a generalization of JuliaLang/julia#28.

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