# Linear Algebra: Theory and Applications # Ward Cheney & David Kincaid # JBPub.com (c) 2008 # File: exp8211.map # Example 8.2.11 with(LinearAlgebra): A := Matrix([[4,7,-3],[2,-4,6],[-3,2,5],[1,-2,4]]); b := Vector([1.,5.,7.,-3.]); (Q,R) := QRDecomposition(A); xt := LinearSolve(R,Transpose(Q).b); x := evalf(LeastSquares(A,b)); r := A.x-b; e := Transpose(A).r;