pub trait NonLinearSolver<M: Matrix>: Default {
// Required methods
fn set_problem<C: NonLinearOpJacobian<V = M::V, T = M::T, M = M, C = M::C>>(
&mut self,
op: &C,
);
fn is_jacobian_set(&self) -> bool;
fn reset_jacobian<C: NonLinearOpJacobian<V = M::V, T = M::T, M = M, C = M::C>>(
&mut self,
op: &C,
x: &M::V,
);
fn clear_jacobian(&mut self);
fn solve_in_place<C: NonLinearOp<V = M::V, T = M::T, M = M>>(
&mut self,
op: &C,
x: &mut C::V,
error_y: &C::V,
convergence: &mut Convergence<'_, M::V>,
) -> Result<(), NlError>;
fn solve_linearised_in_place(&self, x: &mut M::V) -> Result<(), NlError>;
// Provided method
fn solve<C: NonLinearOp<V = M::V, T = M::T, M = M>>(
&mut self,
op: &C,
x: &M::V,
error_y: &M::V,
convergence: &mut Convergence<'_, M::V>,
) -> Result<M::V, NlError> { ... }
}Expand description
A solver for the nonlinear problem F(x) = 0.
Required Methods§
Sourcefn set_problem<C: NonLinearOpJacobian<V = M::V, T = M::T, M = M, C = M::C>>(
&mut self,
op: &C,
)
fn set_problem<C: NonLinearOpJacobian<V = M::V, T = M::T, M = M, C = M::C>>( &mut self, op: &C, )
Set the problem to be solved, any previous problem is discarded.
fn is_jacobian_set(&self) -> bool
Sourcefn reset_jacobian<C: NonLinearOpJacobian<V = M::V, T = M::T, M = M, C = M::C>>(
&mut self,
op: &C,
x: &M::V,
)
fn reset_jacobian<C: NonLinearOpJacobian<V = M::V, T = M::T, M = M, C = M::C>>( &mut self, op: &C, x: &M::V, )
Reset the approximation of the Jacobian matrix.
Sourcefn clear_jacobian(&mut self)
fn clear_jacobian(&mut self)
Clear the approximation of the Jacobian matrix.
Sourcefn solve_in_place<C: NonLinearOp<V = M::V, T = M::T, M = M>>(
&mut self,
op: &C,
x: &mut C::V,
error_y: &C::V,
convergence: &mut Convergence<'_, M::V>,
) -> Result<(), NlError>
fn solve_in_place<C: NonLinearOp<V = M::V, T = M::T, M = M>>( &mut self, op: &C, x: &mut C::V, error_y: &C::V, convergence: &mut Convergence<'_, M::V>, ) -> Result<(), NlError>
Solve the problem F(x) = 0 in place.
Sourcefn solve_linearised_in_place(&self, x: &mut M::V) -> Result<(), NlError>
fn solve_linearised_in_place(&self, x: &mut M::V) -> Result<(), NlError>
Solve the linearised problem J * x = b, where J was calculated using Self::reset_jacobian.
The input b is provided in x, and the solution is returned in x.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".