mirror of
https://github.com/furyfire/trueskill.git
synced 2025-04-19 20:34:28 +00:00
Sub 200 warnings on static analysis
This commit is contained in:
@ -25,7 +25,7 @@ class GaussianLikelihoodFactor extends GaussianFactor
|
||||
$this->createVariableToMessageBinding($variable2);
|
||||
}
|
||||
|
||||
public function getLogNormalization()
|
||||
public function getLogNormalization(): float
|
||||
{
|
||||
/** @var KeyedVariable[]|mixed $vars */
|
||||
$vars = $this->getVariables();
|
||||
|
@ -15,7 +15,7 @@ class GaussianPriorFactor extends GaussianFactor
|
||||
{
|
||||
private $_newMessage;
|
||||
|
||||
public function __construct($mean, $variance, Variable $variable)
|
||||
public function __construct(float $mean, float $variance, Variable $variable)
|
||||
{
|
||||
parent::__construct(sprintf('Prior value going to %s', $variable));
|
||||
$this->_newMessage = new GaussianDistribution($mean, sqrt($variance));
|
||||
@ -25,7 +25,7 @@ class GaussianPriorFactor extends GaussianFactor
|
||||
$this->createVariableToMessageBindingWithMessage($variable, $newMessage);
|
||||
}
|
||||
|
||||
protected function updateMessageVariable(Message $message, Variable $variable)
|
||||
protected function updateMessageVariable(Message $message, Variable $variable): float
|
||||
{
|
||||
$oldMarginal = clone $variable->getValue();
|
||||
$oldMessage = $message;
|
||||
|
@ -127,7 +127,7 @@ class GaussianWeightedSumFactor extends GaussianFactor
|
||||
return $result;
|
||||
}
|
||||
|
||||
private function updateHelper(array $weights, array $weightsSquared, array $messages, array $variables)
|
||||
private function updateHelper(array $weights, array $weightsSquared, array $messages, array $variables): float
|
||||
{
|
||||
// Potentially look at http://mathworld.wolfram.com/NormalSumDistribution.html for clues as
|
||||
// to what it's doing
|
||||
@ -182,7 +182,7 @@ class GaussianWeightedSumFactor extends GaussianFactor
|
||||
return $finalDiff;
|
||||
}
|
||||
|
||||
public function updateMessageIndex($messageIndex)
|
||||
public function updateMessageIndex(int $messageIndex): float
|
||||
{
|
||||
$allMessages = $this->getMessages();
|
||||
$allVariables = $this->getVariables();
|
||||
|
Reference in New Issue
Block a user