1function x = cs_usolve (U,b) %#ok 2%CS_USOLVE solve a sparse upper triangular system U*x=b. 3% x = cs_usolve(U,b) computes x = U\b, U must be lower triangular with a 4% zero-free diagonal. b must be a column vector. x is full if b is full. 5% If b is sparse, x is sparse but nonzero pattern of x is NOT sorted (it is 6% returned in topological order). 7% 8% Example: 9% Prob = ssget ('HB/arc130') ; A = Prob.A ; n = size (A,1) ; 10% b = rand (n,1); 11% [L U p q] = cs_lu (A) ; 12% x = cs_usolve (U, cs_lsolve (L, b(p))) ; % x = U \ (L \ b(p)) ; 13% x (q) = x ; 14% norm (A*x-b) 15% 16% See also CS_LSOLVE, CS_LTSOLVE, CS_UTSOLVE, MLDIVIDE. 17 18% Copyright 2006-2012, Timothy A. Davis, http://www.suitesparse.com 19 20error ('cs_usolve mexFunction not found') ; 21