sig
type ('d, 'k) session = ('d, 'k) Ida_impl.session
type 'a serial_session = (Sundials.RealArray.t, 'a) Ida.session
constraint 'a = [> Nvector_serial.kind ]
type ('data, 'kind) linear_solver = ('data, 'kind) Ida_impl.linear_solver
type 'a serial_linear_solver = (Nvector_serial.data, 'a) Ida.linear_solver
constraint 'a = [> Nvector_serial.kind ]
type 'd double = 'd * 'd
type 'd triple = 'd * 'd * 'd
type ('t, 'd) jacobian_arg =
('t, 'd) Ida_impl.jacobian_arg = {
jac_t : float;
jac_y : 'd;
jac_y' : 'd;
jac_res : 'd;
jac_coef : float;
jac_tmp : 't;
}
type 'd resfn = float -> 'd -> 'd -> 'd -> 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 Ida.triple, Sundials.RealArray.t)
Ida.jacobian_arg -> 'm -> unit
val solver :
?jac:'m Ida.Dls.jac_fn ->
('m, Sundials.RealArray.t, [> Nvector_serial.kind ] as 'a, [> `Dls ])
Sundials.LinearSolver.t -> 'a Ida.serial_linear_solver
val get_work_space :
[> Nvector_serial.kind ] Ida.serial_session -> int * int
val get_num_jac_evals :
[> Nvector_serial.kind ] Ida.serial_session -> int
val get_num_lin_res_evals :
[> Nvector_serial.kind ] Ida.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 'd prec_solve_fn =
(unit, 'd) Ida.jacobian_arg -> 'd -> 'd -> float -> unit
type 'd prec_setup_fn = (unit, 'd) Ida.jacobian_arg -> unit
type ('d, 'k) preconditioner =
('d, 'k) Ida_impl.SpilsTypes.preconditioner
val prec_none : ('d, 'k) Ida.Spils.preconditioner
val prec_left :
?setup:'d Ida.Spils.prec_setup_fn ->
'd Ida.Spils.prec_solve_fn -> ('d, 'k) Ida.Spils.preconditioner
type 'd jac_times_setup_fn = (unit, 'd) Ida.jacobian_arg -> unit
type 'd jac_times_vec_fn =
('d Ida.double, 'd) Ida.jacobian_arg -> 'd -> 'd -> unit
val solver :
('m, 'd, 'k, [> `Iter ]) Sundials.LinearSolver.t ->
?jac_times_vec:'d Ida.Spils.jac_times_setup_fn option *
'd Ida.Spils.jac_times_vec_fn ->
?jac_times_res:'d Ida.resfn ->
('d, 'k) Ida.Spils.preconditioner -> ('d, 'k) Ida.linear_solver
val set_eps_lin : ('d, 'k) Ida.session -> float -> unit
val set_ls_norm_factor : ('d, 'k) Ida.session -> float -> unit
val set_linear_solution_scaling : ('d, 'k) Ida.session -> bool -> unit
val set_increment_factor : ('d, 'k) Ida.session -> float -> unit
val get_work_space : ('d, 'k) Ida.session -> int * int
val get_num_lin_iters : ('d, 'k) Ida.session -> int
val get_num_lin_conv_fails : ('d, 'k) Ida.session -> int
val get_num_prec_evals : ('d, 'k) Ida.session -> int
val get_num_prec_solves : ('d, 'k) Ida.session -> int
val get_num_jtsetup_evals : ('d, 'k) Ida.session -> int
val get_num_jtimes_evals : ('d, 'k) Ida.session -> int
val get_num_lin_res_evals : ('d, 'k) Ida.session -> int
val set_preconditioner :
('d, 'k) Ida.session ->
?setup:'d Ida.Spils.prec_setup_fn ->
'd Ida.Spils.prec_solve_fn -> unit
val set_jac_times :
('d, 'k) Ida.session ->
?jac_times_setup:'d Ida.Spils.jac_times_setup_fn ->
'd Ida.Spils.jac_times_vec_fn -> unit
val clear_jac_times : ('d, 'k) Ida.session -> unit
end
val matrix_embedded_solver :
(unit, 'data, 'kind, [> `MatE ]) Sundials.LinearSolver.t ->
('data, 'kind) Ida.linear_solver
type 'data error_weight_fun = 'data -> 'data -> unit
type ('data, 'kind) tolerance =
SStolerances of float * float
| SVtolerances of float * ('data, 'kind) Nvector.t
| WFtolerances of 'data Ida.error_weight_fun
val default_tolerances : ('data, 'kind) Ida.tolerance
type 'd rootsfn = float -> 'd -> 'd -> Sundials.RealArray.t -> unit
val init :
?context:Sundials.Context.t ->
('d, 'kind) Ida.tolerance ->
?nlsolver:('d, 'kind, ('d, 'kind) Ida.session, [ `Nvec ])
Sundials_NonlinearSolver.t ->
?nlsresfn:'d Ida.resfn ->
lsolver:('d, 'kind) Ida.linear_solver ->
'd Ida.resfn ->
?varid:('d, 'kind) Nvector.t ->
?roots:int * 'd Ida.rootsfn ->
float ->
('d, 'kind) Nvector.t -> ('d, 'kind) Nvector.t -> ('d, 'kind) Ida.session
val no_roots : int * 'd Ida.rootsfn
module VarId :
sig
val algebraic : float
val differential : float
type t = Algebraic | Differential
val to_float : Ida.VarId.t -> float
val of_float : float -> Ida.VarId.t
end
val set_id : ('d, 'k) Ida.session -> ('d, 'k) Nvector.t -> unit
val set_suppress_alg :
('d, 'k) Ida.session -> ?varid:('d, 'k) Nvector.t -> bool -> unit
val calc_ic_y :
('d, 'k) Ida.session -> ?y:('d, 'k) Nvector.t -> float -> unit
val calc_ic_ya_yd' :
('d, 'k) Ida.session ->
?y:('d, 'k) Nvector.t ->
?y':('d, 'k) Nvector.t -> ?varid:('d, 'k) Nvector.t -> float -> unit
val set_nonlin_conv_coef_ic : ('d, 'k) Ida.session -> float -> unit
val set_max_num_steps_ic : ('d, 'k) Ida.session -> int -> unit
val set_max_num_jacs_ic : ('d, 'k) Ida.session -> int -> unit
val set_max_num_iters_ic : ('d, 'k) Ida.session -> int -> unit
val set_max_backs_ic : ('d, 'k) Ida.session -> int -> unit
val set_line_search_ic : ('d, 'k) Ida.session -> bool -> unit
val set_step_tolerance_ic : ('d, 'k) Ida.session -> float -> unit
val get_num_backtrack_ops : ('d, 'k) Ida.session -> int
type solver_result = Success | RootsFound | StopTimeReached
val solve_normal :
('d, 'k) Ida.session ->
float ->
('d, 'k) Nvector.t -> ('d, 'k) Nvector.t -> float * Ida.solver_result
val solve_one_step :
('d, 'k) Ida.session ->
float ->
('d, 'k) Nvector.t -> ('d, 'k) Nvector.t -> float * Ida.solver_result
val get_dky :
('d, 'k) Ida.session -> ('d, 'k) Nvector.t -> float -> int -> unit
val reinit :
('d, 'k) Ida.session ->
?nlsolver:('d, 'k, ('d, 'k) Ida.session, [ `Nvec ])
Sundials_NonlinearSolver.t ->
?nlsresfn:'d Ida.resfn ->
?lsolver:('d, 'k) Ida.linear_solver ->
?roots:int * 'd Ida.rootsfn ->
?resfn:'d Ida.resfn ->
float -> ('d, 'k) Nvector.t -> ('d, 'k) Nvector.t -> unit
val set_tolerances : ('d, 'k) Ida.session -> ('d, 'k) Ida.tolerance -> unit
val set_error_file : ('d, 'k) Ida.session -> Sundials.Logfile.t -> unit
val set_err_handler_fn :
('d, 'k) Ida.session -> (Sundials.Util.error_details -> unit) -> unit
val clear_err_handler_fn : ('d, 'k) Ida.session -> unit
val set_max_ord : ('d, 'k) Ida.session -> int -> unit
val set_max_num_steps : ('d, 'k) Ida.session -> int -> unit
val set_init_step : ('d, 'k) Ida.session -> float -> unit
val set_max_step : ('d, 'k) Ida.session -> float -> unit
val set_stop_time : ('d, 'k) Ida.session -> float -> unit
val set_max_err_test_fails : ('d, 'k) Ida.session -> int -> unit
val set_max_nonlin_iters : ('d, 'k) Ida.session -> int -> unit
val set_max_conv_fails : ('d, 'k) Ida.session -> int -> unit
val set_nonlin_conv_coef : ('d, 'k) Ida.session -> float -> unit
val set_constraints : ('d, 'k) Ida.session -> ('d, 'k) Nvector.t -> unit
val clear_constraints : ('d, 'k) Ida.session -> unit
val get_work_space : ('d, 'k) Ida.session -> int * int
val get_num_steps : ('d, 'k) Ida.session -> int
val get_num_res_evals : ('d, 'k) Ida.session -> int
val get_num_lin_solv_setups : ('d, 'k) Ida.session -> int
val get_num_err_test_fails : ('d, 'k) Ida.session -> int
val get_last_order : ('d, 'k) Ida.session -> int
val get_current_order : ('d, 'k) Ida.session -> int
val get_last_step : ('d, 'k) Ida.session -> float
val get_current_step : ('d, 'k) Ida.session -> float
val get_actual_init_step : ('d, 'k) Ida.session -> float
val get_current_time : ('d, 'k) Ida.session -> float
val get_tol_scale_factor : ('d, 'k) Ida.session -> float
val get_err_weights : ('d, 'k) Ida.session -> ('d, 'k) Nvector.t -> unit
val get_est_local_errors :
('d, 'k) Ida.session -> ('d, 'k) Nvector.t -> unit
type integrator_stats = {
num_steps : int;
num_res_evals : int;
num_lin_solv_setups : int;
num_err_test_fails : int;
last_order : int;
current_order : int;
actual_init_step : float;
last_step : float;
current_step : float;
current_time : float;
}
val get_integrator_stats : ('d, 'k) Ida.session -> Ida.integrator_stats
val print_integrator_stats :
('d, 'k) Ida.session -> Stdlib.out_channel -> unit
val get_num_nonlin_solv_iters : ('d, 'k) Ida.session -> int
val get_num_nonlin_solv_conv_fails : ('d, 'k) Ida.session -> int
val get_nonlin_solv_stats : ('d, 'k) Ida.session -> int * int
val set_root_direction :
('d, 'k) Ida.session -> Sundials.RootDirs.d array -> unit
val set_all_root_directions :
('d, 'k) Ida.session -> Sundials.RootDirs.d -> unit
val set_no_inactive_root_warn : ('d, 'k) Ida.session -> unit
val get_num_roots : ('d, 'k) Ida.session -> int
val get_root_info : ('d, 'k) Ida.session -> Sundials.Roots.t -> unit
val get_num_g_evals : ('d, 'k) Ida.session -> int
val get_current_cj : ('d, 'k) Ida.session -> float
val get_current_y : ('d, 'k) Ida.session -> 'd
val get_current_yp : ('d, 'k) Ida.session -> 'd
type 'd nonlin_system_data = {
tn : float;
yypred : 'd;
yppred : 'd;
yyn : 'd;
ypn : 'd;
res : 'd;
cj : float;
}
val get_nonlin_system_data :
('d, 'k) Ida.session -> 'd Ida.nonlin_system_data
val compute_y :
('d, 'k) Ida.session ->
ycor:('d, 'k) Nvector.t -> y:('d, 'k) Nvector.t -> unit
val compute_yp :
('d, 'k) Ida.session ->
ycor:('d, 'k) Nvector.t -> yp:('d, 'k) Nvector.t -> unit
exception IllInput
exception TooMuchWork
exception TooMuchAccuracy
exception ErrFailure
exception ConvergenceFailure
exception LinearInitFailure
exception LinearSetupFailure of exn option
exception LinearSolveFailure of exn option
exception NonlinearSolverFailure
exception NonlinearInitFailure
exception NonlinearSetupFailure
exception NonlinearSetupRecoverable
exception ResFuncFailure
exception FirstResFuncFailure
exception RepeatedResFuncFailure
exception RootFuncFailure
exception ConstraintFailure
exception LinesearchFailure
exception NoRecovery
exception BadEwt
exception BadK
exception BadT
exception IdNotSet
exception VectorOpErr
end