Data update

This commit is contained in:
Ingy döt Net 2026-04-30 12:34:36 -04:00
parent 4bb20c9b71
commit cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions

View file

@ -0,0 +1,28 @@
function basisify(a) {
let terms = [];
for (let i = 0; i < a.length; i++) {
if (a[i] !== 0) {
terms.push(`${a[i]}*e(${i+1})`);
}
}
if (terms.length === 0) {
return "0";
}
terms = terms.map(s => s.replace("1*", ""));
return terms.join(" + ").replace("+ -", "- ");
}
const test_vectors = [[1, 2, 3],
[0, 1, 2, 3],
[1, 0, 3, 4],
[1, 2, 0],
[0, 0, 0],
[0],
[1, 1, 1],
[-1, -1, -1],
[-1, -2, 0, -3],
[-1]];
for (const s of test_vectors.map(basisify)){
console.log(s);
}