Name: ndarray-gram-schmidt-qr-complex
Owner: scijs
Description: Modified Gram-Schmidt Algorithm for QR Factorization of complex matrices
Created: 2015-05-03 14:36:02.0
Updated: 2017-04-16 02:43:46.0
Pushed: 2015-05-16 06:24:46.0
Homepage: null
Size: 136
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A module for calculating the in-place QR decomposition of a complex matrix
The algorithm is the numerically stable variant of the Gram-Schmidt QR decomposition as found on p. 58 of Trefethen and Bau's Numerical Linear Algebra. In pseudocode, the algorithm is:
i = 1 to n
i = a_i
i = 1 to n
ii = ||v_i||
i = v_i / r_ii
r j = i+1 to n
r_ij = q_i' * v_j
v_j = v_j - r_ij * q_i
For real numbers, see ndarray-gram-schmidt-qr.
The algorithm currently only calculates the in-place QR decomposition and returns true on successful completion.
qr = require('ndarray-gram-schmidt-qr-complex'),
pool = require('ndarray-scratch');
A_r = ndarray( new Float64Array([1,2,7,4,5,1,7,4,9]), [3,3] ),
A_i = ndarray( new Float64Array([9,3,2,4,4,0,4,1,1]), [3,3] ),
R_r = pool.zeros( A_r.shape, A_r.dtype );
R_i = pool.zeros( A_r.shape, A_r.dtype );
A_r, A_i, R_r, R_i );
Then the product A * R is approximately equal to the original matrix.
(c) 2015 Ricky Reusser. MIT License