Code Duplication    Length = 5-5 lines in 2 locations

src/Phpml/Math/LinearAlgebra/LUDecomposition.php 2 locations

@@ 273-277 (lines=5) @@
270
        $X = $this->getSubMatrix($B->toArray(), $this->piv, 0, $nx - 1);
271
        // Solve L*Y = B(piv,:)
272
        for ($k = 0; $k < $this->n; ++$k) {
273
            for ($i = $k + 1; $i < $this->n; ++$i) {
274
                for ($j = 0; $j < $nx; ++$j) {
275
                    $X[$i][$j] -= $X[$k][$j] * $this->LU[$i][$k];
276
                }
277
            }
278
        }
279
280
        // Solve U*X = Y;
@@ 286-290 (lines=5) @@
283
                $X[$k][$j] /= $this->LU[$k][$k];
284
            }
285
286
            for ($i = 0; $i < $k; ++$i) {
287
                for ($j = 0; $j < $nx; ++$j) {
288
                    $X[$i][$j] -= $X[$k][$j] * $this->LU[$i][$k];
289
                }
290
            }
291
        }
292
293
        return $X;