1
function x = cs_qrsol (A,b,order) %#ok
2
%CS_QRSOL solve a sparse least-squares problem.
3
% x = cs_qrsol(A,b) solves the over-determined least squares problem to
4
% find x that minimizes norm(A*x-b), where b is a full vector and
5
% A is m-by-n with m >= n. If m < n, it solves the underdetermined system
6
% Ax=b. A 3rd input argument specifies the ordering method to use
7
% (0: natural, 3: amd(A'*A)). The default ordering is 3.
10
% Prob = UFget ('HB/well1033') ; A = Prob.A ; [m n] = size (A) ;
12
% x1 = cs_qrsol (A,b) ;
16
% For this example, cs_qrsol is about 3 times faster than A\b in MATLAB 7.3.
18
% See also CS_QR, CS_AMD, CS_LUSOL, CS_CHOLSOL, MLDIVIDE.
20
% Copyright 2006-2007, Timothy A. Davis.
21
% http://www.cise.ufl.edu/research/sparse
23
error ('cs_qrsol mexFunction not found') ;