@@ -91,7 +91,7 @@ |
||
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | /** |
| 94 | - * @param $column |
|
| 94 | + * @param integer $column |
|
| 95 | 95 | * |
| 96 | 96 | * @return array |
| 97 | 97 | * |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | for ($j = 0; $j < $this->columns; ++$j) { |
| 148 | 148 | $subMatrix = $this->crossOut(0, $j); |
| 149 | 149 | $minor = $this->matrix[0][$j] * $subMatrix->getDeterminant(); |
| 150 | - $determinant += fmod((float)$j, 2.0) == 0 ? $minor : -$minor; |
|
| 150 | + $determinant += fmod((float) $j, 2.0) == 0 ? $minor : -$minor; |
|
| 151 | 151 | } |
| 152 | 152 | } |
| 153 | 153 | |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | for ($i = 0; $i < $this->rows; ++$i) { |
| 237 | 237 | for ($j = 0; $j < $this->columns; ++$j) { |
| 238 | 238 | $minor = $this->crossOut($i, $j)->getDeterminant(); |
| 239 | - $newMatrix[$i][$j] = fmod((float)($i + $j), 2.0) == 0 ? $minor : -$minor; |
|
| 239 | + $newMatrix[$i][$j] = fmod((float) ($i + $j), 2.0) == 0 ? $minor : -$minor; |
|
| 240 | 240 | } |
| 241 | 241 | } |
| 242 | 242 | |
@@ -128,7 +128,7 @@ |
||
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /** |
| 131 | - * @return mixed |
|
| 131 | + * @return integer |
|
| 132 | 132 | */ |
| 133 | 133 | public function count() |
| 134 | 134 | { |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | protected $dimension; |
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | - * @param $dimension |
|
| 20 | + * @param integer $dimension |
|
| 21 | 21 | */ |
| 22 | 22 | public function __construct($dimension) |
| 23 | 23 | { |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /** |
| 68 | - * @param object $point |
|
| 68 | + * @param Point $point |
|
| 69 | 69 | * @param null $data |
| 70 | 70 | */ |
| 71 | 71 | public function attach($point, $data = null) |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | * @param int $clustersNumber |
| 129 | 129 | * @param int $initMethod |
| 130 | 130 | * |
| 131 | - * @return array|Cluster[] |
|
| 131 | + * @return Cluster[] |
|
| 132 | 132 | */ |
| 133 | 133 | public function cluster(int $clustersNumber, int $initMethod = KMeans::INIT_RANDOM) |
| 134 | 134 | { |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | * @param $clustersNumber |
| 145 | 145 | * @param $initMethod |
| 146 | 146 | * |
| 147 | - * @return array|Cluster[] |
|
| 147 | + * @return Cluster[] |
|
| 148 | 148 | */ |
| 149 | 149 | protected function initializeClusters(int $clustersNumber, int $initMethod) |
| 150 | 150 | { |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | /** |
| 192 | - * @param $clusters |
|
| 192 | + * @param Cluster[] $clusters |
|
| 193 | 193 | * |
| 194 | 194 | * @return bool |
| 195 | 195 | */ |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | $a2 = 0; |
| 31 | 31 | $b2 = 0; |
| 32 | 32 | |
| 33 | - for ($i = 0;$i < $count;++$i) { |
|
| 33 | + for ($i = 0; $i < $count; ++$i) { |
|
| 34 | 34 | $a = $x[$i] - $meanX; |
| 35 | 35 | $b = $y[$i] - $meanY; |
| 36 | 36 | $axb = $axb + ($a * $b); |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $b2 = $b2 + pow($b, 2); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - $corr = $axb / sqrt((float)($a2 * $b2)); |
|
| 41 | + $corr = $axb / sqrt((float) ($a2 * $b2)); |
|
| 42 | 42 | |
| 43 | 43 | return $corr; |
| 44 | 44 | } |
@@ -39,6 +39,6 @@ |
||
| 39 | 39 | --$n; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - return sqrt((float)($carry / $n)); |
|
| 42 | + return sqrt((float) ($carry / $n)); |
|
| 43 | 43 | } |
| 44 | 44 | } |
@@ -30,6 +30,6 @@ |
||
| 30 | 30 | $distance += pow($a[$i] - $b[$i], 2); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - return sqrt((float)$distance); |
|
| 33 | + return sqrt((float) $distance); |
|
| 34 | 34 | } |
| 35 | 35 | } |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | $distance += $difference * $difference; |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - return $precise ? sqrt((float)$distance) : $distance; |
|
| 52 | + return $precise ? sqrt((float) $distance) : $distance; |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** |