@@ 162-175 (lines=14) @@ | ||
159 | * |
|
160 | * @return Matrix Upper triangular factor |
|
161 | */ |
|
162 | public function getU() |
|
163 | { |
|
164 | for ($i = 0; $i < $this->n; ++$i) { |
|
165 | for ($j = 0; $j < $this->n; ++$j) { |
|
166 | if ($i <= $j) { |
|
167 | $U[$i][$j] = $this->LU[$i][$j]; |
|
168 | } else { |
|
169 | $U[$i][$j] = 0.0; |
|
170 | } |
|
171 | } |
|
172 | } |
|
173 | ||
174 | return new Matrix($U); |
|
175 | } |
|
176 | ||
177 | // function getU() |
|
178 |
@@ 127-140 (lines=14) @@ | ||
124 | * |
|
125 | * @return Matrix Lower trapezoidal matrix whose columns define the reflections |
|
126 | */ |
|
127 | public function getH() |
|
128 | { |
|
129 | for ($i = 0; $i < $this->m; ++$i) { |
|
130 | for ($j = 0; $j < $this->n; ++$j) { |
|
131 | if ($i >= $j) { |
|
132 | $H[$i][$j] = $this->QR[$i][$j]; |
|
133 | } else { |
|
134 | $H[$i][$j] = 0.0; |
|
135 | } |
|
136 | } |
|
137 | } |
|
138 | ||
139 | return new Matrix($H); |
|
140 | } |
|
141 | ||
142 | // function getH() |
|
143 |