diff --git a/Math/Matrix/LUDecomposition.php b/Math/Matrix/LUDecomposition.php index 9dd99fe5f..920f5c7ab 100644 --- a/Math/Matrix/LUDecomposition.php +++ b/Math/Matrix/LUDecomposition.php @@ -87,15 +87,15 @@ class LUDecomposition $L = [[]]; for ($i = 0; $i < $this->m; ++$i) { - for ($j = 0; $j < $this->n; ++$j) { - if ($i > $j) { - $L[$i][$j] = $this->LU[$i][$j]; - } elseif ($i == $j) { - $L[$i][$j] = 1.0; - } else { - $L[$i][$j] = 0.0; - } - } + for ($j = 0; $j < $this->n; ++$j) { + if ($i > $j) { + $L[$i][$j] = $this->LU[$i][$j]; + } elseif ($i == $j) { + $L[$i][$j] = 1.0; + } else { + $L[$i][$j] = 0.0; + } + } } $matrix = new Matrix(); @@ -109,14 +109,14 @@ class LUDecomposition $U = [[]]; for ($i = 0; $i < $this->n; ++$i) { - for ($j = 0; $j < $this->n; ++$j) { - if ($i <= $j) { - $U[$i][$j] = $this->LU[$i][$j]; - } else { - $U[$i][$j] = 0.0; - } - } - } + for ($j = 0; $j < $this->n; ++$j) { + if ($i <= $j) { + $U[$i][$j] = $this->LU[$i][$j]; + } else { + $U[$i][$j] = 0.0; + } + } + } $matrix = new Matrix(); $matrix->setMatrix($U); @@ -132,9 +132,9 @@ class LUDecomposition public function isNonsingular() : bool { for ($j = 0; $j < $this->n; ++$j) { - if ($this->LU[$j][$j] == 0) { - return false; - } + if ($this->LU[$j][$j] == 0) { + return false; + } } return true; diff --git a/Math/Matrix/QRDecomposition.php b/Math/Matrix/QRDecomposition.php index 5e38f25c1..068199f55 100644 --- a/Math/Matrix/QRDecomposition.php +++ b/Math/Matrix/QRDecomposition.php @@ -27,56 +27,56 @@ class QRDecomposition public function __construct(Matrix $M) { // Initialize. - $this->QR = $M->toArray(); - $this->m = $M->getRowDimension(); + $this->QR = $M->toArray(); + $this->m = $M->getRowDimension(); $this->n = $M->getColumnDimension(); - // Main loop. - for ($k = 0; $k < $this->n; ++$k) { - // Compute 2-norm of k-th column without under/overflow. - $nrm = 0.0; - for ($i = $k; $i < $this->m; ++$i) { - $nrm = hypo($nrm, $this->QR[$i][$k]); + // Main loop. + for ($k = 0; $k < $this->n; ++$k) { + // Compute 2-norm of k-th column without under/overflow. + $nrm = 0.0; + for ($i = $k; $i < $this->m; ++$i) { + $nrm = hypo($nrm, $this->QR[$i][$k]); } - if ($nrm != 0.0) { - // Form k-th Householder vector. - if ($this->QR[$k][$k] < 0) { - $nrm = -$nrm; + if ($nrm != 0.0) { + // Form k-th Householder vector. + if ($this->QR[$k][$k] < 0) { + $nrm = -$nrm; } - for ($i = $k; $i < $this->m; ++$i) { - $this->QR[$i][$k] /= $nrm; + for ($i = $k; $i < $this->m; ++$i) { + $this->QR[$i][$k] /= $nrm; } - $this->QR[$k][$k] += 1.0; - // Apply transformation to remaining columns. - for ($j = $k+1; $j < $this->n; ++$j) { + $this->QR[$k][$k] += 1.0; + // Apply transformation to remaining columns. + for ($j = $k+1; $j < $this->n; ++$j) { $s = 0.0; - for ($i = $k; $i < $this->m; ++$i) { - $s += $this->QR[$i][$k] * $this->QR[$i][$j]; + for ($i = $k; $i < $this->m; ++$i) { + $s += $this->QR[$i][$k] * $this->QR[$i][$j]; } - $s = -$s/$this->QR[$k][$k]; - for ($i = $k; $i < $this->m; ++$i) { - $this->QR[$i][$j] += $s * $this->QR[$i][$k]; - } - } - } + $s = -$s/$this->QR[$k][$k]; + for ($i = $k; $i < $this->m; ++$i) { + $this->QR[$i][$j] += $s * $this->QR[$i][$k]; + } + } + } $this->Rdiag[$k] = -$nrm; - } + } } public function isFullRank() : bool { for ($j = 0; $j < $this->n; ++$j) { - if ($this->Rdiag[$j] == 0) { - return false; - } + if ($this->Rdiag[$j] == 0) { + return false; + } } - return true; + return true; } public function getH() @@ -84,13 +84,13 @@ class QRDecomposition $H = [[]]; for ($i = 0; $i < $this->m; ++$i) { - for ($j = 0; $j < $this->n; ++$j) { - if ($i >= $j) { - $H[$i][$j] = $this->QR[$i][$j]; - } else { - $H[$i][$j] = 0.0; - } - } + for ($j = 0; $j < $this->n; ++$j) { + if ($i >= $j) { + $H[$i][$j] = $this->QR[$i][$j]; + } else { + $H[$i][$j] = 0.0; + } + } } $matrix = new Matrix(); @@ -104,15 +104,15 @@ class QRDecomposition $R = [[]]; for ($i = 0; $i < $this->n; ++$i) { - for ($j = 0; $j < $this->n; ++$j) { - if ($i < $j) { - $R[$i][$j] = $this->QR[$i][$j]; - } elseif ($i == $j) { - $R[$i][$j] = $this->Rdiag[$i]; - } else { - $R[$i][$j] = 0.0; - } - } + for ($j = 0; $j < $this->n; ++$j) { + if ($i < $j) { + $R[$i][$j] = $this->QR[$i][$j]; + } elseif ($i == $j) { + $R[$i][$j] = $this->Rdiag[$i]; + } else { + $R[$i][$j] = 0.0; + } + } } $matrix = new Matrix(); @@ -126,24 +126,24 @@ class QRDecomposition $Q = [[]]; for ($k = $this->n-1; $k >= 0; --$k) { - for ($i = 0; $i < $this->m; ++$i) { - $Q[$i][$k] = 0.0; + for ($i = 0; $i < $this->m; ++$i) { + $Q[$i][$k] = 0.0; } - $Q[$k][$k] = 1.0; - for ($j = $k; $j < $this->n; ++$j) { - if ($this->QR[$k][$k] != 0) { - $s = 0.0; - for ($i = $k; $i < $this->m; ++$i) { - $s += $this->QR[$i][$k] * $Q[$i][$j]; - } - $s = -$s/$this->QR[$k][$k]; - for ($i = $k; $i < $this->m; ++$i) { - $Q[$i][$j] += $s * $this->QR[$i][$k]; - } - } - } - } + $Q[$k][$k] = 1.0; + for ($j = $k; $j < $this->n; ++$j) { + if ($this->QR[$k][$k] != 0) { + $s = 0.0; + for ($i = $k; $i < $this->m; ++$i) { + $s += $this->QR[$i][$k] * $Q[$i][$j]; + } + $s = -$s/$this->QR[$k][$k]; + for ($i = $k; $i < $this->m; ++$i) { + $Q[$i][$j] += $s * $this->QR[$i][$k]; + } + } + } + } $matrix = new Matrix(); $matrix->setArray($Q); diff --git a/Math/Optimization/GeneticAlgorithmInterface.php b/Math/Optimization/GeneticAlgorithmInterface.php index da552a73e..904120aed 100644 --- a/Math/Optimization/GeneticAlgorithmInterface.php +++ b/Math/Optimization/GeneticAlgorithmInterface.php @@ -26,7 +26,7 @@ namespace phpOMS\Math\Optimization; */ interface GeneticAlgorithmInterface { - public function mutate($a); + public function mutate($a); - public function unfitness($a, $b); + public function unfitness($a, $b); } diff --git a/Message/Http/RequestMethod.php b/Message/Http/RequestMethod.php index e7441f3bb..f7d5f6d61 100644 --- a/Message/Http/RequestMethod.php +++ b/Message/Http/RequestMethod.php @@ -28,10 +28,10 @@ use phpOMS\Stdlib\Base\Enum; */ abstract class RequestMethod extends Enum { - /* public */ const GET = 'GET'; /* GET */ - /* public */ const POST = 'POST'; /* POST */ - /* public */ const PUT = 'PUT'; /* PUT */ - /* public */ const DELETE = 'DELETE'; /* DELETE */ - /* public */ const HEAD = 'HEAD'; /* HEAD */ - /* public */ const TRACE = 'TRACE'; /* TRACE */ + /* public */ const GET = 'GET'; /* GET */ + /* public */ const POST = 'POST'; /* POST */ + /* public */ const PUT = 'PUT'; /* PUT */ + /* public */ const DELETE = 'DELETE'; /* DELETE */ + /* public */ const HEAD = 'HEAD'; /* HEAD */ + /* public */ const TRACE = 'TRACE'; /* TRACE */ } diff --git a/Stdlib/Graph/Tree.php b/Stdlib/Graph/Tree.php index 2b271debc..7e8e8cb59 100644 --- a/Stdlib/Graph/Tree.php +++ b/Stdlib/Graph/Tree.php @@ -227,7 +227,7 @@ class Tree extends Graph $this->preOrder($neighbor, $callback); } } - + /** * Perform action on tree in post-order. * @@ -240,7 +240,7 @@ class Tree extends Graph if (count($this->nodes) === 0) { return; } - + $neighbors = $this->getNeighbors($node); foreach ($neighbors as $neighbor) { diff --git a/System/File/ContentPutMode.php b/System/File/ContentPutMode.php index c7c88b1a1..89f12ffbc 100644 --- a/System/File/ContentPutMode.php +++ b/System/File/ContentPutMode.php @@ -30,8 +30,8 @@ use phpOMS\Stdlib\Base\Enum; */ abstract class ContentPutMode extends Enum { - /* public */ const APPEND = 1; - /* public */ const PREPEND = 2; - /* public */ const REPLACE = 4; - /* public */ const CREATE = 8; + /* public */ const APPEND = 1; + /* public */ const PREPEND = 2; + /* public */ const REPLACE = 4; + /* public */ const CREATE = 8; } \ No newline at end of file diff --git a/Utils/Converter/Currency.php b/Utils/Converter/Currency.php index 9fd65d0f3..4ff799f05 100644 --- a/Utils/Converter/Currency.php +++ b/Utils/Converter/Currency.php @@ -99,7 +99,7 @@ class Currency { if (!isset(self::$ecbCurrencies)) { $request = new Request(new Http('http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml')); - $request->setMethod(RequestMethod::GET); + $request->setMethod(RequestMethod::GET); $xml = new \SimpleXMLElement(Rest::request($request)); diff --git a/Utils/EDI/Edifact/INVOIC.php b/Utils/EDI/Edifact/INVOIC.php index 07e1790c3..5100daae9 100644 --- a/Utils/EDI/Edifact/INVOIC.php +++ b/Utils/EDI/Edifact/INVOIC.php @@ -29,9 +29,9 @@ use phpOMS\Utils\EDI\Edifact\Components\BGM; */ class INVOIC { - private $unh = null; + private $unh = null; - private $bgm = null; + private $bgm = null; public function __construct() {