pub struct MaxIterationPolicy { /* private fields */ }Implementations§
Source§impl MaxIterationPolicy
impl MaxIterationPolicy
Sourcepub fn new(max_iters: usize) -> Self
pub fn new(max_iters: usize) -> Self
Examples found in repository?
examples/least_squares.rs (line 90)
82fn main() {
83 let problem = LinearRegressionProblem {
84 data: vec![(1.0, 2.0), (2.0, 4.0), (3.0, 6.0)],
85 };
86
87 let result = LeastSquares
88 .build_for(problem)
89 .with_initial_state(LSState::default())
90 .and_policy(MaxIterationPolicy::new(3000))
91 .and_policy(StagnationPolicy::new(10))
92 .finalise()
93 .run();
94
95 println!("fit: {:?}", result);
96}More examples
examples/integration.rs (line 76)
67fn main() {
68 let problem = QuadratureProblem {
69 a: 0.0,
70 b: 1.0,
71 f: |x| x * x,
72 };
73 let result = TrapezoidalIntegration
74 .build_for(problem)
75 .with_initial_state(TrapezoidalState::default())
76 .and_policy(MaxIterationPolicy::new(3000))
77 .and_policy(StagnationPolicy::new(10))
78 .finalise()
79 .run();
80
81 println!("{result:?}");
82}Auto Trait Implementations§
impl Freeze for MaxIterationPolicy
impl RefUnwindSafe for MaxIterationPolicy
impl Send for MaxIterationPolicy
impl Sync for MaxIterationPolicy
impl Unpin for MaxIterationPolicy
impl UnsafeUnpin for MaxIterationPolicy
impl UnwindSafe for MaxIterationPolicy
Blanket Implementations§
Source§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