Module Cvode.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 Cvode.triple, Sundials.RealArray.t) Cvode.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 Cvode.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 $\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 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.

See sundials: CVDlsDenseJacFn
val dense : ?jac:dense_jac_fn ->
unit -> [> Nvector_serial.kind ] Cvode.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.
See sundials: CVDense
See sundials: CVDlsSetDenseJacFn
See sundials: CVDlsDenseJacFn
val lapack_dense : ?jac:dense_jac_fn ->
unit -> [> Nvector_serial.kind ] Cvode.serial_linear_solver
A direct linear solver on dense matrices using LAPACK. See Cvode.Dls.dense. Only available if Sundials.lapack_enabled.
Raises Sundials.NotImplementedBySundialsVersion Solver not available.
See sundials: CVLapackDense
See sundials: CVDlsSetDenseJacFn
See sundials: CVDlsDenseJacFn
type band_jac_fn = Cvode.bandrange ->
(Sundials.RealArray.t Cvode.triple, Sundials.RealArray.t) Cvode.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, The callback should load the (i,j)th entry of jac 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 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.

See sundials: CVDlsBandJacFn
val band : ?jac:band_jac_fn ->
Cvode.bandrange -> [> Nvector_serial.kind ] Cvode.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: CVBand
See sundials: CVDlsSetBandJacFn
See sundials: CVDlsBandJacFn
val lapack_band : ?jac:band_jac_fn ->
Cvode.bandrange -> [> Nvector_serial.kind ] Cvode.serial_linear_solver
A direct linear solver on banded matrices using LAPACK. See Cvode.Dls.band. Only available if Sundials.lapack_enabled.
Raises Sundials.NotImplementedBySundialsVersion Solver not available.
See sundials: CVLapackBand
See sundials: CVDlsSetBandJacFn
See sundials: CVDlsBandJacFn

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

Low-level solver manipulation

The Cvode.init and Cvode.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 ] Cvode.serial_session ->
dense_jac_fn -> unit
Change the dense Jacobian function.
See sundials: CVDlsSetDenseJacFn
val clear_dense_jac_fn : [> Nvector_serial.kind ] Cvode.serial_session -> unit
Remove a dense Jacobian function and use the default implementation.
See sundials: CVDlsSetDenseJacFn
val set_band_jac_fn : [> Nvector_serial.kind ] Cvode.serial_session ->
band_jac_fn -> unit
Change the band Jacobian function.
See sundials: CVDlsSetBandJacFn
val clear_band_jac_fn : [> Nvector_serial.kind ] Cvode.serial_session -> unit
Remove a banded Jacobian function and use the default implementation.
See sundials: CVDlsSetBandJacFn