Returns the quantity value of a specified element of a sparse array.
Synopsis
g2-sparse-get
(value-array: class quantity-array, index-array: class integer-array,
index: integer)
-> value-of-index: quantity
| Return Value | Description |
|---|---|
|
value-of-index
|
A quantity value of the array element specified by index.
|
Description
g2-sparse-get returns the quantity in the sparse array represented by value-array and index-array whose index in the sparse array is given by index. This is accomplished by indexing value-array with the integer resulting from indexing index-array by index. Example
The following call to g2-sparse-get returns to element the quantity value of the element whose index is ind:
element = call g2-sparse-get(v-array, i-array, ind);
(0, 1, 0, 2, 0, 0, 3)
| Value of ind | Value returned to elements |
|---|---|
|
0
|
0
|
|
1
|
1
|
|
2
|
0
|
|
3
|
2
|
|
4
|
0
|
|
5
|
0
|
|
6
|
3
|