Code Duplication    Length = 5-5 lines in 2 locations

src/Phpml/Math/LinearAlgebra/LUDecomposition.php 1 location

@@ 127-131 (lines=5) @@
124
            }
125
126
            if ($p != $j) {
127
                for ($k = 0; $k < $this->n; ++$k) {
128
                    $t = $this->LU[$p][$k];
129
                    $this->LU[$p][$k] = $this->LU[$j][$k];
130
                    $this->LU[$j][$k] = $t;
131
                }
132
133
                $k = $this->piv[$p];
134
                $this->piv[$p] = $this->piv[$j];

src/Phpml/Math/LinearAlgebra/EigenvalueDecomposition.php 1 location

@@ 415-419 (lines=5) @@
412
            if ($k != $i) {
413
                $this->d[$k] = $this->d[$i];
414
                $this->d[$i] = $p;
415
                for ($j = 0; $j < $this->n; ++$j) {
416
                    $p = $this->V[$j][$i];
417
                    $this->V[$j][$i] = $this->V[$j][$k];
418
                    $this->V[$j][$k] = $p;
419
                }
420
            }
421
        }
422
    }