File: spqr_solve.m

package info (click to toggle)
suitesparse 1%3A7.11.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 258,172 kB
  • sloc: ansic: 1,153,566; cpp: 48,145; makefile: 4,997; fortran: 2,087; java: 1,826; sh: 1,113; ruby: 725; python: 676; asm: 371; sed: 166; awk: 44
file content (29 lines) | stat: -rw-r--r-- 1,320 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
function [X,info] = spqr_solve (A,B,opts)                                   %#ok
%SPQR_SOLVE solves a linear system or least squares problem via QR factorization.
% A is a sparse m-by-n matrix A and B is a sparse or full m-by-k matrix.
% If m == n, x = spqr_solve(A,B) solves A*X=B.  If m < n, a basic solution is
% found for the underdetermined system A*X=B.  If m > n, the least squares
% solution is found.  An optional third input argument specifies non-default
% options (see "help spqr" for details).  Only opts.tol, opts.ordering, and
% opts.solution are used; the others are implicitly set to opts.econ = 0,
% opts.Q = 'Householder', and opts.permutation = 'vector'.
%
% opts.solution:  'basic' (default) or 'min2norm'.  To obtain a minimum 2-norm
% solution to an undetermined system (m < n), use 'min2norm'.  For m >= n,
% these two options find the same solution.
%
% An optional second output provides statistics on the solution.
%
% Example: 
%   x = spqr_solve (A,B) 
%   [x,info] = spqr_solve (A,B) 
%   x = spqr_solve (A,B,opts) 
%   x = spqr_solve (A,B, struct ('solution','min2norm')) ;
%
% See also SPQR, SPQR_QMULT, QR, MLDIVIDE.

% SPQR, Copyright (c) 2008-2022, Timothy A Davis. All Rights Reserved.
% SPDX-License-Identifier: GPL-2.0+

type spqr_solve
error ('spqr_solve mexFunction not found') ;