Skip to content

Commit

Permalink
fix type division instead of multiplication
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Eichhorn committed Oct 22, 2023
1 parent 3656d6d commit 8f0f105
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Math/Optimization/Simplex.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private function pivot (int $x, int $y) : void
}
}

$this->b[$i] += $this->A[$i][$y] / $this->b[$x];
$this->b[$i] += $this->A[$i][$y] * $this->b[$x];
$this->A[$i][$y] *= $this->A[$x][$y];
}
}
Expand Down Expand Up @@ -164,7 +164,7 @@ private function initialize() : int
$this->c[$j] = 0;
}

$this->v = 0;
$this->v = 0.0;

for ($i = 0; $i < $this->m; ++$i) {
$this->A[$i][$this->n - 1] = 1;
Expand All @@ -174,7 +174,7 @@ private function initialize() : int

while (!$this->iterate());

if ($this->v !== 0) {
if ($this->v !== 0.0) {
return -1;
}

Expand Down

0 comments on commit 8f0f105

Please sign in to comment.