DAS_2024_1/bondarenko_max_lab_6/det.worker.js

9 lines
280 B
JavaScript
Raw Normal View History

2024-12-14 01:03:28 +04:00
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);