numbl 0.0.8 → 0.0.11
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 +12 -10
- package/binding.gyp +12 -3
- package/dist-cli/cli.js +25378 -13209
- package/dist-plot-viewer/assets/index-By8VqbFA.js +4057 -0
- package/dist-plot-viewer/index.html +1 -1
- package/native/lapack_addon.cpp +26 -0
- package/native/lapack_chol.cpp +173 -0
- package/native/lapack_common.h +88 -0
- package/native/lapack_eig.cpp +143 -0
- package/native/lapack_fft.cpp +159 -0
- package/native/lapack_lu.cpp +156 -0
- package/native/lapack_qr.cpp +141 -3
- package/native/lapack_qz.cpp +389 -0
- package/native/lapack_svd.cpp +47 -9
- package/package.json +8 -4
- package/dist-plot-viewer/assets/index-_FVS_eKT.js +0 -9
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Numbl
|
|
2
2
|
|
|
3
|
-
Numbl
|
|
3
|
+
Numbl is an open-source numerical computing environment that aims to be compatible with Matlab. It works by compiling `.m` source code to JavaScript and executing it directly. It can work in the browser or on the command line.
|
|
4
4
|
|
|
5
|
-
**Early stage project.** Numbl is under active development and new functionality is being added regularly.
|
|
5
|
+
**Early stage project.** Numbl is under active development and new functionality is being added regularly.
|
|
6
6
|
|
|
7
7
|
## Try it in the browser
|
|
8
8
|
|
|
9
|
-
You can try numbl directly in the browser at <https://magland.github.io/numbl> — no installation required. All execution happens locally in your browser. Note that the browser version
|
|
9
|
+
You can try numbl directly in the browser at <https://magland.github.io/numbl> — no installation required. All execution happens locally in your browser. Note that the browser version has limited functionality and is slower than the CLI.
|
|
10
10
|
|
|
11
11
|
## Installation
|
|
12
12
|
|
|
@@ -14,20 +14,22 @@ You can try numbl directly in the browser at <https://magland.github.io/numbl>
|
|
|
14
14
|
npm install -g numbl
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
To enable fast linear algebra (matrix inverse, SVD, eigenvalues, etc.), build the native LAPACK addon
|
|
17
|
+
To enable fast linear algebra (matrix inverse, SVD, eigenvalues, etc.), build the native LAPACK addon:
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
# Prerequisites: C++ compiler, libopenblas-dev (or
|
|
20
|
+
# Prerequisites: C++ compiler, libopenblas-dev, libfftw3-dev (or equivalents for your OS)
|
|
21
21
|
numbl build-addon
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
## Usage
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
|
-
numbl script.m # run a .m file
|
|
28
|
-
numbl -e "disp(eye(3))" # run inline code
|
|
29
27
|
numbl # interactive REPL
|
|
30
|
-
numbl
|
|
28
|
+
numbl run script.m # run a .m file
|
|
29
|
+
numbl eval "disp(eye(3))" # evaluate inline code
|
|
30
|
+
numbl info # print info (JSON), including native addon status
|
|
31
|
+
numbl list-builtins # list available built-in functions
|
|
32
|
+
numbl --help # show all commands and options
|
|
31
33
|
```
|
|
32
34
|
|
|
33
35
|
## Try it with Docker
|
|
@@ -47,13 +49,13 @@ docker run -it -p 8234:8234 node:22 npx numbl --plot-port 8234
|
|
|
47
49
|
With native LAPACK support for fast linear algebra:
|
|
48
50
|
|
|
49
51
|
```bash
|
|
50
|
-
docker run -it node:22 bash -c "apt-get update && apt-get install -y libopenblas-dev && npx numbl build-addon && npx numbl"
|
|
52
|
+
docker run -it node:22 bash -c "apt-get update && apt-get install -y libopenblas-dev libfftw3-dev && npx numbl build-addon && npx numbl"
|
|
51
53
|
```
|
|
52
54
|
|
|
53
55
|
With both LAPACK and plotting:
|
|
54
56
|
|
|
55
57
|
```bash
|
|
56
|
-
docker run -it -p 8234:8234 node:22 bash -c "apt-get update && apt-get install -y libopenblas-dev && npx numbl build-addon && npx numbl --plot-port 8234"
|
|
58
|
+
docker run -it -p 8234:8234 node:22 bash -c "apt-get update && apt-get install -y libopenblas-dev libfftw3-dev && npx numbl build-addon && npx numbl --plot-port 8234"
|
|
57
59
|
```
|
|
58
60
|
|
|
59
61
|
## Upgrading
|
package/binding.gyp
CHANGED
|
@@ -6,19 +6,28 @@
|
|
|
6
6
|
"native/lapack_addon.cpp",
|
|
7
7
|
"native/lapack_inv.cpp",
|
|
8
8
|
"native/lapack_qr.cpp",
|
|
9
|
+
"native/lapack_lu.cpp",
|
|
9
10
|
"native/lapack_svd.cpp",
|
|
10
11
|
"native/lapack_matmul.cpp",
|
|
11
12
|
"native/lapack_linsolve.cpp",
|
|
12
|
-
"native/lapack_eig.cpp"
|
|
13
|
+
"native/lapack_eig.cpp",
|
|
14
|
+
"native/lapack_chol.cpp",
|
|
15
|
+
"native/lapack_qz.cpp",
|
|
16
|
+
"native/lapack_fft.cpp"
|
|
13
17
|
],
|
|
14
18
|
"include_dirs": [
|
|
15
|
-
"<!@(node -p \"require('node-addon-api').include\")"
|
|
19
|
+
"<!@(node -p \"require('node-addon-api').include\")",
|
|
20
|
+
"<!@(pkg-config --cflags-only-I fftw3 2>/dev/null | sed 's/-I//g' || true)"
|
|
16
21
|
],
|
|
17
22
|
"dependencies": [
|
|
18
23
|
"<!(node -p \"require('node-addon-api').gyp\")"
|
|
19
24
|
],
|
|
20
25
|
"defines": [ "NAPI_DISABLE_CPP_EXCEPTIONS" ],
|
|
21
|
-
"libraries": [
|
|
26
|
+
"libraries": [
|
|
27
|
+
"-lopenblas",
|
|
28
|
+
"<!@(pkg-config --libs fftw3 2>/dev/null || echo '-lfftw3')",
|
|
29
|
+
"<!@(pkg-config --libs-only-L fftw3 2>/dev/null | sed 's/-L/-Wl,-rpath,/g' || true)"
|
|
30
|
+
],
|
|
22
31
|
"cflags_cc": [ "-std=c++17", "-O2" ]
|
|
23
32
|
}
|
|
24
33
|
]
|