Module Ida.Dls

module Dls: sig .. end

Direct Linear Solvers operating on dense, banded and sparse matrices.

include Sundials_LinearSolver.Direct
type 'm jac_fn = (Sundials.RealArray.t Ida.triple, Sundials.RealArray.t) Ida.jacobian_arg ->
'm -> unit

Callback functions that compute dense approximations to a Jacobian matrix. In the call jac arg jm, arg is a Ida.jacobian_arg with three work vectors and the computed Jacobian must be stored in jm.

The callback should load the (i,j)th entry of jm with $\frac{\partial F_i}{\partial y_j} + c_j\frac{\partial F_i}{\partial\dot{y}_j}$, i.e., the partial derivative of the ith equation with respect to the jth variable, evaluated at the values of t, y, and y' obtained from arg. Only nonzero elements need be loaded into jm.

Raising Sundials.RecoverableFailure indicates a recoverable error. Any other exception is treated as an unrecoverable error.

Neither the elements of arg nor the matrix jm should be accessed after the function has returned.

val solver : ?jac:'m jac_fn ->
('m, Sundials.RealArray.t, [> Nvector_serial.kind ] as 'a, [> `Dls ])
Sundials.LinearSolver.t -> 'a Ida.serial_linear_solver

Create an Ida-specific linear solver from a Jacobian approximation function and a generic direct linear solver. The Jacobian approximation function is optional for dense and banded solvers (if not given an internal difference quotient approximation is used), but must be provided for other solvers (or Invalid_argument is raised).

Solver statistics

val get_work_space : [> Nvector_serial.kind ] Ida.serial_session -> int * int

Returns the sizes of the real and integer workspaces used by a direct linear solver.

val get_num_jac_evals : [> Nvector_serial.kind ] Ida.serial_session -> int

Returns the number of calls made by a direct linear solver to the Jacobian approximation function.

val get_num_lin_res_evals : [> Nvector_serial.kind ] Ida.serial_session -> int

Returns the number of calls to the residual callback due to the finite difference Jacobian approximation.