Struct argmin::core::OpWrapper[][src]

pub struct OpWrapper<O: ArgminOp> {
    pub op: Option<O>,
    pub cost_func_count: u64,
    pub grad_func_count: u64,
    pub hessian_func_count: u64,
    pub jacobian_func_count: u64,
    pub modify_func_count: u64,
}
Expand description

This wraps an operator and keeps track of how often the cost, gradient and Hessian have been computed and how often the modify function has been called. Usually, this is an implementation detail unless a solver is needed within another solver (such as a line search within a gradient descent method).

Fields

op: Option<O>

Operator

cost_func_count: u64

Number of cost function evaluations

grad_func_count: u64

Number of gradient function evaluations

hessian_func_count: u64

Number of Hessian function evaluations

jacobian_func_count: u64

Number of Jacobian function evaluations

modify_func_count: u64

Number of modify function evaluations

Implementations

Construct an OpWrapper from an operator

Calls the apply method of op and increments cost_func_count.

Calls the gradient method of op and increments gradient_func_count.

Calls the hessian method of op and increments hessian_func_count.

Calls the jacobian method of op and increments jacobian_func_count.

Calls the modify method of op and increments modify_func_count.

Moves the operator out of the struct and replaces it with None

Consumes an operator by increasing the function call counts of self by the ones in other.

Adds function evaluation counts of another operator.

Reset the cost function counts to zero.

Returns the operator op by taking ownership of self.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.