File: cs_lusol.m

package info (click to toggle)
suitesparse 1%3A7.10.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 254,920 kB
  • sloc: ansic: 1,134,743; cpp: 46,133; makefile: 4,875; fortran: 2,087; java: 1,826; sh: 996; ruby: 725; python: 495; asm: 371; sed: 166; awk: 44
file content (23 lines) | stat: -rw-r--r-- 994 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function x = cs_lusol (A,b,order,tol)                                       %#ok
%CS_LUSOL solve Ax=b using LU factorization.
%   x = cs_lusol(A,b) computes x = A\b, where A is sparse and square, and b is a
%   full vector.  The ordering cs_amd(A,2) is used.
%
%   x = cs_lusol(A,b,1) also computes x = A\b, but uses the cs_amd(A) ordering
%   with diagonal preference (tol=0.001).
%
%   x = cs_lusol(A,b,order,tol) allows both the ordering and tolerance to be
%   defined.  The ordering defaults to 1, and tol defaults to 1.
%   ordering: 0: natural, 1: amd(A+A'), 2: amd(S'*S) where S=A except with no
%   dense rows, 3: amd(A'*A).
%
%   Example:
%       Prob = ssget ('HB/arc130') ; A = Prob.A ; n = size(A,1) ;
%       b = rand (n,1) ; x = cs_lusol (A,b) ; norm (A*x-b)
%
%   See also CS_LU, CS_AMD, CS_CHOLSOL, CS_QRSOL, MLDIVIDE.

% CXSparse, Copyright (c) 2006-2022, Timothy A. Davis. All Rights Reserved.
% SPDX-License-Identifier: LGPL-2.1+

error ('cs_lusol mexFunction not found') ;