pub trait RootOracle<T: Float + FromPrimitive + Debug> {
// Required method
fn evaluate(&mut self, x: T) -> T;
// Provided methods
fn root_side(
&self,
objective_sign: ObjectiveSign,
slope_sign: ObjectiveSign,
) -> RootSide { ... }
fn slope_sign(
&mut self,
domain: &Range<T>,
confidence_level: ConfidenceLevel<T>,
max_iter: usize,
) -> Result<Option<ObjectiveSign>, RootError> { ... }
fn objective_sign(
&mut self,
x: T,
confidence_level: ConfidenceLevel<T>,
max_iter: usize,
) -> Result<Option<ObjectiveSign>, RootError> { ... }
}Required Methods§
Provided Methods§
fn root_side( &self, objective_sign: ObjectiveSign, slope_sign: ObjectiveSign, ) -> RootSide
fn slope_sign( &mut self, domain: &Range<T>, confidence_level: ConfidenceLevel<T>, max_iter: usize, ) -> Result<Option<ObjectiveSign>, RootError>
Sourcefn objective_sign(
&mut self,
x: T,
confidence_level: ConfidenceLevel<T>,
max_iter: usize,
) -> Result<Option<ObjectiveSign>, RootError>
fn objective_sign( &mut self, x: T, confidence_level: ConfidenceLevel<T>, max_iter: usize, ) -> Result<Option<ObjectiveSign>, RootError>
Estimate the sign of the objective at x to the requested confidence level.
The objective is assumed to be observable only through noisy evaluations.
This method repeatedly evaluates the objective at x, converts each
non-zero observation to its sign, and accumulates the resulting random walk.
Sampling stops once the curved-boundary test is crossed. If the boundary
is not crossed within max_iter evaluations, the method returns
RootError::MaxIterExceeded.
Exact zero observations are treated as non-informative and do not contribute to the random walk.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".