Struct newton_rootfinder::solver::SolverParameters
source · [−]pub struct SolverParameters { /* private fields */ }
Expand description
A minimal struct holding the resolution parameters
Parameters
Damping
Activate the damping to improve convergence
Plain resolution according to Newton is made through the formula X = X - J^-1*F(X)
However, if the proposed update is not performing (deterioriating the solution) it is likely it is due to a much to step-size too important. Reducing the step-size might be the solution
The damping formula is then : X = X - damping_factorJ^-1F(X) with 0 < damping_factor <= 1
As long as the error is reduced damping_factor = 1. If it is not the case, a factor is applied (the value might change according to the versions).
If the used method is a quasi-newton method and the jacobian has not been updated at the current iteration, damping won’t be performed but the jacobian will be recomputed at the next iteration.
In the case of the jacobian has been recomputed at the current iteration, damping will be performed
Tolerance
The tolerance values used by the solver to check for convergence.
Each residuals must be below this threshold
Max iteration
The maximum number of iterations the solver is allowed to make
This is required to avoid to have an infinte loop
Resolution Method
See the enum ResolutionMethod
for the options available
Problem size
The dimension of the problem for the resolution
Implementations
sourceimpl SolverParameters
impl SolverParameters
pub fn new(
problem_size: usize,
tolerance: f64,
max_iter: usize,
resolution_method: ResolutionMethod,
damping: bool
) -> Self
pub fn get_problem_size(&self) -> usize
pub fn get_tolerance(&self) -> f64
pub fn get_max_iter(&self) -> usize
pub fn get_resolution_method(&self) -> ResolutionMethod
pub fn get_damping(&self) -> bool
Trait Implementations
sourceimpl Debug for SolverParameters
impl Debug for SolverParameters
Auto Trait Implementations
impl RefUnwindSafe for SolverParameters
impl Send for SolverParameters
impl Sync for SolverParameters
impl Unpin for SolverParameters
impl UnwindSafe for SolverParameters
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read morefn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.