Skip to main content

Module ode_c

Module ode_c 

Source
Expand description

C FFI functions for creating, configuring, solving, and destroying OdeWrapper objects.

Provides extern "C" functions for the full lifecycle of an ODE solver:

  • diffsol_ode_wrapper_new_* — constructors (feature-gated by JIT backend or external).
  • diffsol_ode_wrapper_get_* / diffsol_ode_wrapper_set_* — getters/setters for tolerances, time settings, solver type, and linear solver.
  • diffsol_ode_wrapper_y0, diffsol_ode_wrapper_rhs, diffsol_ode_wrapper_rhs_jac_mul — low-level RHS evaluation.
  • diffsol_ode_wrapper_solve, diffsol_ode_wrapper_solve_dense, diffsol_ode_wrapper_solve_fwd_sens, diffsol_ode_wrapper_solve_continuous_adjoint, diffsol_ode_wrapper_solve_adjoint_fwd, diffsol_ode_wrapper_solve_adjoint_bkwd — solve functions returning SolutionWrapper pointers.
  • diffsol_ode_solve_vjp_fwd, diffsol_ode_solve_vjp_bkwd — reverse mode through the solver steps, with a VjpCheckpointWrapper between the two passes.
  • diffsol_ode_wrapper_free — free an OdeWrapper.
  • Serialization: diffsol_ode_wrapper_serialize, diffsol_ode_wrapper_deserialize.

Functions§

diffsol_ode_free⚠
Free an ODE wrapper previously returned by this library.
diffsol_ode_get_atol⚠
Return the absolute tolerance configured for an ODE.
diffsol_ode_get_h0⚠
Return the initial step size configured for an ODE.
diffsol_ode_get_ic_options⚠
Return a handle to the initial-condition solver options for an ODE.
diffsol_ode_get_integrate_out⚠
Return whether output equations are integrated alongside state equations.
diffsol_ode_get_linear_solver⚠
Return the linear solver enum configured for an ODE.
diffsol_ode_get_matrix_type⚠
Return the matrix type configured for an ODE.
diffsol_ode_get_nbatch⚠
Return the number of lanes (independent copies of the system) of an ODE in out_value.
diffsol_ode_get_ode_solver⚠
Return the ODE solver enum configured for an ODE.
diffsol_ode_get_options⚠
Return a handle to the ODE solver options for an ODE.
diffsol_ode_get_out_atol⚠
Return the optional output absolute tolerance.
diffsol_ode_get_out_rtol⚠
Return the optional output relative tolerance.
diffsol_ode_get_param_atol⚠
Return the optional adjoint parameter absolute tolerance.
diffsol_ode_get_param_rtol⚠
Return the optional adjoint parameter relative tolerance.
diffsol_ode_get_rtol⚠
Return the relative tolerance configured for an ODE.
diffsol_ode_get_sens_atol⚠
Return the optional sensitivity absolute tolerance.
diffsol_ode_get_sens_rtol⚠
Return the optional sensitivity relative tolerance.
diffsol_ode_get_t0⚠
Return the initial time configured for an ODE.
diffsol_ode_rhs⚠
Evaluate the ODE right-hand side at a given time and state.
diffsol_ode_rhs_jac_mul⚠
Evaluate the ODE Jacobian-vector product at a given time and state.
diffsol_ode_set_atol⚠
Set the absolute tolerance for an ODE.
diffsol_ode_set_h0⚠
Set the initial step size for an ODE.
diffsol_ode_set_integrate_out⚠
Set whether output equations are integrated alongside state equations.
diffsol_ode_set_linear_solver⚠
Set the linear solver enum for an ODE.
diffsol_ode_set_ode_solver⚠
Set the ODE solver enum for an ODE.
diffsol_ode_set_out_atol⚠
Set the optional output absolute tolerance.
diffsol_ode_set_out_rtol⚠
Set the optional output relative tolerance.
diffsol_ode_set_param_atol⚠
Set the optional adjoint parameter absolute tolerance.
diffsol_ode_set_param_rtol⚠
Set the optional adjoint parameter relative tolerance.
diffsol_ode_set_rtol⚠
Set the relative tolerance for an ODE.
diffsol_ode_set_sens_atol⚠
Set the optional sensitivity absolute tolerance.
diffsol_ode_set_sens_rtol⚠
Set the optional sensitivity relative tolerance.
diffsol_ode_set_t0⚠
Set the initial time for an ODE.
diffsol_ode_solve⚠
Solve an ODE up to a final time.
diffsol_ode_solve_dense⚠
Solve an ODE and sample the solution at requested times.
diffsol_ode_solve_fwd_sens⚠
Solve an ODE and sample forward sensitivities at requested times.
diffsol_ode_solve_vjp_bkwd⚠
Pull the gradient of a scalar objective with respect to the model outputs back through the steps of a forward pass of diffsol_ode_solve_vjp_fwd, to the parameters.
diffsol_ode_solve_vjp_fwd⚠
Solve an ODE at requested times, and keep the solver state after each step for a later reverse-mode pass with diffsol_ode_solve_vjp_bkwd.
diffsol_ode_y0⚠
Evaluate the initial condition for an ODE.
diffsol_tensor_list_free⚠
Free a list of arrays previously returned by this library.