sarah-ek / faer-rs

Linear algebra foundation for the Rust programming language
https://faer-rs.github.io
MIT License
1.79k stars 58 forks source link

Low Level API with Pre Allocated Work Space Exposed #89

Open RoyiAvital opened 9 months ago

RoyiAvital commented 9 months ago

It would be great if there will be, for any function, a low level API which exposes the needed workspace to avoid any allocations of the function.

The work is impressive. Being competitive with the big guys is nothing short of amazing considering this is a single person show.

pnevyk commented 9 months ago

This is already available (and in fact, was available before the high-level API), you just need to use faer-* crates (e.g., faer-core or faer-qr) directly instead of high-level faer. Each function that needs a scratch space requires a PodStack argument and has an associated function suffixed with _req which is used for getting the scratch space size requirements of the function.

For an example, check the code snippet in the documentation for faer-qr crate.