numbl 0.0.22 → 0.1.0
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/README.md +2 -3
- package/binding.gyp +6 -4
- package/dist-cli/cli.js +33457 -30228
- package/native/elemwise.cpp +168 -0
- package/native/lapack_chol.cpp +1 -1
- package/native/lapack_eig.cpp +1 -1
- package/native/lapack_fft.cpp +1 -1
- package/native/lapack_fft_batch.cpp +1 -1
- package/native/lapack_inv.cpp +1 -1
- package/native/lapack_linsolve.cpp +1 -1
- package/native/lapack_lu.cpp +1 -1
- package/native/lapack_matmul.cpp +1 -1
- package/native/lapack_matmul_complex.cpp +110 -0
- package/native/lapack_qr.cpp +213 -1
- package/native/lapack_qz.cpp +1 -1
- package/native/lapack_svd.cpp +1 -1
- package/native/{lapack_addon.cpp → numbl_addon.cpp} +34 -3
- package/native/{lapack_common.h → numbl_addon_common.h} +20 -1
- package/package.json +2 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Common includes, type definitions, LAPACK/BLAS declarations, and function
|
|
3
|
-
* prototypes shared across the
|
|
3
|
+
* prototypes shared across the numbl_addon source files.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
#pragma once
|
|
@@ -43,6 +43,9 @@ extern "C" {
|
|
|
43
43
|
// Generate the m×n (or m×m) orthogonal matrix Q from dgeqrf reflectors
|
|
44
44
|
void dorgqr_(int* m, int* n, int* k, double* a, int* lda, double* tau,
|
|
45
45
|
double* work, int* lwork, int* info);
|
|
46
|
+
// Column-pivoted QR factorisation: A*P = Q*R
|
|
47
|
+
void dgeqp3_(int* m, int* n, double* a, int* lda, int* jpvt,
|
|
48
|
+
double* tau, double* work, int* lwork, int* info);
|
|
46
49
|
|
|
47
50
|
// ── Complex QR factorisation ───────────────────────────────────────────────
|
|
48
51
|
// Compute QR factorisation of a general complex m×n matrix: A = Q * R
|
|
@@ -53,6 +56,10 @@ extern "C" {
|
|
|
53
56
|
void zungqr_(int* m, int* n, int* k, lapack_complex_double* a, int* lda,
|
|
54
57
|
lapack_complex_double* tau,
|
|
55
58
|
lapack_complex_double* work, int* lwork, int* info);
|
|
59
|
+
// Column-pivoted complex QR factorisation: A*P = Q*R
|
|
60
|
+
void zgeqp3_(int* m, int* n, lapack_complex_double* a, int* lda, int* jpvt,
|
|
61
|
+
lapack_complex_double* tau, lapack_complex_double* work,
|
|
62
|
+
int* lwork, double* rwork, int* info);
|
|
56
63
|
|
|
57
64
|
// ── SVD ───────────────────────────────────────────────────────────────────
|
|
58
65
|
// Compute SVD using divide-and-conquer: A = U * Sigma * V^T
|
|
@@ -83,6 +90,13 @@ extern "C" {
|
|
|
83
90
|
double* b, int* ldb,
|
|
84
91
|
double* beta, double* c, int* ldc);
|
|
85
92
|
|
|
93
|
+
// Complex matrix-matrix multiplication: C = alpha * op(A) * op(B) + beta * C
|
|
94
|
+
void zgemm_(char* transa, char* transb,
|
|
95
|
+
int* m, int* n, int* k,
|
|
96
|
+
lapack_complex_double* alpha, lapack_complex_double* a, int* lda,
|
|
97
|
+
lapack_complex_double* b, int* ldb,
|
|
98
|
+
lapack_complex_double* beta, lapack_complex_double* c, int* ldc);
|
|
99
|
+
|
|
86
100
|
// ── Linear solve (square) ─────────────────────────────────────────────────
|
|
87
101
|
// LU factorisation + solve: A * X = B (A is n×n, B is n×nrhs)
|
|
88
102
|
// On exit A contains the LU factors; B contains X.
|
|
@@ -247,12 +261,15 @@ inline bool checkLapackInfo(Napi::Env env, int info_val,
|
|
|
247
261
|
Napi::Value Inv(const Napi::CallbackInfo& info);
|
|
248
262
|
Napi::Value InvComplex(const Napi::CallbackInfo& info);
|
|
249
263
|
Napi::Value Qr(const Napi::CallbackInfo& info);
|
|
264
|
+
Napi::Value QrPivot(const Napi::CallbackInfo& info);
|
|
265
|
+
Napi::Value QrPivotComplex(const Napi::CallbackInfo& info);
|
|
250
266
|
Napi::Value QrComplex(const Napi::CallbackInfo& info);
|
|
251
267
|
Napi::Value Lu(const Napi::CallbackInfo& info);
|
|
252
268
|
Napi::Value LuComplex(const Napi::CallbackInfo& info);
|
|
253
269
|
Napi::Value Svd(const Napi::CallbackInfo& info);
|
|
254
270
|
Napi::Value SvdComplex(const Napi::CallbackInfo& info);
|
|
255
271
|
Napi::Value Matmul(const Napi::CallbackInfo& info);
|
|
272
|
+
Napi::Value MatmulComplex(const Napi::CallbackInfo& info);
|
|
256
273
|
Napi::Value Linsolve(const Napi::CallbackInfo& info);
|
|
257
274
|
Napi::Value LinsolveComplex(const Napi::CallbackInfo& info);
|
|
258
275
|
Napi::Value Eig(const Napi::CallbackInfo& info);
|
|
@@ -264,3 +281,5 @@ Napi::Value QzComplex(const Napi::CallbackInfo& info);
|
|
|
264
281
|
Napi::Value Fft1d(const Napi::CallbackInfo& info);
|
|
265
282
|
Napi::Value Fft1dComplex(const Napi::CallbackInfo& info);
|
|
266
283
|
Napi::Value FftAlongDim(const Napi::CallbackInfo& info);
|
|
284
|
+
Napi::Value Elemwise(const Napi::CallbackInfo& info);
|
|
285
|
+
Napi::Value ElemwiseComplex(const Napi::CallbackInfo& info);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "numbl",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Run .m source files in the browser and on the command line by compiling to JavaScript",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"test:coverage": "vitest run --coverage",
|
|
51
51
|
"test:coverage:all": "bash scripts/coverage-all.sh",
|
|
52
52
|
"test:scripts": "bash numbl_test_scripts/run_all.sh",
|
|
53
|
+
"test:jit": "tsx src/cli.ts run-tests numbl_test_scripts/jit --opt 1",
|
|
53
54
|
"build:wasm": "bash numbl_test_scripts/build_wasm.sh",
|
|
54
55
|
"update-readme": "tsx scripts/update-readme-usage.ts",
|
|
55
56
|
"check-readme": "tsx scripts/update-readme-usage.ts --check",
|