# Module Cvode.Dls

module Dls: sig .. end

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

See sundials: Direct linear solvers optional input functions
See sundials: Direct linear solvers optional output functions

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

Callback functions that compute approximations to a Jacobian matrix. In the call jac arg jm, arg is a Cvode.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 $\partial y_i/\partial 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 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.

See sundials: CVDlsSetJacFn
val solver : ?jac:'m jac_fn ->       ('m, [> Nvector_serial.kind ] as 'a, 'tag)       Sundials.LinearSolver.Direct.serial_linear_solver ->       'a Cvode.serial_session_linear_solver

Create a Cvode-specific linear solver from a Jacobian approximation function and 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).

See sundials: CVDlsSetLinearSolver
See sundials: CVDlsSetJacFn

#### Solver statistics

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

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

• Returns (real_size, integer_size)
• See sundials: CVDlsGetWorkSpace
val get_num_jac_evals : [> Nvector_serial.kind ] Cvode.serial_session -> int

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

See sundials: CVDlsGetNumJacEvals
val get_num_rhs_evals : [> Nvector_serial.kind ] Cvode.serial_session -> int

Returns the number of calls to the right-hand side callback due to the finite difference Jacobian approximation.

See sundials: CVDlsGetNumRhsEvals