mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-01-14 08:37:56 +00:00
Docs: Update benchmark for openrouter/bert-nebulon-alpha
This commit is contained in:
15
tests/4_determinant/outputs/openrouter_bert-nebulon-alpha.js
Normal file
15
tests/4_determinant/outputs/openrouter_bert-nebulon-alpha.js
Normal file
@@ -0,0 +1,15 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user