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

CyRK's cython integrator is setup to only work with complex numbers #12

Closed
jrenaud90 opened this issue Dec 31, 2022 · 1 comment
Closed
Labels
enhancement New feature or request good first issue Good for newcomers performance Issues related to improving performance
Milestone

Comments

@jrenaud90
Copy link
Owner

As of v0.2.0, CyRK's cython integrator only allows for complex numbers. Non-complex differential equations have to be passed into the integrator by setting all of the imaginary portions to 0. This works fine but roughly doubles the memory usage and computation steps for various parts of the calculation. To improve performance, the integrator should allow for pure floats if complex calculations are not required.

This could either be done by:

  • Have the cython integrator dynamically determine the type of y0 and use that type throughout the calculation
  • Have a wrapper that is called before cyrk_ode is called. This wrapper (which could be pure python or numba code) would then check the type of y0 and then pass the arguments the appropriate cyrk_ode.
    • There would need to be two different cyrk_odes: cyrk_ode_complex and cyrk_ode_float.

The first method would be more ideal as the second would require maintaining two very similar functions. It would also introduce a (small?) overhead in that initial python wrapper function call.

@jrenaud90 jrenaud90 added enhancement New feature or request good first issue Good for newcomers performance Issues related to improving performance labels Dec 31, 2022
@jrenaud90 jrenaud90 added this to the 1.0.0 milestone Dec 31, 2022
@jrenaud90
Copy link
Owner Author

Duplicate. See issue #3

@jrenaud90 jrenaud90 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers performance Issues related to improving performance
Projects
None yet
Development

No branches or pull requests

1 participant