DAS_2024_1/bondarenko_max_lab_6/det.worker.js

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);