Fix tabs to white spaces

This commit is contained in:
Dennis Eichhorn 2017-10-27 18:20:52 +02:00
parent 77e662bd0b
commit e4833b6e58
8 changed files with 99 additions and 99 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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);
}

View File

@ -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 */
}

View File

@ -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) {

View File

@ -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;
}

View File

@ -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));

View File

@ -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()
{