-
Notifications
You must be signed in to change notification settings - Fork 1
/
signatures.html
112 lines (106 loc) · 6.4 KB
/
signatures.html
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<html>
<head>
<script
src="https://github.com/stan-dev/stanc3/releases/download/nightly/stanc.js"></script>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="prism/prism.js"></script>
<script src="demo.js"></script>
<script>
function sortOnKeys(dict) {
var sorted = [];
for(var key in dict) {
sorted[sorted.length] = key;
}
sorted.sort();
var tempDict = {};
for(var i = 0; i < sorted.length; i++) {
tempDict[sorted[i]] = dict[sorted[i]];
}
return tempDict;
}
var sigs;
var functions_sigs = {};
$(document).ready(function(){
var request = new XMLHttpRequest();
request.open('GET', 'https://raw.githubusercontent.com/stan-dev/stanc3/master/test/integration/signatures/stan_math_signatures.t', true);
request.send(null);
request.onreadystatechange = function () {
if (request.readyState === 4 && request.status === 200) {
var type = request.getResponseHeader('Content-Type');
sigs = request.responseText;
sigs = sigs.match(/[^\r\n]+/g);
var i = 0;
for (i in sigs) {
if (sigs[i].includes("=>")) {
let fun = sigs[i].split("(")[0].trim()
if (functions_sigs[fun]) {
functions_sigs[fun] += "<br/>" + sigs[i]
} else {
functions_sigs[fun] = sigs[i]
}
}
i+=1
}
// add variadic signatures
functions_sigs["reduce_sum"] = "reduce_sum((array[] T, int, int, ... ) => real, array[] T, int, ... ) => real"
functions_sigs["reduce_sum_static"] = "reduce_sum((array[] T, int, int, ... ) => real, array[] T, int, ... ) => real"
functions_sigs["ode_rk45"] = "ode_rk45((real, vector, ...) => vector, vector, real, array[] real, ... ) => array[] vector"
functions_sigs["ode_ckrk"] = "ode_ckrk((real, vector, ...) => vector, vector, real, array[] real, ... ) => array[] vector"
functions_sigs["ode_adams"] = "ode_adams((real, vector, ...) => vector, vector, real, array[] real, ... ) => array[] vector"
functions_sigs["ode_bdf"] = "ode_bdf((real, vector, ...) => vector, vector, real, array[] real, ... ) => array[] vector"
functions_sigs["ode_rk45_tol"] = "ode_rk45_tol((real, vector, ...) => vector, vector, real, array[] real, data real rel_tol, data real abs_tol, int max_num_steps, ... ) => array[] vector"
functions_sigs["ode_ckrk_tol"] = "ode_ckrk_tol((real, vector, ...) => vector, vector, real, array[] real, data real rel_tol, data real abs_tol, int max_num_steps, ... ) => array[] vector"
functions_sigs["ode_adams_tol"] = "ode_adams_tol((real, vector, ...) => vector, vector, real, array[] real, data real rel_tol, data real abs_tol, int max_num_steps, ... ) => array[] vector"
functions_sigs["ode_bdf_tol"] = "ode_bdf_tol((real, vector, ...) => vector, vector, real, array[] real, data real rel_tol, data real abs_tol, int max_num_steps, ... ) => array[] vector"
functions_sigs["ode_adjoint_tol_ctl"] = "ode_adjoint_tol_ctl((real, vector, ...) => vector, vector, real, array[] real, data real, data vector, data real, data vector, int, int, int, int, int, ...) => array[] vector"
var keys = Object.keys(functions_sigs);
keys = keys.sort(function(a, b) {
if (a.toLowerCase() < b.toLowerCase()) return -1;
if (a.toLowerCase() > b.toLowerCase()) return 1;
return 0;
});
var functions = $("#functions")
var selected = 0;
for (var i=0; i<keys.length; i++) {
let f = keys[i];
if (GetURLParameter("function") == f) {
functions.append($("<option />").val(f).text(f).attr('selected','selected'));
$("#list").html(functions_sigs[keys[i]])
selected = 1
} else {
functions.append($("<option />").val(f).text(f));
}
}
if (selected == 0) {
$("#list").html(functions_sigs[keys[0]])
}
}
}
$("#functions").change(function() {
$("#list").html(functions_sigs[$("#functions").val()])
})
});
</script>
<link rel="stylesheet" type="text/css" href="style.css?ver=5">
<link href="prism.css" rel="stylesheet" />
<title>Stan supported functions and signatures</title>
</head>
<body>
<main>
<div class="page-links"><a class="selected" href="index.html">Print C++</a></div>
<div class="page-links"><a href="pedantic.html">Pedantic check</a></div>
<div class="page-links selected-link"><a href="signatures.html">Supported
signatures</a></div>
<div class="page-links"><a href="optimization.html">Optimization diff</a></div>
<div class="page-links"><a href="autoformat.html">Auto format</a></div>
<div class="page-links"><a href="canonicalizer.html">Canonicalizer</a></div>
<div style="clear:both"></div>
<br>
<div id="list-title">Select a function name:</div>
<select id="functions"></select>
<div id="list-title">Supported signatures:</div>
<div id="list"></div>
</main>
</body>
</html>