This commit is contained in:
biglyderv 2025-01-28 18:24:26 -05:00
parent 05b4b5c59e
commit f9e0e12180

View file

@ -53,18 +53,21 @@
}
for ($i = 0; $i < 6; $i++) {
for ($i = 0; $i < 4; $i++) {
$prold = $pr;
$matrixf = $matrixe;
foreach ($result as $usera) {
$pr[$usera['username']] = 0;
$una = $usera['username'];
$pr[$una] = 0;
foreach ($result as $userb) {
$matrixe[$usera['username']][$userb['username']] = 0;
$unb = $userb['username'];
$matrixe[$una][$unb] = 0;
foreach ($result as $userc) {
$matrixe[$usera['username']][$userb['username']] += $matrixf[$usera['username']][$userc['username']] * $matrixf[$userc['username']][$userb['username']];
$unc = $userc['username'];
$matrixe[$una][$unb] += $matrixf[$una][$unc] * $matrixf[$unc][$unb];
}
$pr[$usera['username']] += $prold[$userb['username']] * $matrixe[$usera['username']][$userb['username']];
$pr[$una] += $prold[$unb] * $matrixe[$una][$unb];
}
}