1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! Nonlinear solvers for Numra.
//!
//! This crate provides iterative methods for solving systems of nonlinear equations:
//!
//! - **Newton-Raphson** with line search for globalization
//! - Support for both analytical and numerical (finite difference) Jacobians
//!
//! # Example
//!
//! ```rust
//! use numra_nonlinear::{Newton, NewtonOptions, NonlinearSystem};
//!
//! // Solve x^2 = 2 (find sqrt(2))
//! struct SquareRoot;
//!
//! impl NonlinearSystem<f64> for SquareRoot {
//! fn dim(&self) -> usize { 1 }
//! fn eval(&self, x: &[f64], f: &mut [f64]) {
//! f[0] = x[0] * x[0] - 2.0;
//! }
//! }
//!
//! let solver = Newton::default_solver();
//! let result = solver.solve(&SquareRoot, &[1.5]).unwrap();
//! assert!((result.x[0] - std::f64::consts::SQRT_2).abs() < 1e-10);
//! ```
//!
//! Author: Moussa Leblouba
//! Date: 8 February 2026
//! Modified: 2 May 2026
pub use ;
pub use ;
pub use LinalgError;