mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-01-14 00:27:55 +00:00
Docs: Update benchmark for test 4
This commit is contained in:
@@ -1,5 +0,0 @@
|
|||||||
async function calculateDeterminant(matrix) {
|
|
||||||
const { det } = await import("https://esm.run/mathjs");
|
|
||||||
return det(matrix);
|
|
||||||
}
|
|
||||||
export default calculateDeterminant;
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
const calculateDeterminant = async (matrix) => {
|
|
||||||
const { det } = await import('https://cdn.jsdelivr.net/npm/mathjs@11/+esm');
|
|
||||||
return det(matrix);
|
|
||||||
};
|
|
||||||
export default calculateDeterminant;
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
const calculateDeterminant = async (matrix) => {
|
|
||||||
const { det } = await import('https://cdn.jsdelivr.net/npm/mathjs@13.0.0/es/index.js');
|
|
||||||
return det(matrix);
|
|
||||||
};
|
|
||||||
export default calculateDeterminant;
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
const calculateDeterminant = async m => {
|
|
||||||
const { det } = await import('https://cdn.jsdelivr.net/npm/mathjs/+esm')
|
|
||||||
return det(m)
|
|
||||||
}
|
|
||||||
export default calculateDeterminant;
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
let mathLib;
|
|
||||||
|
|
||||||
async function calculateDeterminant(m) {
|
|
||||||
if (!Array.isArray(m) || !m.length || m.some(r => !Array.isArray(r) || r.length !== m.length)) {
|
|
||||||
throw new TypeError('Invalid square matrix');
|
|
||||||
}
|
|
||||||
|
|
||||||
const {det} = await (mathLib ||= import('https://cdn.jsdelivr.net/npm/mathjs@11.11.0/lib/browser/math.js'));
|
|
||||||
return det(m);
|
|
||||||
}
|
|
||||||
export default calculateDeterminant;
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
let d
|
|
||||||
const calculateDeterminant=async m=> (await (d??=import('https://cdn.jsdelivr.net/npm/mathjs@11.11.0/+esm'))).det(m)
|
|
||||||
export default calculateDeterminant;
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
const calculateDeterminant = async matrix => {
|
|
||||||
const { create } = await import('https://cdn.jsdelivr.net/npm/mathjs@11.7.0/+esm')
|
|
||||||
const math = create()
|
|
||||||
|
|
||||||
if (!Array.isArray(matrix) || !matrix.every(Array.isArray)) {
|
|
||||||
throw new TypeError('Input must be an array of arrays')
|
|
||||||
}
|
|
||||||
|
|
||||||
if (matrix.length === 0 || matrix.some(row => row.length !== matrix.length)) {
|
|
||||||
throw new Error('Matrix must be square (n x n)')
|
|
||||||
}
|
|
||||||
|
|
||||||
return math.det(matrix)
|
|
||||||
}
|
|
||||||
export default calculateDeterminant;
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
async function calculateDeterminant(m){const{det}=await import('https://esm.sh/mathjs');return det(m);}
|
|
||||||
export default calculateDeterminant;
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
async function calculateDeterminant(matrix) {
|
|
||||||
const { default: math } = await import('https://cdn.jsdelivr.net/npm/mathjs/lib/browser/math.js');
|
|
||||||
return math.det(matrix);
|
|
||||||
}
|
|
||||||
export default calculateDeterminant;
|
|
||||||
Reference in New Issue
Block a user