Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.3.0 - Português

Change language to:
English - Français - 日本語 -

Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function

Manual Scilab >> Interfaces com UMFPACK > res_with_prec

res_with_prec

computes the residual r = Ax-b with precision

Calling Sequence

[r,norm2_r] = res_with_prec(A, x, b)

Arguments

A

real or complex sparse matrix (m x n)

x

column vector (n x 1) or matrix (n x p)

b

column vector (m x 1) or matrix (m x p)

r

column vector (m x 1) or matrix (m x p)

norm2_r

scalar or vector (1 x p) when b is a m x p matrix

Description

This function computes the residual of a linear system r = Ax - b (together with its 2-norm) with the additionnal precision provided on "Intel like" FPU (80 bits in place of 64) if the compiler translate "long double" to use it. Else one must get the same than using A*x - b at the scilab level. In both cases using [r, nr] = res_with_prec(A,x,b) is faster than r = A*x - b (and faster than r = A*x - b; nr = norm(r)).

When p > 1, norm2_r(i) is the 2-norm of the vector r(:,i).

Examples

[A] = ReadHBSparse(SCI+"/modules/umfpack/examples/bcsstk24.rsa");
C_ptr = taucs_chfact(A);
b = rand(size(A,1),1);
x0 = taucs_chsolve(C_ptr, b);
norm(A*x0 - b)
norm(res_with_prec(A, x0, b))

See Also

Authors

Bruno Pincon <Bruno.Pincon@iecn.u-nancy.fr>

<< rafiter Interfaces com UMFPACK taucs_chdel >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Wed Jan 26 16:24:38 CET 2011