@@ 262-266 (lines=5) @@ | ||
259 | $X = $this->getSubMatrix($B->toArray(), $this->piv, 0, $nx - 1); |
|
260 | // Solve L*Y = B(piv,:) |
|
261 | for ($k = 0; $k < $this->n; ++$k) { |
|
262 | for ($i = $k + 1; $i < $this->n; ++$i) { |
|
263 | for ($j = 0; $j < $nx; ++$j) { |
|
264 | $X[$i][$j] -= $X[$k][$j] * $this->LU[$i][$k]; |
|
265 | } |
|
266 | } |
|
267 | } |
|
268 | ||
269 | // Solve U*X = Y; |
|
@@ 275-279 (lines=5) @@ | ||
272 | $X[$k][$j] /= $this->LU[$k][$k]; |
|
273 | } |
|
274 | ||
275 | for ($i = 0; $i < $k; ++$i) { |
|
276 | for ($j = 0; $j < $nx; ++$j) { |
|
277 | $X[$i][$j] -= $X[$k][$j] * $this->LU[$i][$k]; |
|
278 | } |
|
279 | } |
|
280 | } |
|
281 | ||
282 | return $X; |