sig
type ('data, 'kind) session = ('data, 'kind) Kinsol_impl.session
type 'a serial_session = (Nvector_serial.data, 'a) Kinsol.session
constraint 'a = [> Nvector_serial.kind ]
type ('data, 'kind) linear_solver =
('data, 'kind) Kinsol_impl.linear_solver
type 'a serial_linear_solver =
(Nvector_serial.data, 'a) Kinsol.linear_solver
constraint 'a = [> Nvector_serial.kind ]
type 'd double = 'd * 'd
type ('t, 'd) jacobian_arg =
('t, 'd) Kinsol_impl.jacobian_arg = {
jac_u : 'd;
jac_fu : 'd;
jac_tmp : 't;
}
type 'data sysfn = 'data -> 'data -> unit
module Dls :
sig
val dense :
?context:Sundials.Context.t ->
([> Nvector_serial.kind ] as 'a) Nvector.serial ->
'a Sundials.Matrix.dense ->
(Sundials.Matrix.Dense.t, 'a, [ `Dls ])
Sundials_LinearSolver.serial_t
val lapack_dense :
?context:Sundials.Context.t ->
([> Nvector_serial.kind ] as 'a) Nvector.serial ->
'a Sundials.Matrix.dense ->
(Sundials.Matrix.Dense.t, 'a, [ `Dls ])
Sundials_LinearSolver.serial_t
val band :
?context:Sundials.Context.t ->
([> Nvector_serial.kind ] as 'a) Nvector.serial ->
'a Sundials.Matrix.band ->
(Sundials.Matrix.Band.t, 'a, [ `Dls ]) Sundials_LinearSolver.serial_t
val lapack_band :
?context:Sundials.Context.t ->
([> Nvector_serial.kind ] as 'a) Nvector.serial ->
'a Sundials.Matrix.band ->
(Sundials.Matrix.Band.t, 'a, [ `Dls ]) Sundials_LinearSolver.serial_t
module Klu :
sig
type ordering =
Sundials_LinearSolver_impl.Klu.ordering =
Amd
| ColAmd
| Natural
val make :
?context:Sundials.Context.t ->
?ordering:ordering ->
([> Nvector_serial.kind ] as 'a) Nvector.serial ->
('s, 'a) Sundials.Matrix.sparse ->
('s Sundials.Matrix.Sparse.t, 'a, [ `Dls | `Klu ])
Sundials_LinearSolver.serial_t
val reinit :
('s Sundials.Matrix.Sparse.t, [> Nvector_serial.kind ] as 'a,
[> `Klu ])
Sundials_LinearSolver.serial_t ->
('s, 'a) Sundials.Matrix.sparse -> ?nnz:int -> unit -> unit
val set_ordering :
('s Sundials.Matrix.Sparse.t, [> Nvector_serial.kind ],
[> `Klu ])
Sundials_LinearSolver.serial_t -> ordering -> unit
end
val klu :
?context:Sundials.Context.t ->
?ordering:Klu.ordering ->
([> Nvector_serial.kind ] as 'a) Nvector.serial ->
('s, 'a) Sundials.Matrix.sparse ->
('s Sundials.Matrix.Sparse.t, 'a, [ `Dls | `Klu ])
Sundials_LinearSolver.serial_t
module Superlumt :
sig
type ordering =
Sundials_LinearSolver_impl.Superlumt.ordering =
Natural
| MinDegreeProd
| MinDegreeSum
| ColAmd
val make :
?context:Sundials.Context.t ->
?ordering:ordering ->
nthreads:int ->
([> Nvector_serial.kind ] as 'a) Nvector.serial ->
('s, 'a) Sundials.Matrix.sparse ->
('s Sundials.Matrix.Sparse.t, 'a, [ `Dls | `Slu ])
Sundials_LinearSolver.serial_t
val set_ordering :
('s Sundials.Matrix.Sparse.t, [> Nvector_serial.kind ],
[> `Slu ])
Sundials_LinearSolver.serial_t -> ordering -> unit
end
val superlumt :
?context:Sundials.Context.t ->
?ordering:Superlumt.ordering ->
nthreads:int ->
([> Nvector_serial.kind ] as 'a) Nvector.serial ->
('s, 'a) Sundials.Matrix.sparse ->
('s Sundials.Matrix.Sparse.t, 'a, [> `Dls | `Slu ])
Sundials_LinearSolver.serial_t
type 'm jac_fn =
(Sundials.RealArray.t Kinsol.double, Sundials.RealArray.t)
Kinsol.jacobian_arg -> 'm -> unit
val solver :
?jac:'m Kinsol.Dls.jac_fn ->
('m, Sundials.RealArray.t, [> Nvector_serial.kind ] as 'a, [> `Dls ])
Sundials.LinearSolver.t -> 'a Kinsol.serial_linear_solver
val get_work_space :
[> Nvector_serial.kind ] Kinsol.serial_session -> int * int
val get_num_jac_evals :
[> Nvector_serial.kind ] Kinsol.serial_session -> int
val get_num_lin_func_evals :
[> Nvector_serial.kind ] Kinsol.serial_session -> int
end
module Spils :
sig
type gramschmidt_type =
Sundials_LinearSolver_impl.Iterative.gramschmidt_type =
ModifiedGS
| ClassicalGS
val spbcgs :
?context:Sundials.Context.t ->
?maxl:int ->
('d, 'k) Nvector.t ->
('m, 'd, 'k, [ `Iter | `Spbcgs ]) Sundials_LinearSolver.t
val spfgmr :
?context:Sundials.Context.t ->
?maxl:int ->
?max_restarts:int ->
?gs_type:gramschmidt_type ->
('d, 'k) Nvector.t ->
('m, 'd, 'k, [ `Iter | `Spfgmr ]) Sundials_LinearSolver.t
val spgmr :
?context:Sundials.Context.t ->
?maxl:int ->
?max_restarts:int ->
?gs_type:gramschmidt_type ->
('d, 'k) Nvector.t ->
('m, 'd, 'k, [ `Iter | `Spgmr ]) Sundials_LinearSolver.t
val sptfqmr :
?context:Sundials.Context.t ->
?maxl:int ->
('d, 'k) Nvector.t ->
('m, 'd, 'k, [ `Iter | `Sptfqmr ]) Sundials_LinearSolver.t
val pcg :
?context:Sundials.Context.t ->
?maxl:int ->
('d, 'k) Nvector.t ->
('m, 'd, 'k, [ `Iter | `Pcg ]) Sundials_LinearSolver.t
module Algorithms :
sig
val qr_fact :
int ->
Sundials.RealArray2.t -> Sundials.RealArray.t -> bool -> unit
val qr_sol :
int ->
Sundials.RealArray2.t ->
Sundials.RealArray.t -> Sundials.RealArray.t -> unit
val modified_gs :
('d, 'k) Nvector.t array ->
Sundials.RealArray2.t -> int -> int -> float
val classical_gs :
('d, 'k) Nvector.t array ->
Sundials.RealArray2.t ->
int ->
int -> Sundials.RealArray.t -> ('d, 'k) Nvector.t array -> float
end
val set_maxl :
('m, 'd, 'k, [< `Iter | `Pcg | `Spbcgs | `Sptfqmr ])
Sundials_LinearSolver.t -> int -> unit
val set_gs_type :
('m, 'd, 'k, [< `Iter | `Spfgmr | `Spgmr ]) Sundials_LinearSolver.t ->
gramschmidt_type -> unit
val set_max_restarts :
('m, 'd, 'k, [< `Iter | `Spfgmr | `Spgmr ]) Sundials_LinearSolver.t ->
int -> unit
type preconditioning_type =
Sundials_LinearSolver_impl.Iterative.preconditioning_type =
PrecNone
| PrecLeft
| PrecRight
| PrecBoth
val set_prec_type :
('m, 'd, 'k, [> `Iter ]) Sundials_LinearSolver.t ->
preconditioning_type -> unit
val set_info_file :
('m, 'd, 'k, [> `Iter ]) Sundials_LinearSolver.t ->
?print_level:bool -> Sundials.Logfile.t -> unit
val set_print_level :
('m, 'd, 'k, [> `Iter ]) Sundials_LinearSolver.t -> bool -> unit
type 'data solve_arg = { uscale : 'data; fscale : 'data; }
type 'd prec_solve_fn =
(unit, 'd) Kinsol.jacobian_arg ->
'd Kinsol.Spils.solve_arg -> 'd -> unit
type 'd prec_setup_fn =
(unit, 'd) Kinsol.jacobian_arg -> 'd Kinsol.Spils.solve_arg -> unit
type ('d, 'k) preconditioner =
('d, 'k) Kinsol_impl.SpilsTypes.preconditioner
val prec_none : ('d, 'k) Kinsol.Spils.preconditioner
val prec_right :
?setup:'d Kinsol.Spils.prec_setup_fn ->
'd Kinsol.Spils.prec_solve_fn -> ('d, 'k) Kinsol.Spils.preconditioner
type 'data jac_times_vec_fn = 'data -> 'data -> 'data -> bool -> bool
val solver :
('m, 'd, 'k, [> `Iter ]) Sundials.LinearSolver.t ->
?jac_times_vec:'d Kinsol.Spils.jac_times_vec_fn ->
?jac_times_sys:'d Kinsol.sysfn ->
('d, 'k) Kinsol.Spils.preconditioner -> ('d, 'k) Kinsol.linear_solver
val get_work_space : ('d, 'k) Kinsol.session -> int * int
val get_num_lin_iters : ('d, 'k) Kinsol.session -> int
val get_num_lin_conv_fails : ('d, 'k) Kinsol.session -> int
val get_num_prec_evals : ('d, 'k) Kinsol.session -> int
val get_num_prec_solves : ('d, 'k) Kinsol.session -> int
val get_num_jtimes_evals : ('d, 'k) Kinsol.session -> int
val get_num_lin_func_evals : ('d, 'k) Kinsol.session -> int
val set_preconditioner :
('d, 'k) Kinsol.session ->
?setup:'d Kinsol.Spils.prec_setup_fn ->
'd Kinsol.Spils.prec_solve_fn -> unit
val set_jac_times :
('d, 'k) Kinsol.session -> 'd Kinsol.Spils.jac_times_vec_fn -> unit
val clear_jac_times : ('d, 'k) Kinsol.session -> unit
end
val matrix_embedded_solver :
(unit, 'data, 'kind, [> `MatE ]) Sundials.LinearSolver.t ->
('data, 'kind) Kinsol.linear_solver
type orthaa = MGS | ICWY | CGS2 | DCGS2
val init :
?context:Sundials.Context.t ->
?max_iters:int ->
?maa:int ->
?orthaa:Kinsol.orthaa ->
?lsolver:('data, 'kind) Kinsol.linear_solver ->
'data Kinsol.sysfn ->
('data, 'kind) Nvector.t -> ('data, 'kind) Kinsol.session
type strategy = Newton | LineSearch | Picard | FixedPoint
type result = Success | InitialGuessOK | StoppedOnStepTol
val solve :
('d, 'k) Kinsol.session ->
('d, 'k) Nvector.t ->
Kinsol.strategy ->
('d, 'k) Nvector.t -> ('d, 'k) Nvector.t -> Kinsol.result
val set_no_init_setup : ('d, 'k) Kinsol.session -> unit
val set_init_setup : ('d, 'k) Kinsol.session -> unit
val set_no_res_mon : [> Nvector_serial.kind ] Kinsol.serial_session -> unit
val set_res_mon : [> Nvector_serial.kind ] Kinsol.serial_session -> unit
val set_max_setup_calls : ('d, 'k) Kinsol.session -> int -> unit
val set_max_sub_setup_calls :
[> Nvector_serial.kind ] Kinsol.serial_session -> int -> unit
type eta_params = { egamma : float option; ealpha : float option; }
type eta_choice =
EtaChoice1
| EtaChoice2 of Kinsol.eta_params
| EtaConstant of float option
val set_eta_choice : ('d, 'k) Kinsol.session -> Kinsol.eta_choice -> unit
val set_res_mon_const_value : ('d, 'k) Kinsol.session -> float -> unit
val set_res_mon_params :
('d, 'k) Kinsol.session ->
?omegamin:float -> ?omegamax:float -> unit -> unit
val set_no_min_eps : ('d, 'k) Kinsol.session -> unit
val set_min_eps : ('d, 'k) Kinsol.session -> unit
val set_max_newton_step : ('d, 'k) Kinsol.session -> float -> unit
val set_max_beta_fails : ('d, 'k) Kinsol.session -> float -> unit
val set_rel_err_func : ('d, 'k) Kinsol.session -> float -> unit
val set_func_norm_tol : ('d, 'k) Kinsol.session -> float -> unit
val set_scaled_step_tol : ('d, 'k) Kinsol.session -> float -> unit
val set_constraints : ('d, 'k) Kinsol.session -> ('d, 'k) Nvector.t -> unit
val set_sys_func : ('d, 'k) Kinsol.session -> ('d -> 'd -> unit) -> unit
val set_error_file : ('d, 'k) Kinsol.session -> Sundials.Logfile.t -> unit
val set_err_handler_fn :
('d, 'k) Kinsol.session -> (Sundials.Util.error_details -> unit) -> unit
val clear_err_handler_fn : ('d, 'k) Kinsol.session -> unit
type print_level =
NoInformation
| ShowScaledNorms
| ShowScaledDFNorm
| ShowGlobalValues
val set_print_level : ('d, 'k) Kinsol.session -> Kinsol.print_level -> unit
val set_info_file :
('d, 'k) Kinsol.session ->
?print_level:Kinsol.print_level -> Sundials.Logfile.t -> unit
val set_info_handler_fn :
('d, 'k) Kinsol.session -> (Sundials.Util.error_details -> unit) -> unit
val clear_info_handler_fn : ('d, 'k) Kinsol.session -> unit
val set_return_newest : ('d, 'k) Kinsol.session -> bool -> unit
val set_damping : ('d, 'k) Kinsol.session -> float -> unit
val set_damping_aa : ('d, 'k) Kinsol.session -> float -> unit
val set_delay_aa : ('d, 'k) Kinsol.session -> float -> unit
val get_work_space : ('d, 'k) Kinsol.session -> int * int
val get_num_func_evals : ('d, 'k) Kinsol.session -> int
val get_num_nonlin_solv_iters : ('d, 'k) Kinsol.session -> int
val get_num_beta_cond_fails : ('d, 'k) Kinsol.session -> int
val get_num_backtrack_ops : ('d, 'k) Kinsol.session -> int
val get_func_norm : ('d, 'k) Kinsol.session -> float
val get_step_length : ('d, 'k) Kinsol.session -> float
exception IllInput
exception LineSearchNonConvergence
exception MaxIterationsReached
exception MaxNewtonStepExceeded
exception LineSearchBetaConditionFailure
exception LinearSolverNoRecovery
exception LinearSolverInitFailure
exception LinearSetupFailure of exn option
exception LinearSolveFailure of exn option
exception SystemFunctionFailure
exception FirstSystemFunctionFailure
exception RepeatedSystemFunctionFailure
exception MissingLinearSolver
exception VectorOpErr
end