bmad-sim / GTPSA.jl

Julia interface to the Generalised Truncated Power Series Algebra (GTPSA) library
https://bmad-sim.github.io/GTPSA.jl/
GNU General Public License v3.0
2 stars 0 forks source link

Indexing monomial coefficients must check for garbage #73

Closed mattsignorelli closed 4 months ago

mattsignorelli commented 4 months ago

GTPSA plays a lot of clever tricks to speed things up, and certain monomials may contain garbage when not "in use" . So checking if the monomial is garbage must be performed (and returned as 0 if it is garbage) This can be done using mad_bit_tst given the order of the monomial and nz in the tpsa:

if (!mad_bit_tst(a->nz,o)) return 0.0

mattsignorelli commented 4 months ago

Unfortunately this function is inlined and not exported

mattsignorelli commented 4 months ago

Issue submitted upstream, getter functions mad_tpsa_getv getm, etc should check for nz