mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-01-14 00:27:55 +00:00
Docs: Update benchmark results
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const calculateDeterminant = async (matrix) => {
|
||||
const { det } = await import('https://cdn.jsdelivr.net/npm/mathjs@13.0.0/+esm');
|
||||
const { det } = await import('https://cdn.jsdelivr.net/npm/mathjs@13.0.0/es/index.js');
|
||||
return det(matrix);
|
||||
};
|
||||
export default calculateDeterminant;
|
||||
@@ -0,0 +1,5 @@
|
||||
const calculateDeterminant = async m => {
|
||||
const { det } = await import('https://esm.sh/mathjs')
|
||||
return det(m)
|
||||
}
|
||||
export default calculateDeterminant;
|
||||
@@ -1,8 +1,13 @@
|
||||
let math;
|
||||
const URL = 'https://cdn.jsdelivr.net/npm/mathjs@11.11.0/+esm';
|
||||
let det;
|
||||
|
||||
async function calculateDeterminant(m) {
|
||||
const n = m?.length;
|
||||
if (!n || m.some(r => !Array.isArray(r) || r.length !== n)) throw new Error('Invalid matrix');
|
||||
math ||= await import('https://cdn.jsdelivr.net/npm/mathjs@11.11.0/+esm');
|
||||
return math.det(m);
|
||||
const v = Array.isArray(m) && m.length && m.every(r => Array.isArray(r) && r.length === m.length);
|
||||
if (!v) throw new TypeError('Invalid matrix');
|
||||
|
||||
det ||= await import(URL).then(m => m.det).catch(() => { throw new Error('Load failed'); });
|
||||
|
||||
try { return det(m); }
|
||||
catch { throw new Error('Calc failed'); }
|
||||
}
|
||||
export default calculateDeterminant;
|
||||
@@ -1,5 +0,0 @@
|
||||
async function calculateDeterminant(m){
|
||||
const {det}=await import('https://cdn.jsdelivr.net/npm/mathjs@14.0.0/+esm')
|
||||
return det(m)
|
||||
}
|
||||
export default calculateDeterminant;
|
||||
@@ -1,5 +1,5 @@
|
||||
const calculateDeterminant=async m=>{
|
||||
const {det}=await import('https://cdn.skypack.dev/mathjs')
|
||||
async function calculateDeterminant(m){
|
||||
const {det}=await import('https://cdn.jsdelivr.net/npm/mathjs@11.11.1/+esm')
|
||||
return det(m)
|
||||
}
|
||||
export default calculateDeterminant;
|
||||
@@ -1,5 +0,0 @@
|
||||
const calculateDeterminant=async m=>{
|
||||
const{math}=await import('https://cdn.jsdelivr.net/npm/mathjs@12.4.2/lib/browser/math.js');
|
||||
return math.det(m);
|
||||
};
|
||||
export default calculateDeterminant;
|
||||
@@ -1,5 +1,2 @@
|
||||
async function calculateDeterminant(matrix) {
|
||||
const { det } = await import('https://esm.sh/mathjs');
|
||||
return det(matrix);
|
||||
}
|
||||
async function calculateDeterminant(matrix){const math=await import('https://esm.sh/mathjs');return math.det(matrix);}
|
||||
export default calculateDeterminant;
|
||||
Reference in New Issue
Block a user