Module Kinsol.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
See sundials: KINDlsDenseJacFn

type dense_jac_fn = (Sundials.RealArray.t Kinsol.double, Sundials.RealArray.t)
Kinsol.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 Kinsol.jacobian_arg with two 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.

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

See sundials: KINDense/KINLapackDense
See sundials: KINDlsSetDenseJacFn
See sundials: KINDlsDenseJacFn
val dense : ?jac:dense_jac_fn ->
unit -> [> Nvector_serial.kind ] Kinsol.serial_linear_solver
A direct linear solver on dense matrices. The optional jac 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: KINDense
See sundials: KINDlsSetDenseJacFn
See sundials: KINDlsDenseJacFn
val lapack_dense : ?jac:dense_jac_fn ->
unit -> [> Nvector_serial.kind ] Kinsol.serial_linear_solver
A direct linear solver on dense matrices using LAPACK. See Kinsol.Dls.dense. Only available if Sundials.lapack_enabled.
Raises Sundials.NotImplementedBySundialsVersion Solver not available.
See sundials: KINLapackDense
See sundials: KINDlsSetDenseJacFn
See sundials: KINDlsDenseJacFn
type band_jac_fn = Kinsol.bandrange ->
(Sundials.RealArray.t Kinsol.double, Sundials.RealArray.t)
Kinsol.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.

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

See sundials: KINBand/KINLapackBand
See sundials: KINDlsSetBandJacFn
See sundials: KINDlsBandJacFn
val band : ?jac:band_jac_fn ->
Kinsol.bandrange -> [> Nvector_serial.kind ] Kinsol.serial_linear_solver
A direct linear solver on banded matrices. The optional jac 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: KINBand
See sundials: KINDlsSetBandJacFn
See sundials: KINDlsBandJacFn
val lapack_band : ?jac:band_jac_fn ->
Kinsol.bandrange -> [> Nvector_serial.kind ] Kinsol.serial_linear_solver
A direct linear solver on banded matrices using LAPACK. See Kinsol.Dls.band. Only available if Sundials.lapack_enabled.
Raises Sundials.NotImplementedBySundialsVersion Solver not available.
See sundials: KINLapackBand
See sundials: KINDlsSetBandJacFn
See sundials: KINDlsBandJacFn

Solver statistics


val get_work_space : [> Nvector_serial.kind ] Kinsol.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: KINDlsGetWorkSpace
val get_num_jac_evals : [> Nvector_serial.kind ] Kinsol.serial_session -> int
Returns the number of calls made by a direct linear solver to the Jacobian approximation function.
See sundials: KINDlsGetNumJacEvals
val get_num_func_evals : [> Nvector_serial.kind ] Kinsol.serial_session -> int
Returns the number of calls made by a direct linear solver to the Jacobian approximation function.
See sundials: KINDlsGetNumFuncEvals

Low-level solver manipulation


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