@casadi/casadi-reader 0.0.0-poc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/LICENSES/GPL-3.0.txt +674 -0
- package/LICENSES/LGPL-3.0.txt +165 -0
- package/NOTICE +17 -0
- package/README.md +273 -0
- package/bin/casadi-reader.js +11 -0
- package/dist/index.js +740 -0
- package/dist/operations.js +352 -0
- package/package.json +43 -0
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
// src/scheme.js
|
|
2
|
+
var scheme_default = {
|
|
3
|
+
"wire": {
|
|
4
|
+
"magic": 123456789012345,
|
|
5
|
+
"protocol": 3
|
|
6
|
+
},
|
|
7
|
+
"operations": {
|
|
8
|
+
"OP_ACOS": 17,
|
|
9
|
+
"OP_ACOSH": 41,
|
|
10
|
+
"OP_ADD": 1,
|
|
11
|
+
"OP_ADDNONZEROS": 71,
|
|
12
|
+
"OP_ADDNONZEROS_PARAM": 72,
|
|
13
|
+
"OP_AND": 24,
|
|
14
|
+
"OP_ASIN": 16,
|
|
15
|
+
"OP_ASINH": 40,
|
|
16
|
+
"OP_ASSERTION": 76,
|
|
17
|
+
"OP_ASSIGN": 0,
|
|
18
|
+
"OP_ATAN": 18,
|
|
19
|
+
"OP_ATAN2": 43,
|
|
20
|
+
"OP_ATANH": 42,
|
|
21
|
+
"OP_BILIN": 58,
|
|
22
|
+
"OP_BSPLINE": 90,
|
|
23
|
+
"OP_CALL": 48,
|
|
24
|
+
"OP_CEIL": 27,
|
|
25
|
+
"OP_CONST": 44,
|
|
26
|
+
"OP_CONSTPOW": 9,
|
|
27
|
+
"OP_CONVEXIFY": 91,
|
|
28
|
+
"OP_COPYSIGN": 31,
|
|
29
|
+
"OP_COS": 14,
|
|
30
|
+
"OP_COSH": 38,
|
|
31
|
+
"OP_DETERMINANT": 55,
|
|
32
|
+
"OP_DIAGCAT": 62,
|
|
33
|
+
"OP_DIAGSPLIT": 65,
|
|
34
|
+
"OP_DIV": 4,
|
|
35
|
+
"OP_DOT": 57,
|
|
36
|
+
"OP_DUMP": 98,
|
|
37
|
+
"OP_EINSTEIN": 89,
|
|
38
|
+
"OP_EQ": 21,
|
|
39
|
+
"OP_ERF": 33,
|
|
40
|
+
"OP_ERFINV": 86,
|
|
41
|
+
"OP_EXP": 6,
|
|
42
|
+
"OP_EXPM1": 94,
|
|
43
|
+
"OP_FABS": 29,
|
|
44
|
+
"OP_FIND": 49,
|
|
45
|
+
"OP_FLOOR": 26,
|
|
46
|
+
"OP_FMAX": 35,
|
|
47
|
+
"OP_FMIN": 34,
|
|
48
|
+
"OP_FMOD": 28,
|
|
49
|
+
"OP_GETNONZEROS": 69,
|
|
50
|
+
"OP_GETNONZEROS_PARAM": 70,
|
|
51
|
+
"OP_HORZCAT": 60,
|
|
52
|
+
"OP_HORZREPMAT": 84,
|
|
53
|
+
"OP_HORZREPSUM": 85,
|
|
54
|
+
"OP_HORZSPLIT": 63,
|
|
55
|
+
"OP_HYPOT": 95,
|
|
56
|
+
"OP_IF_ELSE_ZERO": 32,
|
|
57
|
+
"OP_INPUT": 45,
|
|
58
|
+
"OP_INV": 36,
|
|
59
|
+
"OP_INVERSE": 56,
|
|
60
|
+
"OP_KRON": 99,
|
|
61
|
+
"OP_KRON_CONTRACT": 100,
|
|
62
|
+
"OP_LE": 20,
|
|
63
|
+
"OP_LIFT": 88,
|
|
64
|
+
"OP_LOG": 7,
|
|
65
|
+
"OP_LOG1P": 93,
|
|
66
|
+
"OP_LOGSUMEXP": 96,
|
|
67
|
+
"OP_LOW": 50,
|
|
68
|
+
"OP_LT": 19,
|
|
69
|
+
"OP_MAP": 51,
|
|
70
|
+
"OP_MMAX": 83,
|
|
71
|
+
"OP_MMIN": 82,
|
|
72
|
+
"OP_MONITOR": 77,
|
|
73
|
+
"OP_MTIMES": 52,
|
|
74
|
+
"OP_MUL": 3,
|
|
75
|
+
"OP_NE": 22,
|
|
76
|
+
"OP_NEG": 5,
|
|
77
|
+
"OP_NORM1": 79,
|
|
78
|
+
"OP_NORM2": 78,
|
|
79
|
+
"OP_NORMF": 81,
|
|
80
|
+
"OP_NORMINF": 80,
|
|
81
|
+
"OP_NOT": 23,
|
|
82
|
+
"OP_OR": 25,
|
|
83
|
+
"OP_OUTPUT": 46,
|
|
84
|
+
"OP_PARAMETER": 47,
|
|
85
|
+
"OP_POW": 8,
|
|
86
|
+
"OP_PRINTME": 87,
|
|
87
|
+
"OP_PROJECT": 75,
|
|
88
|
+
"OP_RANK1": 59,
|
|
89
|
+
"OP_REMAINDER": 97,
|
|
90
|
+
"OP_RESHAPE": 66,
|
|
91
|
+
"OP_SETNONZEROS": 73,
|
|
92
|
+
"OP_SETNONZEROS_PARAM": 74,
|
|
93
|
+
"OP_SIGN": 30,
|
|
94
|
+
"OP_SIN": 13,
|
|
95
|
+
"OP_SINH": 37,
|
|
96
|
+
"OP_SOLVE": 53,
|
|
97
|
+
"OP_SPARSITY_CAST": 92,
|
|
98
|
+
"OP_SQ": 11,
|
|
99
|
+
"OP_SQRT": 10,
|
|
100
|
+
"OP_SUB": 2,
|
|
101
|
+
"OP_SUBASSIGN": 68,
|
|
102
|
+
"OP_SUBREF": 67,
|
|
103
|
+
"OP_TAN": 15,
|
|
104
|
+
"OP_TANH": 39,
|
|
105
|
+
"OP_TRANSPOSE": 54,
|
|
106
|
+
"OP_TWICE": 12,
|
|
107
|
+
"OP_VERTCAT": 61,
|
|
108
|
+
"OP_VERTSPLIT": 64
|
|
109
|
+
},
|
|
110
|
+
"class_versions": {
|
|
111
|
+
"AlpaqaInterface": [
|
|
112
|
+
1
|
|
113
|
+
],
|
|
114
|
+
"BSplineInterpolant": [
|
|
115
|
+
1
|
|
116
|
+
],
|
|
117
|
+
"Bisection": [
|
|
118
|
+
1
|
|
119
|
+
],
|
|
120
|
+
"BlazingSplineFunction": [
|
|
121
|
+
2
|
|
122
|
+
],
|
|
123
|
+
"Blocksqp": [
|
|
124
|
+
1
|
|
125
|
+
],
|
|
126
|
+
"BonminInterface": [
|
|
127
|
+
1
|
|
128
|
+
],
|
|
129
|
+
"CbcInterface": [
|
|
130
|
+
1
|
|
131
|
+
],
|
|
132
|
+
"ClarabelInterface": [
|
|
133
|
+
1
|
|
134
|
+
],
|
|
135
|
+
"ClpInterface": [
|
|
136
|
+
1
|
|
137
|
+
],
|
|
138
|
+
"Collocation": [
|
|
139
|
+
2
|
|
140
|
+
],
|
|
141
|
+
"Conic": [
|
|
142
|
+
4
|
|
143
|
+
],
|
|
144
|
+
"ConoptInterface": [
|
|
145
|
+
1
|
|
146
|
+
],
|
|
147
|
+
"CplexInterface": [
|
|
148
|
+
1
|
|
149
|
+
],
|
|
150
|
+
"CvodesInterface": [
|
|
151
|
+
3
|
|
152
|
+
],
|
|
153
|
+
"DaqpInterface": [
|
|
154
|
+
1
|
|
155
|
+
],
|
|
156
|
+
"DirResource": [
|
|
157
|
+
1
|
|
158
|
+
],
|
|
159
|
+
"Dump": [
|
|
160
|
+
1
|
|
161
|
+
],
|
|
162
|
+
"External": [
|
|
163
|
+
2
|
|
164
|
+
],
|
|
165
|
+
"FatropConicInterface": [
|
|
166
|
+
1
|
|
167
|
+
],
|
|
168
|
+
"FatropInterface": [
|
|
169
|
+
1
|
|
170
|
+
],
|
|
171
|
+
"Feasiblesqpmethod": [
|
|
172
|
+
3
|
|
173
|
+
],
|
|
174
|
+
"FixedStepIntegrator": [
|
|
175
|
+
3
|
|
176
|
+
],
|
|
177
|
+
"Fmu2": [
|
|
178
|
+
2
|
|
179
|
+
],
|
|
180
|
+
"Fmu3": [
|
|
181
|
+
1
|
|
182
|
+
],
|
|
183
|
+
"FmuFunction": [
|
|
184
|
+
6
|
|
185
|
+
],
|
|
186
|
+
"FmuInternal": [
|
|
187
|
+
4
|
|
188
|
+
],
|
|
189
|
+
"FunctionInternal": [
|
|
190
|
+
8
|
|
191
|
+
],
|
|
192
|
+
"GenericExternal": [
|
|
193
|
+
1
|
|
194
|
+
],
|
|
195
|
+
"GurobiInterface": [
|
|
196
|
+
2
|
|
197
|
+
],
|
|
198
|
+
"HighsInterface": [
|
|
199
|
+
1
|
|
200
|
+
],
|
|
201
|
+
"HpipmInterface": [
|
|
202
|
+
1
|
|
203
|
+
],
|
|
204
|
+
"IdasInterface": [
|
|
205
|
+
2
|
|
206
|
+
],
|
|
207
|
+
"ImplicitFixedStepIntegrator": [
|
|
208
|
+
2
|
|
209
|
+
],
|
|
210
|
+
"ImporterInternal": [
|
|
211
|
+
1
|
|
212
|
+
],
|
|
213
|
+
"Integrator": [
|
|
214
|
+
3
|
|
215
|
+
],
|
|
216
|
+
"Interpolant": [
|
|
217
|
+
2
|
|
218
|
+
],
|
|
219
|
+
"IpoptInterface": [
|
|
220
|
+
3
|
|
221
|
+
],
|
|
222
|
+
"Ipqp": [
|
|
223
|
+
1
|
|
224
|
+
],
|
|
225
|
+
"KnitroInterface": [
|
|
226
|
+
2
|
|
227
|
+
],
|
|
228
|
+
"LapackLu": [
|
|
229
|
+
1
|
|
230
|
+
],
|
|
231
|
+
"LinearInterpolant": [
|
|
232
|
+
1
|
|
233
|
+
],
|
|
234
|
+
"LinsolLdl": [
|
|
235
|
+
1
|
|
236
|
+
],
|
|
237
|
+
"LinsolQr": [
|
|
238
|
+
2
|
|
239
|
+
],
|
|
240
|
+
"MXFunction": [
|
|
241
|
+
3
|
|
242
|
+
],
|
|
243
|
+
"MadmpecInterface": [
|
|
244
|
+
1
|
|
245
|
+
],
|
|
246
|
+
"MadnlpInterface": [
|
|
247
|
+
2
|
|
248
|
+
],
|
|
249
|
+
"MosekInterface": [
|
|
250
|
+
1
|
|
251
|
+
],
|
|
252
|
+
"Mumps": [
|
|
253
|
+
1
|
|
254
|
+
],
|
|
255
|
+
"Newton": [
|
|
256
|
+
1
|
|
257
|
+
],
|
|
258
|
+
"Nlpsol": [
|
|
259
|
+
5
|
|
260
|
+
],
|
|
261
|
+
"OnnxFunction": [
|
|
262
|
+
2
|
|
263
|
+
],
|
|
264
|
+
"OnnxRuntimeInterface": [
|
|
265
|
+
1
|
|
266
|
+
],
|
|
267
|
+
"OoqpInterface": [
|
|
268
|
+
1
|
|
269
|
+
],
|
|
270
|
+
"OracleFunction": [
|
|
271
|
+
3
|
|
272
|
+
],
|
|
273
|
+
"OsqpInterface": [
|
|
274
|
+
2
|
|
275
|
+
],
|
|
276
|
+
"PiqpInterface": [
|
|
277
|
+
1
|
|
278
|
+
],
|
|
279
|
+
"ProtoFunction": [
|
|
280
|
+
2
|
|
281
|
+
],
|
|
282
|
+
"ProxqpInterface": [
|
|
283
|
+
1
|
|
284
|
+
],
|
|
285
|
+
"QpToNlp": [
|
|
286
|
+
1
|
|
287
|
+
],
|
|
288
|
+
"QpoasesInterface": [
|
|
289
|
+
1
|
|
290
|
+
],
|
|
291
|
+
"Qrqp": [
|
|
292
|
+
1
|
|
293
|
+
],
|
|
294
|
+
"ResourceInternal": [
|
|
295
|
+
1
|
|
296
|
+
],
|
|
297
|
+
"Rootfinder": [
|
|
298
|
+
3
|
|
299
|
+
],
|
|
300
|
+
"RungeKutta": [
|
|
301
|
+
2
|
|
302
|
+
],
|
|
303
|
+
"SLEQPInterface": [
|
|
304
|
+
1
|
|
305
|
+
],
|
|
306
|
+
"SXFunction": [
|
|
307
|
+
4
|
|
308
|
+
],
|
|
309
|
+
"SnoptInterface": [
|
|
310
|
+
1
|
|
311
|
+
],
|
|
312
|
+
"Sqpmethod": [
|
|
313
|
+
3
|
|
314
|
+
],
|
|
315
|
+
"SundialsInterface": [
|
|
316
|
+
2
|
|
317
|
+
],
|
|
318
|
+
"SuperscsInterface": [
|
|
319
|
+
1
|
|
320
|
+
],
|
|
321
|
+
"Switch": [
|
|
322
|
+
1
|
|
323
|
+
],
|
|
324
|
+
"SymbolicQr": [
|
|
325
|
+
1
|
|
326
|
+
],
|
|
327
|
+
"UnoInterface": [
|
|
328
|
+
1
|
|
329
|
+
],
|
|
330
|
+
"WorhpInterface": [
|
|
331
|
+
1
|
|
332
|
+
],
|
|
333
|
+
"XFunction": [
|
|
334
|
+
1
|
|
335
|
+
],
|
|
336
|
+
"XpressInterface": [
|
|
337
|
+
2
|
|
338
|
+
],
|
|
339
|
+
"ZipMemResource": [
|
|
340
|
+
1
|
|
341
|
+
],
|
|
342
|
+
"ZipResource": [
|
|
343
|
+
1
|
|
344
|
+
]
|
|
345
|
+
}
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
// src/casadi-ops.js
|
|
349
|
+
var OP = Object.fromEntries(Object.entries(scheme_default.operations).map(([name, id]) => [name.slice(3).toLowerCase(), id]));
|
|
350
|
+
export {
|
|
351
|
+
OP
|
|
352
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@casadi/casadi-reader",
|
|
3
|
+
"version": "0.0.0-poc",
|
|
4
|
+
"description": "Experimental standalone reader for CasADi serialized MX functions and resources",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./dist/index.js",
|
|
9
|
+
"./operations": "./dist/operations.js"
|
|
10
|
+
},
|
|
11
|
+
"bin": {
|
|
12
|
+
"casadi-reader": "bin/casadi-reader.js"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist/index.js",
|
|
16
|
+
"dist/operations.js",
|
|
17
|
+
"bin",
|
|
18
|
+
"README.md",
|
|
19
|
+
"LICENSE",
|
|
20
|
+
"NOTICE",
|
|
21
|
+
"LICENSES"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"generate": "python3 scripts/generate-reader-assets.py",
|
|
25
|
+
"check:generated": "python3 scripts/generate-reader-assets.py --check",
|
|
26
|
+
"build": "npm run generate && node scripts/build.mjs",
|
|
27
|
+
"test": "npm run build && node --test test/*.test.mjs",
|
|
28
|
+
"test:browser": "node test/package-browser.mjs",
|
|
29
|
+
"prepack": "npm run build"
|
|
30
|
+
},
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=22"
|
|
33
|
+
},
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "https://github.com/casadi/casadi-reader.git"
|
|
37
|
+
},
|
|
38
|
+
"unpkg": "./dist/index.js",
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"esbuild": "0.28.2",
|
|
41
|
+
"playwright": "1.63.0"
|
|
42
|
+
}
|
|
43
|
+
}
|