Unpacking matrix H (the result of matrix A reduction to upper Hessenberg form) Input parameters: A - output of RMatrixHessenberg subroutine. N - size of matrix A. Output parameters: H - matrix H. Array whose indexes range within [0..N-1, 0..N-1]. -- ALGLIB -- 2005-2010 Bochkanov Sergey *************************************************************************/
| 2214 | Bochkanov Sergey |
| 2215 | *************************************************************************/ |
| 2216 | void rmatrixhessenbergunpackh(const ap::real_2d_array& a, |
| 2217 | int n, |
| 2218 | ap::real_2d_array& h) |
| 2219 | { |
| 2220 | int i; |
| 2221 | int j; |
| 2222 | ap::real_1d_array v; |
| 2223 | ap::real_1d_array work; |
| 2224 | |
| 2225 | if( n==0 ) |
| 2226 | { |
| 2227 | return; |
| 2228 | } |
| 2229 | h.setbounds(0, n-1, 0, n-1); |
| 2230 | for(i = 0; i <= n-1; i++) |
| 2231 | { |
| 2232 | for(j = 0; j <= i-2; j++) |
| 2233 | { |
| 2234 | h(i,j) = 0; |
| 2235 | } |
| 2236 | j = ap::maxint(0, i-1); |
| 2237 | ap::vmove(&h(i, j), 1, &a(i, j), 1, ap::vlen(j,n-1)); |
| 2238 | } |
| 2239 | } |
| 2240 | |
| 2241 | |
| 2242 | /************************************************************************* |