mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-11 22:38:42 +00:00
fix type hint
This commit is contained in:
parent
a75025c1a0
commit
d8bf78c7b4
|
|
@ -136,6 +136,7 @@ final class Kmeans
|
||||||
foreach ($points as $point) {
|
foreach ($points as $point) {
|
||||||
$clusterPoint = $clusterCenters[$point->getGroup()];
|
$clusterPoint = $clusterCenters[$point->getGroup()];
|
||||||
|
|
||||||
|
// this should ensure that clusterPoint and therfore the center group is never 0. But this is not true.
|
||||||
$clusterPoint->setGroup(
|
$clusterPoint->setGroup(
|
||||||
$clusterPoint->getGroup() + 1
|
$clusterPoint->getGroup() + 1
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ class Point implements PointInterface
|
||||||
/**
|
/**
|
||||||
* Coordinates of the point
|
* Coordinates of the point
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array<int, int|float>
|
||||||
* @sicne 1.0.0
|
* @sicne 1.0.0
|
||||||
*/
|
*/
|
||||||
private array $coordinates = [];
|
private array $coordinates = [];
|
||||||
|
|
@ -81,7 +81,7 @@ class Point implements PointInterface
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function setCoordinate($index, $value)
|
public function setCoordinate($index, $value) : void
|
||||||
{
|
{
|
||||||
$this->coordinates[$index] = $value;
|
$this->coordinates[$index] = $value;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ interface PointInterface
|
||||||
*
|
*
|
||||||
* @param mixed $index Index of the coordinate (e.g. 0 = x);
|
* @param mixed $index Index of the coordinate (e.g. 0 = x);
|
||||||
*
|
*
|
||||||
* @return array
|
* @return int|float
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
@ -51,11 +51,11 @@ interface PointInterface
|
||||||
* @param mixed $index Index of the coordinate (e.g. 0 = x);
|
* @param mixed $index Index of the coordinate (e.g. 0 = x);
|
||||||
* @param mixed $value Value of the coordinate
|
* @param mixed $value Value of the coordinate
|
||||||
*
|
*
|
||||||
* @return array
|
* @return void
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function setCoordinate($index, $value);
|
public function setCoordinate($index, $value) : void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get group this point belongs to
|
* Get group this point belongs to
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user