~logan/ubuntu/trusty/suitesparse/4.2.1-3ubuntu1

« back to all changes in this revision

Viewing changes to CXSparse/MATLAB/CSparse/cs_qrsol.m

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme
  • Date: 2007-05-29 09:36:29 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070529093629-zowquo0b7slkk6nc
Tags: 3.0.0-2
* suitesparse builds properly twice in a row
* Bug fix: "suitesparse - FTBFS: Broken build depens: libgfortran1-dev",
  thanks to Bastian Blank (Closes: #426349).
* Bug fix: "suitesparse_3.0.0-1: FTBFS: build-depends on
  libgfortran1-dev", thanks to Steve Langasek (Closes: #426354).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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.
 
8
%
 
9
%   Example:
 
10
%       Prob = UFget ('HB/well1033') ; A = Prob.A ; [m n] = size (A) ;
 
11
%       b = rand (m,1) ;
 
12
%       x1 = cs_qrsol (A,b) ;
 
13
%       x2 = A\b ;
 
14
%       norm (x1-x2)
 
15
%
 
16
%   For this example, cs_qrsol is about 3 times faster than A\b in MATLAB 7.3.
 
17
%
 
18
%   See also CS_QR, CS_AMD, CS_LUSOL, CS_CHOLSOL, MLDIVIDE.
 
19
 
 
20
%   Copyright 2006-2007, Timothy A. Davis.
 
21
%   http://www.cise.ufl.edu/research/sparse
 
22
 
 
23
error ('cs_qrsol mexFunction not found') ;