CompressedColumnMatrix - Real


The CompressedColumnMatrix is a sparse column-major matrix of double values. The matrix elements are stored in four internal arrays, one holds the element's value, one holds the element's row index and the other two identify the elements for a column. Using two arrays to identify the elements in a column instead of one allows the matrix to hold extra elements for a column to accomodate fill-in. This matrix is efficient for numerical computing, especially column-wise computations.

Here is an example of a sparse matrix with four rows and four columns:
 
Col-0 Col-1 Col-2 Col-3
Row-0 1.3 . 4.5 .
Row-1 . 2.1 . .
Row-2 . . . 6.2
Row-3 7.3 8.5 . .

This is how the 4x4 matrix could be stored in a CompressedColumnMatrix with a column capacity of five:
 
Column-Begin
 Index   0   1   2   3   4 
 Value  0 3 5 7 .
Column-Size
 Index   0   1   2   3   4 
 Value  2 2 1 1 .
Values
 Index    0    1    2    3    4    5    6    7    8 
 Value  1.3 7.3 .  2.1 8.5 4.5 . 6.2 .
Row-Index
 Index   0   1   2   3   4   5   6   7   8 
 Value  0 3 . 1 3 0 . 2 .

Row Index Structure

The CompressedColumnMatrix can contain an index into the rows of the matrix.This index must be explicitly built after the last element has been added to the matrix. The index will be deleted if any elements are added after it is built

This is how the index would be stored for the 4x4 example:
 
 
Row-End
 Index   0  1   2   3 
 Value  2 3 4 6
Column-Index
 Index    0    1    2    3    4    5 
 Value  0 2 1 3 0 1
Value-Index
 Index    0    1    2    3    4    5 
 Value  0 5 3 7 1 4



Copyright(C)1997-99 by DRA Systems all rights reserved.