-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
Hello,
Assuming that I understand correctly what is happening here, then every time the residuals and the jacobian need to be calculated a new array is allocated and returned. Is this true? Is there any optimisation that is happening that avoids allocation?
Assuming this is true, would it be possible to expose a second trait that accepts preallocated arrays? So for example, instead of having
fn residuals(&self) -> Option<OVector<f64, U4>>
to have
fn residuals(&self, residual: &mut OVector<f64, U4>) -> bool
or
fn residuals(&self) -> &mut Option<OVector<f64, U4>>
In the former case the array can be preallocated by the solver and in the latter it can be preallocated by the problem. Similarly of course for the Jacobian.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels