Struct newton_rootfinder::solver::RootFinder
source · [−]pub struct RootFinder<'a, T, D>where
T: Iterative + Display + Debug,
D: DimMin<D, Output = D>,
DefaultAllocator: Allocator<f64, D>,
DefaultAllocator: Allocator<f64, U1, D>,
DefaultAllocator: Allocator<f64, D, D>,
DefaultAllocator: Allocator<(usize, usize), D>,{ /* private fields */ }
Expand description
Solver for rootfinding
The solver operates on the model and mutate it
The core functionnality is the solve()
method
The user can activate the debugging before the resolution thanks to the set_debug()
method
Implementations
sourceimpl<'a, T, D> RootFinder<'a, T, D>where
T: Iterative + Display + Debug,
D: DimMin<D, Output = D>,
DefaultAllocator: Allocator<f64, D>,
DefaultAllocator: Allocator<f64, U1, D>,
DefaultAllocator: Allocator<f64, D, D>,
DefaultAllocator: Allocator<(usize, usize), D>,
impl<'a, T, D> RootFinder<'a, T, D>where
T: Iterative + Display + Debug,
D: DimMin<D, Output = D>,
DefaultAllocator: Allocator<f64, D>,
DefaultAllocator: Allocator<f64, U1, D>,
DefaultAllocator: Allocator<f64, D, D>,
DefaultAllocator: Allocator<(usize, usize), D>,
pub fn new(
parameters: SolverParameters,
initial_guess: OVector<f64, D>,
iters_params: &'a Iteratives<'a, T>,
residuals_config: &'a ResidualsConfig<'a>
) -> Self
sourcepub fn activate_debug(&mut self, path: &str)
pub fn activate_debug(&mut self, path: &str)
Activate the gathering of the log
The path must be provided (as .txt file) This generate a .txt file at the given path with simulation informations.
Examples
use newton_rootfinder as nrf;
let mut rf = nrf::solver::default_with_guess(init_guess, &iter_params, &res_config, ResolutionMethod::NewtonRaphson, damping);
rf.activate_debug(&"solver_log.txt");
rf.solve(&mut user_model);
Trait Implementations
sourceimpl<'a, T, D> Debug for RootFinder<'a, T, D>where
T: Iterative + Display + Debug,
D: DimMin<D, Output = D>,
DefaultAllocator: Allocator<f64, D>,
DefaultAllocator: Allocator<f64, U1, D>,
DefaultAllocator: Allocator<f64, D, D>,
DefaultAllocator: Allocator<(usize, usize), D>,
impl<'a, T, D> Debug for RootFinder<'a, T, D>where
T: Iterative + Display + Debug,
D: DimMin<D, Output = D>,
DefaultAllocator: Allocator<f64, D>,
DefaultAllocator: Allocator<f64, U1, D>,
DefaultAllocator: Allocator<f64, D, D>,
DefaultAllocator: Allocator<(usize, usize), D>,
Auto Trait Implementations
impl<'a, T, D> !RefUnwindSafe for RootFinder<'a, T, D>
impl<'a, T, D> !Send for RootFinder<'a, T, D>
impl<'a, T, D> !Sync for RootFinder<'a, T, D>
impl<'a, T, D> !Unpin for RootFinder<'a, T, D>
impl<'a, T, D> !UnwindSafe for RootFinder<'a, T, D>
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
Mutably borrows from an owned value. Read more
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>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read morefn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.