Skip to main content

FirstOrderObjectiveInto

Trait FirstOrderObjectiveInto 

Source
pub trait FirstOrderObjectiveInto: FirstOrderObjective {
    // Provided method
    fn eval_grad_into(
        &mut self,
        x: &Array1<f64>,
        out: &mut FirstOrderWorkspace,
    ) -> Result<(), ObjectiveEvalError> { ... }
}
Expand description

First-order objective trait that writes into a caller-supplied workspace instead of returning a fresh FirstOrderSample. Useful when many evaluations happen and per-call allocation dominates.

Default impl wraps FirstOrderObjective::eval_grad and copies into the workspace; backends with native into-buffer kernels override.

Provided Methods§

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§