pub trait ObjectiveMerit:
Clone
+ Debug
+ Display {
const SEARCHES: bool = true;
const MERIT: bool = true;
// Required methods
fn search<X, J, D, W, E>(
&self,
function: impl FnMut(&X, Scalar) -> Result<Scalar, String>,
jacobian: impl FnMut(&X) -> Result<J, String>,
argument: &X,
jacobian0: &J,
decrement: &D,
step_size: Scalar,
) -> Result<Scalar, LineSearchError>
where J: Erase<Erased = E> + Jacobian,
D: Erase<Erased = E>,
E: Tensor,
X: Solution,
for<'a> &'a D: Mul<Quantity<W>, Output = X>;
fn search_merit(
&self,
merit: impl FnMut(Scalar) -> Result<Scalar, String>,
value: Scalar,
slope: Scalar,
step_size: Scalar,
) -> Result<Scalar, LineSearchError>;
}Expand description
Line searches that judge a step by a merit built from the objective.
The objective is the function being minimized, plus a penalty where it is constrained, so these are the searches a minimization can take and a root cannot: a root has no objective to compare the values of.
Provided Associated Constants§
Required Methods§
Sourcefn search<X, J, D, W, E>(
&self,
function: impl FnMut(&X, Scalar) -> Result<Scalar, String>,
jacobian: impl FnMut(&X) -> Result<J, String>,
argument: &X,
jacobian0: &J,
decrement: &D,
step_size: Scalar,
) -> Result<Scalar, LineSearchError>
fn search<X, J, D, W, E>( &self, function: impl FnMut(&X, Scalar) -> Result<Scalar, String>, jacobian: impl FnMut(&X) -> Result<J, String>, argument: &X, jacobian0: &J, decrement: &D, step_size: Scalar, ) -> Result<Scalar, LineSearchError>
Backtrack along a step of the objective, whose gradient is known.
Sourcefn search_merit(
&self,
merit: impl FnMut(Scalar) -> Result<Scalar, String>,
value: Scalar,
slope: Scalar,
step_size: Scalar,
) -> Result<Scalar, LineSearchError>
fn search_merit( &self, merit: impl FnMut(Scalar) -> Result<Scalar, String>, value: Scalar, slope: Scalar, step_size: Scalar, ) -> Result<Scalar, LineSearchError>
Backtrack on a merit function of the step size alone.
The exact penalty function is not differentiable, its norm having a kink wherever a constraint is satisfied, so its slope along the step is supplied rather than recovered from a gradient.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".