59 for ($sum = $this->
L[
$i][$j], $k =
$i - 1; $k >= 0; --$k) {
60 $sum -= $this->
L[
$i][$k] * $this->
L[$j][$k];
64 $this->
L[
$i][
$i] = sqrt($sum);
69 if ($this->
L[
$i][
$i] != 0) {
70 $this->
L[$j][
$i] = $sum / $this->
L[
$i][
$i];
76 $this->
L[
$i][$k] = 0.0;
119 for ($j = 0; $j < $nx; ++$j) {
120 $X[
$i][$j] -=
$X[$k][$j] * $this->
L[
$i][$k];
123 for ($j = 0; $j < $nx; ++$j) {
124 $X[$k][$j] /= $this->
L[$k][$k];
128 for ($k = $this->m - 1; $k >= 0; --$k) {
129 for ($j = 0; $j < $nx; ++$j) {
130 $X[$k][$j] /= $this->
L[$k][$k];
132 for (
$i = 0;
$i < $k; ++
$i) {
133 for ($j = 0; $j < $nx; ++$j) {
134 $X[
$i][$j] -=
$X[$k][$j] * $this->
L[$k][
$i];
139 return new Matrix(
$X, $this->m, $nx);
solve(Matrix $B)
Solve A*X = B.
__construct(Matrix $A)
CholeskyDecomposition.
getRowDimension()
getRowDimension.
Cholesky decomposition class.
const MATRIX_SPD_EXCEPTION
getColumnDimension()
getColumnDimension.
const MATRIX_DIMENSION_EXCEPTION
isSPD()
Is the matrix symmetric and positive definite?
Class for the creating "special" Matrices.