Skip to main content

Objective

Trait Objective 

Source
pub trait Objective<T: Float>: Send + Sync {
    // Required methods
    fn dim(&self) -> usize;
    fn bounds(&self) -> &Bounds<T>;
    fn eval(&self, x: ArrayView1<'_, T>) -> T;

    // Provided methods
    fn eval_batch(&self, x: ArrayView2<'_, T>) -> Array1<T> { ... }
    fn global_min(&self) -> Option<&FPair<T>> { ... }
}
Expand description

A real-valued function on R^dim with a known feasible domain.

The IISE manuscript’s Obj signature: a typed map from a state space S = R^dim (with Bounds) to R. Implementors may override eval_batch and global_min for performance or known-optima instrumentation.

A real-valued function on R^dim with a known feasible domain.

Implementors may override eval_batch for multi-walker / multi-start backends (Rayon-native, Python single-attach batch, CUTEst worker pools).

Required Methods§

Source

fn dim(&self) -> usize

Number of input dimensions; matches bounds().dims.

Source

fn bounds(&self) -> &Bounds<T>

The feasible domain (typically a box).

Source

fn eval(&self, x: ArrayView1<'_, T>) -> T

Evaluates the objective at a single point.

Provided Methods§

Source

fn eval_batch(&self, x: ArrayView2<'_, T>) -> Array1<T>

Evaluates a batch of points (rows of x).

Default: serial loop over Objective::eval. Override for multi-walker fan-out (see eval_batch_parallel for native f64).

Source

fn global_min(&self) -> Option<&FPair<T>>

Optional known global minimum, used for benchmarking and convergence checks. Default returns None.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§