-
Notifications
You must be signed in to change notification settings - Fork 3
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
Specialize array overloads #192
Comments
Related issues which are hopeless on abstract arrays: |
To add injury to their limited use, array overloads require a huge amount of effort to write and test. An alternative mentioned in #144 is to wrap all array overloads in a function that leverages meta-programming to generate methods on
|
Arguably, a codebase that has use for SCT is written in a sparse manner and will rarely use the non-sparse |
Not true. SCT materializes the sparsity pattern of the Jacobian, but inside the code said Jacobian never needs to exist at all. Typically, the Brusselator gives rise to sparse Jacobians without ever creating a |
Yeah we definitely don't wanna go down the ReverseDiff road of generating truckloads of methods for combinations of lists of types. It's extremely brittle and has even broken the tests of the package for a good long while JuliaDiff/ReverseDiff.jl#242 |
Sure, but the Brusselator falls into my first category of functions:
And I'm not convinced |
Sorry I had missed the "perform scalar operations" part. |
Closing for now, as it would require new code generation utilities, complicate testing, the need for it hasn't arisen yet. |
At the moment,
src/overloads/arrays.jl
contains linear algebra functions defined onAbstractMatrix{<:Tracer}
. Unfortunately, this dispatch will most likely never be hit, because each array type (Matrix
,Diagonal
,SparseMatrixCSC
, etc.) has its own implementation of things like*
ordet
. Andf(::ConcreteMatrixType{<:Real})
will always take precedence overf(::AbstractMatrix{<:Tracer})
.My suggestion: only define these overloads for the basic
Array
types (Vector
/Matrix
). That way, we make sure that our methods are actually hit when we want them to be. And we also provide an actionable solution for people who are stuck by failing linear algebra methods: put everything inside a normalArray
and you should be fine.The text was updated successfully, but these errors were encountered: