@@ -142,18 +142,126 @@ pub use diffsl::CraneliftJitModule;
142142#[ cfg( feature = "diffsl-llvm" ) ]
143143pub use diffsl:: LlvmModule ;
144144
145+ /// Context objects for managing device resources for vectors and matrices (e.g. device streams, threading pools, etc.).
146+ ///
147+ /// This module provides context types that encapsulate information about where data is stored and computed
148+ /// (CPU, GPU, etc.). Different backends like nalgebra and faer may require different context implementations.
149+ /// The [Context] trait defines the interface that must be implemented.
145150pub mod context;
151+
152+ /// Jacobian computation and coloring algorithms for efficient Jacobian evaluation.
153+ ///
154+ /// This module provides utilities for:
155+ /// - Detecting the sparsity pattern of Jacobian matrices using NaN propagation
156+ /// - Computing efficient graph colorings of the Jacobian sparsity pattern
157+ /// - Using the coloring to compute sparse Jacobians with fewer function evaluations
158+ ///
159+ /// The [JacobianColoring] struct is the main entry point for computing Jacobians efficiently.
146160pub mod jacobian;
161+
162+ /// Linear solver implementations and traits.
163+ ///
164+ /// This module defines the [LinearSolver] trait for solving linear systems and provides implementations:
165+ /// - Direct solvers: [NalgebraLU], [FaerLU], [FaerSparseLU]
166+ /// - Optional sparse solvers: `KLU` (requires `suitesparse` feature)
167+ /// - GPU solvers: `CudaLU` (requires `cuda` feature)
168+ ///
169+ /// The linear solver is a critical component used internally by nonlinear solvers to solve Newton systems.
147170pub mod linear_solver;
171+
172+ /// Matrix types and operations.
173+ ///
174+ /// This module defines the [Matrix] trait and related traits for matrix operations:
175+ /// - [DenseMatrix] for dense column-major matrices
176+ /// - [MatrixView] and [MatrixViewMut] for borrowed views
177+ /// - Sparsity detection and handling
178+ ///
179+ /// Implementations are provided for:
180+ /// - Dense matrices: [NalgebraMat], [FaerMat]
181+ /// - Sparse matrices: [FaerSparseMat]
182+ /// - GPU matrices: `CudaMat` (requires `cuda` feature)
148183pub mod matrix;
184+
185+ /// Nonlinear solver implementations and traits.
186+ ///
187+ /// This module defines the [NonLinearSolver] trait and provides the [NewtonNonlinearSolver] implementation.
188+ /// It also includes:
189+ /// - [LineSearch] implementations for globalization ([NoLineSearch], [BacktrackingLineSearch])
190+ /// - Root finding algorithms via [RootFinder]
191+ /// - Convergence testing via [Convergence]
192+ ///
193+ /// Nonlinear solvers are used internally by ODE solvers to solve implicit equations.
149194pub mod nonlinear_solver;
195+
196+ /// ODE equations and traits.
197+ ///
198+ /// This module defines the [OdeEquations] trait and specialized variants:
199+ /// - [OdeEquationsImplicit] for implicit ODEs with mass matrices
200+ /// - [OdeEquationsImplicitSens] for forward sensitivity equations
201+ /// - [OdeEquationsAdjoint] for adjoint sensitivity equations
202+ ///
203+ /// It also provides implementations:
204+ /// - [DiffSl] for equations specified in the DiffSL domain-specific language
205+ /// - [SensEquations] and [AdjointEquations] for sensitivity computations
206+ ///
207+ /// All the test equations used in Diffsol's test suite are also provided here.
150208pub mod ode_equations;
209+
210+ /// ODE solver implementations and traits.
211+ ///
212+ /// This module provides the complete ODE solving interface including:
213+ /// - [OdeSolverMethod] trait with implementations: [Bdf], [Sdirk], [ExplicitRk]
214+ /// - [OdeSolverProblem] for problem setup (equations, parameters, tolerances, solver options etc.)
215+ /// - [OdeSolverState] for managing solution state (including state vector, sensitivities, time, step size etc.)
216+ /// - [OdeBuilder] for convenient problem construction (builds and configures [OdeSolverProblem])
217+ /// - [Checkpointing] and [HermiteInterpolator] for solution interpolation
151218pub mod ode_solver;
219+
220+ /// Operator types and traits (e.g. non-linear, linear and constant operators; as well as their jacobians).
221+ ///
222+ /// This module defines fundamental operator traits, for example:
223+ /// - [NonLinearOp] and variants for Jacobians and sensitivities
224+ /// - [LinearOp] for linear operators
225+ /// - [ConstantOp] for constants
226+ ///
227+ /// It also provides concrete implementations, for example:
228+ /// - [Closure] for wrapping user-provided closures
229+ /// - [LinearClosure] for linear operators
230+ /// - [ConstantClosure] for constants
231+ /// - [MatrixOp] for explicit matrix operators
152232pub mod op;
233+
234+ /// Scalar types and traits.
235+ ///
236+ /// This module defines the [Scalar] trait that all floating-point types used in DiffSol must implement.
237+ /// It aggregates requirements from nalgebra, faer, and num_traits to ensure compatibility with linear algebra operations.
238+ ///
239+ /// Implementations are provided for `f32` and `f64`.
240+ /// GPU scalar types are available via `ScalarCuda` (requires `cuda` feature).
153241pub mod scalar;
154- pub mod solver;
242+
243+ /// Vector types and traits.
244+ ///
245+ /// This module defines the [Vector] trait and related traits for vector operations:
246+ /// - [VectorView] and [VectorViewMut] for borrowed views
247+ /// - [VectorIndex] for index collections
248+ /// - [VectorHost] for CPU-resident vectors with direct access
249+ ///
250+ /// Implementations are provided for:
251+ /// - [NalgebraVec] using nalgebra vectors
252+ /// - [FaerVec] using faer vectors
253+ /// - `CudaVec` for GPU computation (requires `cuda` feature)
155254pub mod vector;
156255
256+ /// Error types and handling.
257+ ///
258+ /// This module defines the [DiffsolError] enum and specialized error variants
259+ /// for different failure modes in ODE solving, including parsing, compilation,
260+ /// and numerical errors.
261+ pub mod error;
262+
263+ pub use error:: DiffsolError ;
264+
157265#[ cfg( feature = "sundials" ) ]
158266pub mod sundials_sys;
159267
@@ -258,5 +366,3 @@ pub use scalar::cuda::{CudaType, ScalarCuda};
258366pub use vector:: cuda:: { CudaIndex , CudaVec , CudaVecMut , CudaVecRef } ;
259367
260368pub use scalar:: scale;
261-
262- pub mod error;
0 commit comments