From 5368f7528e5023bc3cdba908a3dedd53e48f9d97 Mon Sep 17 00:00:00 2001 From: Jeff Moser Date: Thu, 30 Sep 2010 07:07:05 -0400 Subject: [PATCH] Checkpoint before another reference pass --- PHPSkills/FactorGraphs/Factor.php | 4 ++-- PHPSkills/TrueSkill/Factors/GaussianGreaterThanFactor.php | 2 +- PHPSkills/TrueSkill/Factors/GaussianWeightedSumFactor.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/PHPSkills/FactorGraphs/Factor.php b/PHPSkills/FactorGraphs/Factor.php index ad571e3..427c517 100644 --- a/PHPSkills/FactorGraphs/Factor.php +++ b/PHPSkills/FactorGraphs/Factor.php @@ -49,8 +49,8 @@ abstract class Factor public function updateMessageIndex($messageIndex) { Guard::argumentIsValidIndex($messageIndex, count($this->_messages), "messageIndex"); - $message = $this->_messages[$messageIndex]; - $variable = $this->_messageToVariableBinding->getValue($this->_messages[$messageIndex]); + $message = &$this->_messages[$messageIndex]; + $variable = &$this->_messageToVariableBinding->getValue($this->_messages[$messageIndex]); return $this->updateMessageVariable($message, $variable); } diff --git a/PHPSkills/TrueSkill/Factors/GaussianGreaterThanFactor.php b/PHPSkills/TrueSkill/Factors/GaussianGreaterThanFactor.php index ba9623b..073cefd 100644 --- a/PHPSkills/TrueSkill/Factors/GaussianGreaterThanFactor.php +++ b/PHPSkills/TrueSkill/Factors/GaussianGreaterThanFactor.php @@ -58,7 +58,7 @@ class GaussianGreaterThanFactor extends GaussianFactor $epsilsonTimesSqrtC = $this->_epsilon*$sqrtC; $d = $messageFromVar->getPrecisionMean(); - $denom = 1.0 - TruncatedGaussianCorrectionFunctions::vExceedsMargin($dOnSqrtC, $epsilsonTimesSqrtC); + $denom = 1.0 - TruncatedGaussianCorrectionFunctions::wExceedsMargin($dOnSqrtC, $epsilsonTimesSqrtC); $newPrecision = $c/$denom; $newPrecisionMean = ($d + diff --git a/PHPSkills/TrueSkill/Factors/GaussianWeightedSumFactor.php b/PHPSkills/TrueSkill/Factors/GaussianWeightedSumFactor.php index d1f18e9..03a9729 100644 --- a/PHPSkills/TrueSkill/Factors/GaussianWeightedSumFactor.php +++ b/PHPSkills/TrueSkill/Factors/GaussianWeightedSumFactor.php @@ -218,8 +218,8 @@ class GaussianWeightedSumFactor extends GaussianFactor $allMessagesCount = count($allMessages); for ($i = 0; $i < $allMessagesCount; $i++) { - $updatedMessages[] =$allMessages[$indicesToUse[$i]]; - $updatedVariables[] = $allVariables[$indicesToUse[$i]]; + $updatedMessages[] = &$allMessages[$indicesToUse[$i]]; + $updatedVariables[] = &$allVariables[$indicesToUse[$i]]; } return $this->updateHelper($this->_weights[$messageIndex],