@@ 138-153 (lines=16) @@ | ||
135 | * |
|
136 | * @return Matrix Lower triangular factor |
|
137 | */ |
|
138 | public function getL() |
|
139 | { |
|
140 | for ($i = 0; $i < $this->m; ++$i) { |
|
141 | for ($j = 0; $j < $this->n; ++$j) { |
|
142 | if ($i > $j) { |
|
143 | $L[$i][$j] = $this->LU[$i][$j]; |
|
144 | } elseif ($i == $j) { |
|
145 | $L[$i][$j] = 1.0; |
|
146 | } else { |
|
147 | $L[$i][$j] = 0.0; |
|
148 | } |
|
149 | } |
|
150 | } |
|
151 | ||
152 | return new Matrix($L); |
|
153 | } |
|
154 | ||
155 | // function getL() |
|
156 |
@@ 149-164 (lines=16) @@ | ||
146 | * |
|
147 | * @return Matrix upper triangular factor |
|
148 | */ |
|
149 | public function getR() |
|
150 | { |
|
151 | for ($i = 0; $i < $this->n; ++$i) { |
|
152 | for ($j = 0; $j < $this->n; ++$j) { |
|
153 | if ($i < $j) { |
|
154 | $R[$i][$j] = $this->QR[$i][$j]; |
|
155 | } elseif ($i == $j) { |
|
156 | $R[$i][$j] = $this->Rdiag[$i]; |
|
157 | } else { |
|
158 | $R[$i][$j] = 0.0; |
|
159 | } |
|
160 | } |
|
161 | } |
|
162 | ||
163 | return new Matrix($R); |
|
164 | } |
|
165 | ||
166 | // function getR() |
|
167 |