mirror of
https://github.com/furyfire/trueskill.git
synced 2025-04-19 04:14:28 +00:00
More type work
This commit is contained in:
@ -12,11 +12,11 @@ class GaussianDistribution implements \Stringable
|
||||
{
|
||||
// precision and precisionMean are used because they make multiplying and dividing simpler
|
||||
// (the the accompanying math paper for more details)
|
||||
private $precision;
|
||||
private float $precision;
|
||||
|
||||
private $precisionMean;
|
||||
private float $precisionMean;
|
||||
|
||||
private $variance;
|
||||
private float $variance;
|
||||
|
||||
public function __construct(private float $mean = 0.0, private float $standardDeviation = 1.0)
|
||||
{
|
||||
|
@ -26,7 +26,7 @@ class Range
|
||||
return $this->max;
|
||||
}
|
||||
|
||||
protected static function create(int $min, int $max): self
|
||||
protected static function create(int $min, int $max): static
|
||||
{
|
||||
return new Range($min, $max);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ namespace DNW\Skills\Numerics;
|
||||
|
||||
class SquareMatrix extends Matrix
|
||||
{
|
||||
public function __construct(...$allValues)
|
||||
public function __construct(float|int ...$allValues)
|
||||
{
|
||||
$rows = (int) sqrt(count($allValues));
|
||||
$cols = $rows;
|
||||
|
Reference in New Issue
Block a user