Function File: [q, r, z] = cod (a)
Function File: [q, r, z, p] = cod (a)
Function File: […] = cod (a, '0')

Computes the complete orthogonal decomposition (COD) of the matrix a:

  a = q*r*z'

Let a be an M-by-N matrix, and let K = min(M, N). Then q is M-by-M orthogonal, z is N-by-N orthogonal, and r is M-by-N such that r(:,1:K) is upper trapezoidal and r(:,K+1:N) is zero. The additional p output argument specifies that pivoting should be used in the first step (QR decomposition). In this case,

  a*p = q*r*z'

If a second argument of ’0’ is given, an economy-sized factorization is returned so that r is K-by-K.

NOTE: This is currently implemented by double QR factorization plus some tricky manipulations, and is not as efficient as using xRZTZF from LAPACK.

See also: qr.

Package: linear-algebra