From f1ab2f022fdc780aca0944d90e9a0e844a0820d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Mon, 27 May 2024 13:12:17 +0200 Subject: =?UTF-8?q?2024-02-19:=20popravljen=20(prej=C5=A1nji=20commit=20je?= =?UTF-8?q?=20napa=C4=8Den)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PHPExcel/Shared/JAMA/CholeskyDecomposition.php | 149 --------------------- 1 file changed, 149 deletions(-) delete mode 100644 admin/survey/excel/PHPExcel/Shared/JAMA/CholeskyDecomposition.php (limited to 'admin/survey/excel/PHPExcel/Shared/JAMA/CholeskyDecomposition.php') diff --git a/admin/survey/excel/PHPExcel/Shared/JAMA/CholeskyDecomposition.php b/admin/survey/excel/PHPExcel/Shared/JAMA/CholeskyDecomposition.php deleted file mode 100644 index 2d1fdfb..0000000 --- a/admin/survey/excel/PHPExcel/Shared/JAMA/CholeskyDecomposition.php +++ /dev/null @@ -1,149 +0,0 @@ -L = $A->getArray(); - $this->m = $A->getRowDimension(); - - for($i = 0; $i < $this->m; ++$i) { - for($j = $i; $j < $this->m; ++$j) { - for($sum = $this->L[$i][$j], $k = $i - 1; $k >= 0; --$k) { - $sum -= $this->L[$i][$k] * $this->L[$j][$k]; - } - if ($i == $j) { - if ($sum >= 0) { - $this->L[$i][$i] = sqrt($sum); - } else { - $this->isspd = false; - } - } else { - if ($this->L[$i][$i] != 0) { - $this->L[$j][$i] = $sum / $this->L[$i][$i]; - } - } - } - - for ($k = $i+1; $k < $this->m; ++$k) { - $this->L[$i][$k] = 0.0; - } - } - } else { - throw new Exception(JAMAError(ArgumentTypeException)); - } - } // function __construct() - - - /** - * Is the matrix symmetric and positive definite? - * - * @return boolean - */ - public function isSPD() { - return $this->isspd; - } // function isSPD() - - - /** - * getL - * - * Return triangular factor. - * @return Matrix Lower triangular matrix - */ - public function getL() { - return new Matrix($this->L); - } // function getL() - - - /** - * Solve A*X = B - * - * @param $B Row-equal matrix - * @return Matrix L * L' * X = B - */ - public function solve($B = null) { - if ($B instanceof Matrix) { - if ($B->getRowDimension() == $this->m) { - if ($this->isspd) { - $X = $B->getArrayCopy(); - $nx = $B->getColumnDimension(); - - for ($k = 0; $k < $this->m; ++$k) { - for ($i = $k + 1; $i < $this->m; ++$i) { - for ($j = 0; $j < $nx; ++$j) { - $X[$i][$j] -= $X[$k][$j] * $this->L[$i][$k]; - } - } - for ($j = 0; $j < $nx; ++$j) { - $X[$k][$j] /= $this->L[$k][$k]; - } - } - - for ($k = $this->m - 1; $k >= 0; --$k) { - for ($j = 0; $j < $nx; ++$j) { - $X[$k][$j] /= $this->L[$k][$k]; - } - for ($i = 0; $i < $k; ++$i) { - for ($j = 0; $j < $nx; ++$j) { - $X[$i][$j] -= $X[$k][$j] * $this->L[$k][$i]; - } - } - } - - return new Matrix($X, $this->m, $nx); - } else { - throw new Exception(JAMAError(MatrixSPDException)); - } - } else { - throw new Exception(JAMAError(MatrixDimensionException)); - } - } else { - throw new Exception(JAMAError(ArgumentTypeException)); - } - } // function solve() - -} // class CholeskyDecomposition -- cgit v1.2.3