From 99d4d80d1944a889b0bd5128c7dea2411016d8d9 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Mon, 16 Oct 2017 13:10:28 +0200 Subject: [PATCH] Remove cholesky from Matrix, is standalone --- Math/Matrix/Matrix.php | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/Math/Matrix/Matrix.php b/Math/Matrix/Matrix.php index d802dc60a..c1ef2e473 100644 --- a/Math/Matrix/Matrix.php +++ b/Math/Matrix/Matrix.php @@ -802,32 +802,4 @@ class Matrix implements \ArrayAccess, \Iterator unset($this->matrix[$row][$offset - $row * $this->n]); } - /** - * Decompose matrix using cholesky algorithm. - * - * @return Matrix - * - * @since 1.0.0 - */ - private function decompositionCholesky() : Matrix - { - $newMatrix = new Matrix($this->n, $this->n); - $newMatrixArr = $newMatrix->getMatrix(); - - for ($i = 0; $i < $this->n; $i++) { - for ($j = 0; $j < $i + 1; $j++) { - $temp = 0; - - for ($c = 0; $c < $j; $c++) { - $temp += $newMatrixArr[$i][$c] * $newMatrixArr[$j][$c]; - } - - $newMatrixArr[$i][$j] = ($i == $j) ? sqrt($this->matrix[$i][$i] - $temp) : (1 / $newMatrixArr[$j][$j] * ($this->matrix[$i][$j] - $temp)); - } - } - - $newMatrix->setMatrix($newMatrixArr); - - return $newMatrix; - } } \ No newline at end of file