9 lines
280 B
JavaScript
9 lines
280 B
JavaScript
|
const { parentPort, workerData } = require('worker_threads');
|
||
|
const { determinant } = require('./matrix.operations');
|
||
|
|
||
|
const partialDet = workerData.reduce((acc, job) => {
|
||
|
return acc + job.value * determinant(job.minor) * job.sign;
|
||
|
}, 0);
|
||
|
|
||
|
parentPort.postMessage(partialDet);
|