Published
Edited
Oct 16, 2020
1 fork
Importers
8 stars
Also listed in…
Hello
Insert cell
Insert cell
// https://bundle.run/nd4js
nd = require(await FileAttachment("nd4js-1.3.0").url())
Insert cell
viewof A = pt(nd.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]))
Insert cell
A.shape
Insert cell
viewof v = pt(nd.array([[1, 2, -3]]).T)
Insert cell
pt(nd.la.matmul(v.T, A, v))
Insert cell
Insert cell
Insert cell
Insert cell
viewof M = pt(nd.tabulate([1000, 100], (i, j) => Math.random() - 0.5))
Insert cell
SVD = {
const time = performance.now();
const SVD = nd.la.svd_decomp(M);
SVD.time = (performance.now() - time) | 0;
return SVD;
}
Insert cell
pt(SVD[0])
Insert cell
pt(SVD[1])
Insert cell
pt(SVD[2])
Insert cell
Insert cell
viewof E = pt(
nd.tabulate([100, 100], (i, j) =>
Math.min((i + 1) / (j + 1), (j + 1) / (i + 1))
)
)
Insert cell
Ev = {
const time = performance.now();
const Ev = nd.la.eigen(E);
Ev.time = (performance.now() - time) | 0;
return Ev;
}
Insert cell
pt(Ev[0])
Insert cell
pt(Ev[1])
Insert cell
import { pt } from "@fil/pt"
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more