Closed TorkelE closed 6 years ago
There would be a performance gain only when this gets large, like hundreds of reactants? Also, you'd need to take advantage of the structure. Instead of du[1,1]
, you'd want to generate this using the component array of the sprase matrix, i.e. du.data[i]
and then have it all hardcoded in sparse-linear indexes.
Ok, that is good to hear. Sounds like something for the real perfectionist, but I don't think we are there yet. Lets close this for now?
It's something for when you're computationally generating large systems of SDEs, like for discretizations of SPDEs. I'm not sure chemical reaction networks without space will ever need this.
I was reading the documentations today after the latest update and noticed that
g
could be a sparse matrix like:Right now we make a g including all combinations
du[i,j] =
, which might be quite a few. It should be very possible to instead make this g a sparse matrix with much less entries (e.g. if we have n components being degraded that will add n squared entries tog
, only of whichn
is non zero).Could this be an advantage? Would there be a non trivial performance gain by using such a matrix. If that is not the case we probably shouldn't bother.