-
-
Notifications
You must be signed in to change notification settings - Fork 450
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
Minimizing trait bound complexity when working with dimensional generics #1365
Comments
Have you considered using dynamically-sized matrices? What are some typical dimensions for your application? |
@Ralith No larger than 10x10, but this is going to be in the critical path of some code that needs to be highly performant. For a ballpark, I'd estimate this would be the core of a QP solver that would need to allocate all these vectors somewhere between 1000 and 100,000 of times per second. |
I can't specifically help with the generics here, but bear in mind that copying 800 byte structures all over the stack is not necessarily going to be the optimal strategy. Perhaps there's a way you could reuse dynamically allocated storage? |
I've ended up with a ridiculously gnarly function signature due to a ton of trait bounds being required to support some simple operations I want to make on generic-dimension static matrices. Specifically, I want to remove rows and columns while being able to add and reallocate (snippet below). Surely there's an easier way to do this that I've completely missed? Any help would be hugely appreciated!
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=2718224f6cb54b60c95e378be8a0d2cd
The text was updated successfully, but these errors were encountered: