Much stricter coding standards for phpstan, phpstan and psalm.

This commit is contained in:
2025-04-15 08:14:08 +00:00
parent 3c617e9869
commit b38a9656eb
63 changed files with 137 additions and 134 deletions

View File

@@ -7,7 +7,7 @@ namespace DNW\Skills\FactorGraphs;
/**
* Helper class for computing the factor graph's normalization constant.
*/
class FactorList
final class FactorList
{
/**
* @var Factor[] $list
@@ -31,11 +31,11 @@ class FactorList
$numberOfMessages = $factor->getNumberOfMessages();
for ($j = 0; $j < $numberOfMessages; ++$j) {
$sumLogZ += $factor->sendMessageIndex($j);
$sumLogZ += (float)$factor->sendMessageIndex($j);
}
}
$sumLogS = 0;
$sumLogS = 0.0;
foreach ($list as &$currentFactor) {
$sumLogS += $currentFactor->getLogNormalization();