forked from miking-lang/miking
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsundials.ext-ocaml.mc
58 lines (55 loc) · 1.41 KB
/
sundials.ext-ocaml.mc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
include "map.mc"
include "ocaml/ast.mc"
let impl = lam arg : { expr : String, ty : Type }.
{ expr = arg.expr, ty = arg.ty, libraries = ["sundialsml"], cLibraries = [] }
let tyrealarray = otyvarext_ "Sundials.RealArray.t" []
let sundialsExtMap =
use OCamlTypeAst in
mapFromSeq cmpString
[
("nvectorSerialWrap", [
impl {
expr = "Nvector_serial.wrap",
ty = tyarrow_ (otybaarrayclayoutfloat_ 1) otyopaque_
}
]),
("nvectorSerialUnwrap", [
impl {
expr = "Nvector_serial.unwrap",
ty = tyarrow_ otyopaque_ (otybaarrayclayoutfloat_ 1)
}
]),
("sundialsMatrixDense", [
impl {
expr = "Sundials.Matrix.dense",
ty = tyarrows_ [tyint_, otyopaque_]
}
]),
("sundialsMatrixDenseUnwrap", [
impl {
expr = "Sundials.Matrix.Dense.unwrap",
ty = tyarrows_ [otyopaque_, (otybaarrayclayoutfloat_ 2)]
}
]),
("sundialsNonlinearSolverNewtonMake", [
impl {
expr = "Sundials_NonlinearSolver.Newton.make",
ty =
tyarrows_ [
otyopaque_,
otyopaque_
]
}
]),
("sundialsNonlinearSolverFixedPointMake", [
impl {
expr = "Sundials_NonlinearSolver.FixedPoint.make",
ty =
tyarrows_ [
otylabel_ "acceleration_vectors" tyint_,
otyopaque_,
otyopaque_
]
}
])
]