| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (27 out of 28)

g2-sparse-scatter

Converts a sparse array into full dense array format.

Synopsis

g2-sparse-scatter
(value-array: class quantity-array, index-array: class integer-array,
full-array: class quantity-array, begin-index: integer, end-index: integer)
Argument Description
value-array
The value array component of the sparse array.
index-array
The index array component of the sparse array.
full-array
The dense array produced by converting the sparse array represented by value-array and index-array.
begin-index
The index in value-array of the first element to convert into the dense array.
end-index
The index in value-array of the last element to convert into the dense array.

Description

g2-sparse-scatter converts a sparse array represented by value-array and index-array into a dense array. It returns the dense array to the full-array argument.

full-array must have all elements equal to zero when it is passed to this procedure.

begin-index is the index of the first element in value-array to convert. end-index is the index of the last element in value-array that is converted. In the dense array, elements have the index values listed in index-array.

To convert all elements in value-array into a dense array:

Example

The following call to g2-sparse-scatter returns the dense array represented by varray and iarray:

Suppose that the sparse array represented by varray and iarray is defined as follows:

The begin-index and end-index values indicate that the first five elements of varray are to be converted into a dense array. g2-sparse-array uses the values in varray and iarray to produce the following dense array:

If the begin-index and end-index values are 0 and 1, respectively, g2-sparse-array uses only the first two elements of varray to produce the dense array. In this case, g2-sparse-array returns:

| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (27 out of 28)

Copyright © 1997 Gensym Corporation, Inc.