# Module Ida.Dls

module Dls: sig .. end
Direct Linear Solvers operating on dense and banded matrices.
See sundials: Direct linear solvers optional input functions
See sundials: Direct linear solvers optional output functions

type dense_jac_fn = (Sundials.RealArray.t Ida.triple, Sundials.RealArray.t) Ida.jacobian_arg ->       Dls.DenseMatrix.t -> unit
Callback functions that compute dense approximations to a Jacobian matrix. In the call dense_jac_fn arg jac, arg is a Ida.jacobian_arg with three work vectors and the computed Jacobian must be stored in jac.

The callback should load the (i,j)th entry of jac 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 jac.

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

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

val dense : ?jac:dense_jac_fn ->       unit -> [> Nvector_serial.kind ] Ida.serial_linear_solver
A direct linear solver on dense matrices. The optional argument specifies a callback function for computing an approximation to the Jacobian matrix. If this argument is omitted, then a default implementation based on difference quotients is used.
val lapack_dense : ?jac:dense_jac_fn ->       unit -> [> Nvector_serial.kind ] Ida.serial_linear_solver
A direct linear solver on dense matrices using LAPACK. See Ida.Dls.dense. Only available if Sundials.lapack_enabled.
Raises Sundials.NotImplementedBySundialsVersion Solver not available.
See sundials: IDALapackDense
type band_jac_fn = Ida.bandrange ->       (Sundials.RealArray.t Ida.triple, Sundials.RealArray.t) Ida.jacobian_arg ->       Dls.BandMatrix.t -> unit
Callback functions that compute banded approximations to a Jacobian matrix. In the call band_jac_fn {mupper; mlower} arg jac,
• mupper is the upper half-bandwidth of the Jacobian,
• mlower is the lower half-bandwidth of the Jacobian,
• arg is a Ida.jacobian_arg with three work vectors, and,
• jac is storage for the computed Jacobian.
The callback should load the (i,j)th entry of jac 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 and y obtained from arg. Only nonzero elements need be loaded into jac.

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

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

val band : ?jac:band_jac_fn ->       Ida.bandrange -> [> Nvector_serial.kind ] Ida.serial_linear_solver
A direct linear solver on banded matrices. The optional argument specifies a callback function for computing an approximation to the Jacobian matrix. If this argument is omitted, then a default implementation based on difference quotients is used. The other argument gives the width of the bandrange.
See sundials: IDABand
val lapack_band : ?jac:band_jac_fn ->       Ida.bandrange -> [> Nvector_serial.kind ] Ida.serial_linear_solver
A direct linear solver on banded matrices using LAPACK. See Ida.Dls.band. Only available if Sundials.lapack_enabled.
Raises Sundials.NotImplementedBySundialsVersion Solver not available.
See sundials: IDALapackBand

### 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.
Returns (real_size, integer_size)
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_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.

### Low-level solver manipulation

The Ida.init and Ida.reinit functions are the preferred way to set or change a Jacobian function. These low-level functions are provided for experts who want to avoid resetting internal counters and other associated side-effects.

val set_dense_jac_fn : [> Nvector_serial.kind ] Ida.serial_session -> dense_jac_fn -> unit
Change the dense Jacobian function.
val clear_dense_jac_fn : [> Nvector_serial.kind ] Ida.serial_session -> unit
Remove a dense Jacobian function and use the default implementation.
val set_band_jac_fn : [> Nvector_serial.kind ] Ida.serial_session -> band_jac_fn -> unit
Change the band Jacobian function.
val clear_band_jac_fn : [> Nvector_serial.kind ] Ida.serial_session -> unit