mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-12 23:08:41 +00:00
code fixes
This commit is contained in:
parent
513fa7bf8b
commit
0b5d51f9b8
|
|
@ -177,7 +177,7 @@ final class MarkovChain
|
||||||
|
|
||||||
$prob = 1.0;
|
$prob = 1.0;
|
||||||
for ($i = $this->order; $i < $length; ++$i) {
|
for ($i = $this->order; $i < $length; ++$i) {
|
||||||
$prob *= $this->data[\implode($key)][$path[$i]] ?? 0.0;
|
$prob *= $this->data[\implode(' ', $key)][$path[$i]] ?? 0.0;
|
||||||
|
|
||||||
$key[] = $path[$i];
|
$key[] = $path[$i];
|
||||||
\array_shift($key);
|
\array_shift($key);
|
||||||
|
|
|
||||||
|
|
@ -433,7 +433,7 @@ final class ReadMapper extends DataMapperAbstract
|
||||||
$query = $this->getQuery(
|
$query = $this->getQuery(
|
||||||
null,
|
null,
|
||||||
[
|
[
|
||||||
'COUNT(' . (empty($this->columns) ? '*' : \implode($this->columns)) . ')' => 'count'
|
'COUNT(' . (empty($this->columns) ? '*' : \implode(',', $this->columns)) . ')' => 'count',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -452,7 +452,7 @@ final class ReadMapper extends DataMapperAbstract
|
||||||
$query = $this->getQuery(
|
$query = $this->getQuery(
|
||||||
null,
|
null,
|
||||||
[
|
[
|
||||||
'SUM(' . (empty($this->columns) ? '*' : \implode($this->columns)) . ')' => 'sum'
|
'SUM(' . (empty($this->columns) ? '*' : \implode(',', $this->columns)) . ')' => 'sum',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -106,9 +106,9 @@ final class GrahamScan
|
||||||
/**
|
/**
|
||||||
* Counterclockwise rotation
|
* Counterclockwise rotation
|
||||||
*
|
*
|
||||||
* @param array<x:int|float, y:int|float> $a Vector
|
* @param array{x:int|float, y:int|float} $a Vector
|
||||||
* @param array<x:int|float, y:int|float> $b Vector
|
* @param array{x:int|float, y:int|float} $b Vector
|
||||||
* @param array<x:int|float, y:int|float> $c Vector
|
* @param array{x:int|float, y:int|float} $c Vector
|
||||||
*
|
*
|
||||||
* @return int|float
|
* @return int|float
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ namespace phpOMS\Math\Optimization;
|
||||||
class Simplex
|
class Simplex
|
||||||
{
|
{
|
||||||
private int $m = 0;
|
private int $m = 0;
|
||||||
|
|
||||||
private int $n = 0;
|
private int $n = 0;
|
||||||
|
|
||||||
private array $A = [];
|
private array $A = [];
|
||||||
|
|
@ -40,7 +41,7 @@ class Simplex
|
||||||
|
|
||||||
private array $Nonbasic = [];
|
private array $Nonbasic = [];
|
||||||
|
|
||||||
private function pivot (int $x, int $y)
|
private function pivot (int $x, int $y) : void
|
||||||
{
|
{
|
||||||
for ($j = 0; $j < $this->n; ++$j) {
|
for ($j = 0; $j < $this->n; ++$j) {
|
||||||
if ($j !== $y) {
|
if ($j !== $y) {
|
||||||
|
|
|
||||||
|
|
@ -185,7 +185,7 @@ class BinarySearchTree
|
||||||
|
|
||||||
if ($comparison < 0) {
|
if ($comparison < 0) {
|
||||||
if ($current->left === null) {
|
if ($current->left === null) {
|
||||||
$BST = new BinarySearchTree();
|
$BST = new self();
|
||||||
$new = new Node($node->key, $node->data);
|
$new = new Node($node->key, $node->data);
|
||||||
$new->parent = $current;
|
$new->parent = $current;
|
||||||
$new->tree = $BST;
|
$new->tree = $BST;
|
||||||
|
|
@ -197,7 +197,7 @@ class BinarySearchTree
|
||||||
}
|
}
|
||||||
} elseif ($comparison > 0) {
|
} elseif ($comparison > 0) {
|
||||||
if ($current->right === null) {
|
if ($current->right === null) {
|
||||||
$BST = new BinarySearchTree();
|
$BST = new self();
|
||||||
$new = new Node($node->key, $node->data);
|
$new = new Node($node->key, $node->data);
|
||||||
$new->parent = $current;
|
$new->parent = $current;
|
||||||
$new->tree = $BST;
|
$new->tree = $BST;
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,9 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace phpOMS\tests\Utils\IO\Spreadsheet;
|
namespace phpOMS\tests\Utils\IO\Spreadsheet;
|
||||||
|
|
||||||
use phpOMS\tests\Autoloader;
|
|
||||||
use phpOMS\DataStorage\Database\Connection\SQLiteConnection;
|
use phpOMS\DataStorage\Database\Connection\SQLiteConnection;
|
||||||
use phpOMS\DataStorage\Database\Query\Builder;
|
use phpOMS\DataStorage\Database\Query\Builder;
|
||||||
|
use phpOMS\tests\Autoloader;
|
||||||
use phpOMS\Utils\IO\Spreadsheet\SpreadsheetDatabaseMapper;
|
use phpOMS\Utils\IO\Spreadsheet\SpreadsheetDatabaseMapper;
|
||||||
use phpOMS\Utils\StringUtils;
|
use phpOMS\Utils\StringUtils;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user