Scilab function

bandwr - bandwidth reduction for a sparse matrix

Calling Sequence

[iperm,mrepi,prof,ierr] = bandwr(sp,[iopt])
[iperm,mrepi,prof,ierr] = bandwr(lp,ls,n,[iopt])

Parameters

Description

bandwr solves the problem of bandwidth reduction for a sparse matrix: the matrix is supposed to be upper triangular with a full diagonal (it is easy to complete a non symmetric matrix, and then discards the added terms).

In the first calling sequence, sp denotes a sparse matrix; the optional argument iopt is 0 or 1: 1 if reducing the profile of the matrix is more important than reducing the bandwidth and 0 if bandwidth reduction is most important.

The second calling sequence corresponds to the description of a graph: lp is a row vector, pointer array of the adjacency lists description of a graph (its size is the number of nodes of the graph + 1); ls is a row vector, node array of the adjacency lists description (its size is the number of edges of the graph i.e. the number of non-zero terms of the corresponding sparse matrix). n is the number of nodes (dimension of sp).

iperm is the permutation vector for reordering the rows and columns which reduces the bandwidth and/or profile (new numbering of the nodes of the graph); mrepi is the inverse permutation (mrepi(iperm) is the identity). prof is the array giving the profile of the sparse matrix after the bandwidth reduction if iopt is 1. If iopt is 0 this array is zero except for the first term giving the bandwidth. The simple command max(prof(2:$)-prof(1:($-1))) returns the bandwidth of the matrix. ierr is an integer indicating an error if its value is not zero.

Examples