pub struct DefaultGlobalPivotFinder {
pub nsearch: usize,
pub max_nglobal_pivot: usize,
pub tol_margin: f64,
}Expand description
Default global pivot finder using random search with local optimization.
Algorithm:
- Generate
nsearchrandom initial points. - For each point, sweep all dimensions and pick the index with the largest interpolation error at each position.
- Keep points where the error exceeds
abs_tol * tol_margin. - Return at most
max_nglobal_pivotresults.
§Examples
use tensor4all_tensorci::DefaultGlobalPivotFinder;
// Default configuration
let finder = DefaultGlobalPivotFinder::default();
assert_eq!(finder.nsearch, 5);
assert_eq!(finder.max_nglobal_pivot, 5);
assert!((finder.tol_margin - 10.0).abs() < 1e-15);
// Custom configuration
let custom = DefaultGlobalPivotFinder::new(20, 10, 5.0);
assert_eq!(custom.nsearch, 20);
assert_eq!(custom.max_nglobal_pivot, 10);
assert!((custom.tol_margin - 5.0).abs() < 1e-15);Fields§
§nsearch: usizeNumber of random initial points to search from
max_nglobal_pivot: usizeMaximum number of pivots to add per iteration
tol_margin: f64Search for pivots with error > abs_tol × tol_margin
Implementations§
Trait Implementations§
Source§impl Clone for DefaultGlobalPivotFinder
impl Clone for DefaultGlobalPivotFinder
Source§fn clone(&self) -> DefaultGlobalPivotFinder
fn clone(&self) -> DefaultGlobalPivotFinder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DefaultGlobalPivotFinder
impl Debug for DefaultGlobalPivotFinder
Source§impl Default for DefaultGlobalPivotFinder
impl Default for DefaultGlobalPivotFinder
Source§impl GlobalPivotFinder for DefaultGlobalPivotFinder
impl GlobalPivotFinder for DefaultGlobalPivotFinder
Source§fn find_global_pivots<T, F>(
&self,
input: &GlobalPivotSearchInput<T>,
f: &F,
abs_tol: f64,
rng: &mut impl Rng,
) -> Vec<MultiIndex> ⓘ
fn find_global_pivots<T, F>( &self, input: &GlobalPivotSearchInput<T>, f: &F, abs_tol: f64, rng: &mut impl Rng, ) -> Vec<MultiIndex> ⓘ
Find multi-indices with high interpolation error. Read more
Auto Trait Implementations§
impl Freeze for DefaultGlobalPivotFinder
impl RefUnwindSafe for DefaultGlobalPivotFinder
impl Send for DefaultGlobalPivotFinder
impl Sync for DefaultGlobalPivotFinder
impl Unpin for DefaultGlobalPivotFinder
impl UnsafeUnpin for DefaultGlobalPivotFinder
impl UnwindSafe for DefaultGlobalPivotFinder
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
Casts
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read moreSource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more