Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 2x 2x 2x 2x 2x | /** * @license Apache-2.0 * * Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* eslint-disable max-len, max-params */ 'use strict'; // MODULES // var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' ); var format = require( '@stdlib/string/format' ); var base = require( './base.js' ); // MAIN // /** * Performs a single, small shift multiline QR sweep. * * @param {string} order - storage layout * @param {boolean} wantT - boolean value indicating whether the quasi triangular Schur factor is being computed * @param {boolean} wantZ - boolean value indicating whether the orthogonal Schur factor is being computed * @param {integer} kacc22 - integer value ranging from 0 to 2 (inclusive), specifies the computation mode for far-from-diagonal updates * @param {integer} N - number of rows/columns in `H` * @param {integer} KTOP - first row and column of the submatrix of `H` where the QR sweep will be applied * @param {integer} KBOT - last row and column of the submatrix of `H` where the QR sweep will be applied * @param {integer} nshifts - number of simultaneous shifts, must be even and positive * @param {Float64Array} SR - real parts of the shifts of origin that define the QR sweep * @param {Float64Array} SI - imaginary parts of the shifts of origin that define the QR sweep * @param {Float64Array} H - input upper hessenberg matrix * @param {PositiveInteger} LDH - stride of the first dimension of `H` (a.k.a., leading dimension of the matrix `H`) * @param {integer} iloZ - starting row from where the transformation must be applied if `wantZ` is true * @param {integer} ihiZ - ending row from where the transformation must be applied if `wantZ` is true * @param {Float64Array} Z - the QR sweep orthogonal similarity transformation is accumulated into `Z` between the rows and columns `iloZ` and `ihiZ` if `wantZ` is true, otherwise `Z` is not referenced * @param {PositiveInteger} LDZ - stride of the first dimension of `Z` (a.k.a., leading dimension of the matrix `Z`) * @param {Float64Array} V - householder vectors are stored column-wise, used in forming bulges for the multi shift QR algorithm * @param {PositiveInteger} LDV - stride of the first dimension of `V` (a.k.a., leading dimension of the matrix `V`) * @param {Float64Array} U - used to hold the product of householder reflector that represent accumulated orthogonal transformations from the bulge-chasing process * @param {PositiveInteger} LDU - stride of the first dimension of `U` (a.k.a., leading dimension of the matrix `U`) * @param {integer} NH - number of columns in `WH` available for workspace * @param {Float64Array} WH - workspace array * @param {PositiveInteger} LDWH - stride of the first dimension of `WH` (a.k.a., leading dimension of the matrix `WH`) * @param {integer} NV - number of rows in `WV` available for workspace * @param {Float64Array} WV - workspace array * @param {PositiveInteger} LDWV - stride of the first dimension of `WV` (a.k.a., leading dimension of the matrix `WV`) * @throws {TypeError} first argument must be a valid order * @throws {RangeError} fourth argument must be greater than or equal to max(1,N) * @returns {void} permuted matrix `A` * * @example * var Float64Array = require( '@stdlib/array/float64' ); * * var H = new Float64Array( [ 1.0, 1.0, 0.0, 0.0, 0.0, 2.0, 1.5, 0.0, 0.0, 0.0, 3, 2.0, 0.0, 0.0, 0.0, 4.0 ] ); * var Z = new Float64Array( [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] ); * var V = new Float64Array( 6 ); * var U = new Float64Array( 10 ); * var WH = new Float64Array( 16 ); * var WV = new Float64Array( 16 ); * var SR = new Float64Array( [ 1.1, 2.2 ] ); * var SI = new Float64Array( [ 0.0, 0.0 ] ); * * dlaqr5( 'row-major', true, true, 0, 4, 1, 4, 2, SR, SI, H, 4, 1, 4, Z, 4, V, 2, U, 2, 4, WH, 4, 4, WV, 4 ); * // H => <Float64Array>[ 1.0, 1.0, 0.0, 0.0, 0.0, 2.0, 1.5, 0.0, 0.0, 0.0, 3, 2.0, 0.0, 0.0, 0.0, 4.0 ] * // Z => <Float64Array>[ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] */ function dlaqr5( order, wantT, wantZ, kacc22, N, KTOP, KBOT, nshifts, SR, SI, H, LDH, iloZ, ihiZ, Z, LDZ, V, LDV, U, LDU, NH, WH, LDWH, NV, WV, LDWV ) { var swh1; var swh2; var swv1; var swv2; var sh1; var sh2; var sz1; var sz2; var sv1; var sv2; var su1; var su2; if ( !isLayout( order ) ) { throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); } if ( isRowMajor( order ) ) { sh1 = LDH; sh2 = 1; sz1 = LDZ; sz2 = 1; sv1 = LDV; sv2 = 1; su1 = LDU; su2 = 1; swh1 = LDWH; swh2 = 1; swv1 = LDWV; swv2 = 1; } else { // order === 'col-major' sh1 = 1; sh2 = LDH; sz1 = 1; sz2 = LDZ; sv1 = 1; sv2 = LDV; su1 = 1; su2 = LDU; swh1 = 1; swh2 = LDWH; swv1 = 1; swv2 = LDWV; } base( wantT, wantZ, kacc22, N, KTOP, KBOT, nshifts, SR, 1, 0, SI, 1, 0, H, sh1, sh2, 0, iloZ, ihiZ, Z, sz1, sz2, 0, V, sv1, sv2, 0, U, su1, su2, 0, NH, WH, swh1, swh2, 0, NV, WV, swv1, swv2, 0 ); } // EXPORTS // module.exports = dlaqr5; |