Finding the QR decomposition of A, it exists because the columns of A are linearly independent.
| > | with( LinearAlgebra ):
with( VectorCalculus ): |
Warning, the names `&x`, CrossProduct and DotProduct have been rebound
Warning, the assigned names `<,>` and `<|>` now have a global binding
Warning, these protected names have been redefined and unprotected: `*`, `+`, `.`, D, Vector, diff, int, limit, series
| > | A := Matrix( [[1,1,0,1],[-1,0,1,1],[1,1,1,1]]); |
Q is constructed from the orthnormalized columns of A using Gram Schmidt.
| > | orthonormCols := GramSchmidt( [Column( A, 1..4 )], normalized ):
Q := Matrix( orthonormCols ); |
R = Q^T * A
| > | R := Transpose( Q ) . A; |
Since A = Q * R, we should be able to regenerate the original matrix.
| > | Q . R; |
Just for demonstration purposes, here's how to accomplish the decomposition using a native maple call.
| > | (mQ,mR) := QRDecomposition(A, fullspan);
mQ . mR; |
| > |
| > |