Axect / Peroxide

Rust numeric library with high performance and friendly syntax
https://crates.io/crates/peroxide
Apache License 2.0
551 stars 32 forks source link

Implement Multiroot solver #83

Open haasal opened 4 days ago

haasal commented 4 days ago

This is a great (and probably the best) rust crate for numerical maths. So incredible job first of all! Rewriting all these Algorithms must have been a huge pain.

I propose adding a solver for non-linear systems of equations.

$$ \vec f(\vec x) = 0 $$

If I just haven't found them in the docs please let me know... I propose adding something along the lines of the gsl library but they don't do anything super special. Due to the constraints on C the rust bindings are just super awkward to use. So I propose adding a much simpler interface. I will sketch a interface for this when I get to it.

(R)GSLs interface also doesn't work directly with complex numbers so this would be a great oportunity to make it work e.g. with num::Complex

And don't feel pressured to implement all of these ideas. I am currently busy too but when I get some room to breathe I will see what I can do!

Axect commented 3 days ago

Hello @haasal Thank you so much for your interest in Peroxide and for the kind words about the library! I really appreciate your detailed feedback.

Your proposal for adding a non-linear system equation solver is excellent. In fact, I've been feeling the need for such functionality myself, as it would be a valuable addition to our numerical computing capabilities.

I totally agree with your thoughts on GSL bindings - especially about creating a simpler interface. It's a great approach, and if we implement this, I think it would make sense to put it behind a separate feature flag. This would keep the core library lean while allowing users who need this functionality to opt-in.

I would be very interested in seeing your interface sketch when you have time to work on it. We could discuss the design and make sure it meets the needs of Rust users while maintaining Peroxide's focus on usability. I'd also be happy to help with the implementation when my schedule allows.

Thank you again for this excellent suggestion. Having complex number support through num::Complex would indeed be a great improvement over the current GSL approach. Looking forward to potentially collaborating on this!