@@ -2,16 +2,14 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Samsara\Fermat\Provider\Distribution; |
| 4 | 4 | |
| 5 | -use RandomLib\Factory; |
|
| 6 | -use Samsara\Exceptions\UsageError\IntegrityConstraint; |
|
| 7 | -use Samsara\Exceptions\UsageError\OptionalExit; |
|
| 8 | -use Samsara\Fermat\Numbers; |
|
| 9 | -use Samsara\Fermat\Provider\Distribution\Base\Distribution; |
|
| 10 | -use Samsara\Fermat\Provider\StatsProvider; |
|
| 11 | -use Samsara\Fermat\Types\Base\DecimalInterface; |
|
| 12 | -use Samsara\Fermat\Types\Base\NumberCollectionInterface; |
|
| 13 | -use Samsara\Fermat\Types\Base\NumberInterface; |
|
| 14 | -use Samsara\Fermat\Types\NumberCollection; |
|
| 5 | +use RandomLib\Factory; |
|
| 6 | +use Samsara\Exceptions\UsageError\IntegrityConstraint; |
|
| 7 | +use Samsara\Exceptions\UsageError\OptionalExit; |
|
| 8 | +use Samsara\Fermat\Numbers; |
|
| 9 | +use Samsara\Fermat\Provider\Distribution\Base\Distribution; |
|
| 10 | +use Samsara\Fermat\Provider\StatsProvider; |
|
| 11 | +use Samsara\Fermat\Types\Base\DecimalInterface; |
|
| 12 | +use Samsara\Fermat\Types\Base\NumberInterface; |
|
| 15 | 13 | use Samsara\Fermat\Values\ImmutableNumber; |
| 16 | 14 | |
| 17 | 15 | class Normal extends Distribution |
@@ -2,14 +2,14 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Samsara\Fermat\Provider\Distribution; |
| 4 | 4 | |
| 5 | -use RandomLib\Factory; |
|
| 6 | -use Samsara\Exceptions\SystemError\LogicalError\IncompatibleObjectState; |
|
| 7 | -use Samsara\Exceptions\UsageError\IntegrityConstraint; |
|
| 8 | -use Samsara\Exceptions\UsageError\OptionalExit; |
|
| 9 | -use Samsara\Fermat\Numbers; |
|
| 10 | -use Samsara\Fermat\Provider\Distribution\Base\Distribution; |
|
| 11 | -use Samsara\Fermat\Types\Base\DecimalInterface; |
|
| 12 | -use Samsara\Fermat\Types\Base\NumberInterface; |
|
| 5 | +use RandomLib\Factory; |
|
| 6 | +use Samsara\Exceptions\SystemError\LogicalError\IncompatibleObjectState; |
|
| 7 | +use Samsara\Exceptions\UsageError\IntegrityConstraint; |
|
| 8 | +use Samsara\Exceptions\UsageError\OptionalExit; |
|
| 9 | +use Samsara\Fermat\Numbers; |
|
| 10 | +use Samsara\Fermat\Provider\Distribution\Base\Distribution; |
|
| 11 | +use Samsara\Fermat\Types\Base\DecimalInterface; |
|
| 12 | +use Samsara\Fermat\Types\Base\NumberInterface; |
|
| 13 | 13 | use Samsara\Fermat\Values\ImmutableNumber; |
| 14 | 14 | |
| 15 | 15 | class Poisson extends Distribution |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | if ($terms > 2) { |
| 33 | - for ($n = 2;$n < $terms;$n++) { |
|
| 33 | + for ($n = 2; $n < $terms; $n++) { |
|
| 34 | 34 | $kN = $k1->add($k2); |
| 35 | 35 | $collection->push($kN); |
| 36 | 36 | |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | */ |
| 117 | 117 | public function sort(): NumberCollectionInterface |
| 118 | 118 | { |
| 119 | - $this->getCollection()->sort(function($left, $right){ |
|
| 119 | + $this->getCollection()->sort(function($left, $right) { |
|
| 120 | 120 | return ArithmeticProvider::compare($left, $right); |
| 121 | 121 | }); |
| 122 | 122 | |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | */ |
| 250 | 250 | public function getRandom(): NumberInterface |
| 251 | 251 | { |
| 252 | - $maxKey = $this->getCollection()->count() - 1; |
|
| 252 | + $maxKey = $this->getCollection()->count()-1; |
|
| 253 | 253 | |
| 254 | 254 | try { |
| 255 | 255 | $key = random_int(0, $maxKey); |
@@ -25,6 +25,6 @@ |
||
| 25 | 25 | return $sample; |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - abstract public function rangeRandom($min = 0, $max = PHP_INT_MAX, int $maxIterations = 20): ImmutableNumber; |
|
| 28 | + abstract public function rangeRandom($min = 0, $max = PHP_INT_MAX, int $maxIterations = 20): ImmutableNumber; |
|
| 29 | 29 | |
| 30 | 30 | } |
| 31 | 31 | \ No newline at end of file |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | { |
| 19 | 19 | $sample = new NumberCollection(); |
| 20 | 20 | |
| 21 | - for ($i = 1;$i < $sampleSize;$i++) { |
|
| 21 | + for ($i = 1; $i < $sampleSize; $i++) { |
|
| 22 | 22 | $sample->push($this->random()); |
| 23 | 23 | } |
| 24 | 24 | |