PSR1, PSR2 and PSR12 code standards

This commit is contained in:
2024-01-31 14:15:55 +00:00
parent 51a73ead83
commit f9e3b344d6
5 changed files with 56 additions and 69 deletions

View File

@ -74,16 +74,8 @@ class Matrix
$transposeMatrix = [];
$rowMatrixData = $this->matrixRowData;
for (
$currentRowTransposeMatrix = 0;
$currentRowTransposeMatrix < $this->columnCount;
$currentRowTransposeMatrix++
) {
for (
$currentColumnTransposeMatrix = 0;
$currentColumnTransposeMatrix < $this->rowCount;
$currentColumnTransposeMatrix++
) {
for ($currentRowTransposeMatrix = 0; $currentRowTransposeMatrix < $this->columnCount; $currentRowTransposeMatrix++) {
for ($currentColumnTransposeMatrix = 0; $currentColumnTransposeMatrix < $this->rowCount; $currentColumnTransposeMatrix++) {
$transposeMatrix[$currentRowTransposeMatrix][$currentColumnTransposeMatrix] =
$rowMatrixData[$currentColumnTransposeMatrix][$currentRowTransposeMatrix];
}
@ -214,11 +206,7 @@ class Matrix
public static function add(Matrix $left, Matrix $right): Matrix
{
if (
($left->getRowCount() != $right->getRowCount())
|| ($left->getColumnCount() != $right->getColumnCount())
) {
if (($left->getRowCount() != $right->getRowCount()) || ($left->getColumnCount() != $right->getColumnCount())) {
throw new Exception('Matrices must be of the same size');
}

View File

@ -79,11 +79,7 @@ class GaussianWeightedSumFactor extends GaussianFactor
// This is helpful since we skip over one of the spots
$currentDestinationWeightIndex = 0;
for (
$currentWeightSourceIndex = 0;
$currentWeightSourceIndex < $variableWeightsLength;
$currentWeightSourceIndex++
) {
for ($currentWeightSourceIndex = 0; $currentWeightSourceIndex < $variableWeightsLength; $currentWeightSourceIndex++) {
if ($currentWeightSourceIndex === $weightsIndex - 1) {
continue;
}