Module Nvector_custom.Any

module Any: sig .. end

A generic nvector interface to custom nvectors.

Create custom nvectors using the generic nvector interface where the payload is wrapped with a constructor from Nvector.gdata.


val convert_ops : inject:('d -> Nvector.gdata) ->
project:(Nvector.gdata -> 'd) ->
'd Nvector_custom.nvector_ops -> Nvector.gdata Nvector_custom.nvector_ops

Adapt a set of nvector operations so that they work with a payload of type Nvector.gdata. It is better to manually implement the fused and array operations to avoid the creation of intermediate arrays.

The project function should raise Nvector.BadGenericType if applied to the wrong constructor.

val make_wrap : Nvector.gdata Nvector_custom.nvector_ops ->
inject:('d -> Nvector.gdata) ->
?context:Sundials.Context.t ->
?with_fused_ops:bool ->
?with_linear_combination:bool ->
?with_scale_add_multi:bool ->
?with_dot_prod_multi:bool ->
?with_linear_sum_vector_array:bool ->
?with_scale_vector_array:bool ->
?with_const_vector_array:bool ->
?with_wrms_norm_vector_array:bool ->
?with_wrms_norm_mask_vector_array:bool ->
?with_scale_add_multi_vector_array:bool ->
?with_linear_combination_vector_array:bool -> 'd -> Nvector.any

Instantiation of custom nvectors. make_wrap ops takes set a set of operations on the data type Nvector.gdata and yields a function for lifting values of type Nvector.gdata into generic nvectors which can be passed to a solver.

The optional arguments permit to enable fused and array operations for a given nvector (they are disabled by default).