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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Figure 12 – Sparsity pattern of the Poisson matrix.The Kronecker opera<strong>to</strong>r is used, so that the computation of the matrix isvec<strong>to</strong>rized. To edit the code, we just run the following code.--> edit scibench_poissonAAt the core of the algorithm, we find the statementA = I .*. T + T .*. Iwhere T is a sparse matrix and I is the sparse n-by-n identity matrix. Hence,creating the whole matrix is done with only one statement.11.3 The Poisson SolverThe scibench_poisson function solves the 2D Poisson equation. Its callingsequence isscibench_poisson ( N , plotgraph , verbose , solver )where N is the number of cells, plotgraph is a boolean <strong>to</strong> plot the graphics,verbose is a boolean <strong>to</strong> print messages and solver is a function which solvesthe linear equation A*x=b.29

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

Saved successfully!

Ooh no, something went wrong!