11.07.2015 Views

Introduction to Sparse Matrices In Scilab - Projects

Introduction to Sparse Matrices In Scilab - Projects

Introduction to Sparse Matrices In Scilab - Projects

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

taucs chdeltaucs chfacttaucs chgettaucs chinfotaucs chsolvetaucs licenseutility function used with taucs chfactcholesky fac<strong>to</strong>risation of a sparse s.p.d. matrixretrieve the Cholesky fac<strong>to</strong>rization at the scilab levelget information on Cholesky fac<strong>to</strong>rssolve a linear sparse system given the Cholesky fac<strong>to</strong>rsdisplay the taucs licenseFigure 7 – Functions from the TAUCS module.of equations, that is, they solve the equation Ax = b, where A is a sparsesquares matrix and b is a sparse vec<strong>to</strong>r.The TAUCS package is available in the UMFPACK module. The functionsprovided in the TAUCS package are presented in the figure 7.<strong>In</strong> the following example, we fac<strong>to</strong>r a sparse matrix and solve the associatedlinear system of equations. Notice that the matrix A is symmetric positivedefinite.Afull = [2 -1 0 0 0;-1 2 -1 0 0;0 -1 2 -1 0;0 0 -1 2 -1;0 0 0 -1 2];A = sparse ( Afull );b = [0 ; 0; 0; 0; 6];h = taucs_chfact (A);x = taucs_chsolve (h,b)taucs_chdel (h);<strong>In</strong> the previous script, the variable h is a matrix handle, which containsinformations related <strong>to</strong> the sparse matrix. This is why it is necessary <strong>to</strong>explicitely delete the matrix with the taucs_chdel function. <strong>In</strong>deed, if wedo not delete the matrix handle, there is a loss of memory.8 The API<strong>Scilab</strong> provides an API <strong>to</strong> manage sparse matrices. The figure 8 presentsthe functions <strong>to</strong> read or write sparse matrices in gateways. The figure 9presents the functions <strong>to</strong> read or write sparse matrices in lists.19

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!