mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-11 14:38:39 +00:00
Fix decrement order
This commit is contained in:
parent
2f32c9e22b
commit
4b955eeb63
|
|
@ -62,7 +62,7 @@ final class MonotoneChain
|
||||||
}
|
}
|
||||||
|
|
||||||
// Upper hull
|
// Upper hull
|
||||||
for ($i = $n - 2, $t = $k + 1; $i >= 0; $i--) {
|
for ($i = $n - 2, $t = $k + 1; $i >= 0; --$i) {
|
||||||
while ($k >= $t && self::cross($result[$k - 2], $result[$k - 1], $points[$i]) <= 0) {
|
while ($k >= $t && self::cross($result[$k - 2], $result[$k - 1], $points[$i]) <= 0) {
|
||||||
$k--;
|
$k--;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ final class CholeskyDecomposition
|
||||||
}
|
}
|
||||||
|
|
||||||
// Solve L'*X = Y;
|
// Solve L'*X = Y;
|
||||||
for ($k = $this->m - 1; $k >= 0; $k--) {
|
for ($k = $this->m - 1; $k >= 0; --$k) {
|
||||||
for ($j = 0; $j < $n; ++$j) {
|
for ($j = 0; $j < $n; ++$j) {
|
||||||
for ($i = $k + 1; $i < $this->m; ++$i) {
|
for ($i = $k + 1; $i < $this->m; ++$i) {
|
||||||
$X[$k][$j] -= $X[$i][$j] * $this->L[$i][$k];
|
$X[$k][$j] -= $X[$i][$j] * $this->L[$i][$k];
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ class ArrayRandomize
|
||||||
{
|
{
|
||||||
$shuffled = [];
|
$shuffled = [];
|
||||||
|
|
||||||
for ($i = \count($arr) - 1; $i > 0; $i--) {
|
for ($i = \count($arr) - 1; $i > 0; --$i) {
|
||||||
$rnd = \mt_rand(0, $i);
|
$rnd = \mt_rand(0, $i);
|
||||||
$shuffled[$i] = $arr[$rnd];
|
$shuffled[$i] = $arr[$rnd];
|
||||||
$shuffled[$rnd] = $arr[$i];
|
$shuffled[$rnd] = $arr[$i];
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ final class CreditCard extends ValidatorAbstract
|
||||||
$len = \strlen($num);
|
$len = \strlen($num);
|
||||||
$sum = 0;
|
$sum = 0;
|
||||||
|
|
||||||
for ($i = $len - 1; $i >= 0; $i--) {
|
for ($i = $len - 1; $i >= 0; --$i) {
|
||||||
$ord = \ord($num[$i]);
|
$ord = \ord($num[$i]);
|
||||||
|
|
||||||
if (($len - 1) & $i) {
|
if (($len - 1) & $i) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user