0% found this document useful (0 votes)
544 views1 page

Banded Matrix Design

This document describes a banded matrix data structure (Banded_Matrix ADT) that stores only the non-zero elements of a sparse matrix. A banded matrix has non-zero entries within a band comprising the main diagonal and some number of diagonals above and below it. The Banded_Matrix stores these elements contiguously in a single array in row-major order. It provides methods to construct, access, and modify banded matrices through this compact storage format.

Uploaded by

Naoya Makino
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
544 views1 page

Banded Matrix Design

This document describes a banded matrix data structure (Banded_Matrix ADT) that stores only the non-zero elements of a sparse matrix. A banded matrix has non-zero entries within a band comprising the main diagonal and some number of diagonals above and below it. The Banded_Matrix stores these elements contiguously in a single array in row-major order. It provides methods to construct, access, and modify banded matrices through this compact storage format.

Uploaded by

Naoya Makino
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

CPSC2190 Assignment 05 the upper codiagonals are stored in the rows of an

Due date: November 13, 2008 array of size m × N.


Naoya Makino: 100106040 For example, consider the 5 × 5 matrix A with 1
Purpose: Design an ADT banded_matrix that lower and 2 upper codiagonals:
operates on (square) banded matrices (to store
only the non-zero entries).
Definition: A banded matrix is a sparse matrix
where non-zero entries appear in a diagonal band
comprising the main diagonal and 0 or more
diagonals on either side.
Codiagonals: other than the main diagonal
Banded_Matrix ADT In band storage format, the data would be arranged as
Method Description
Constructors
Banded_Matrix(size_type Default
size) constructor with
zero item
Banded_Matrix(size_type Constructor with
size, data values[]) an one
dimensional
array, values
Banded_Matrix(const Copy constructor
Banded_Matrix &that) This data would then be stored contiguously, row-
~Banded_Matrix() Destructor major order, in an array of length 20.
Accessor
size_type size() const Return the Reference:
number of rows  Boost C++ Libraries - Banded Matrix:
or columns
size_type diagonals() const Return the http://www.boost.org/doc/libs/1_35_0/libs/n
number of umeric/ublas/doc/banded.htm, November 06,
diagonals
Bool is_banded() Check if this 2008.
matrix is banded Matrix Storage Modes:

data get_item(size_type i, get element from
size_type j) values http://www.vni.com/products/imsl/document
Mutators
ation/CNL06/math/NetHelp/default.htm?turl
Void clear() Erase the matrix
Void erase(size_type row, Erase the value of =matrixstoragemodes.htm, November 12,
size_type col) the given row and
2008.
col
Void add_diagonal(data[] Add the diagonal
items) into the matrix
Private
data values[] Elements in the
matrix

Band Storage Format:


band_width = num_lower_codiagonals +
num_upper_codiagonals + 1
m = [(i - j + nuca + 1) * n + j]
// where nuca := num_upper_codiagonals, n:=
column size
In the M × N matrix lower codiagonals and

You might also like