User`s guide
4 Using MWArra y Classes
C.set(index, val);
Object x = C.get(index);
System.out.println("Cell data C(1,3) is " + x.toString());
When run, the example displays this output:
Cell data C(1,3) is 15
getCell. This method returns a shared copy of the element at the specified
one-based offset in this array as an
MWArray in sta n ce.
To get the element at a specific index, use one of the following:
public MWArray getCell(int index)
public MWArray getCell(int[] index)
Use the first syntax (int index) to return the ele ment at the specified
one-based offset in the a rray, accessing elements in column-wise order. Us e the
second syntax (
int[] index) to return the element at the specified array of
one-based indices. The first syntax offers better performance than the second.
getCell returns an MWArray instance representing the requested cell. When
you a re done using this instance, call
MWArray.dispose() to dispose of i t.
Input Parameters
index
Index of the requested element in the MWCellArray
In the case where index is of type int, the valid range for index is 1<=index
<= N
,whereN is the total number of elements in the array.
Inthecasewhere
index is of type int[],eachelementoftheindex vector
is an index along one dimension of the
MWCellArray object. The valid range
for any index is
1 <= index[i] <= N[i],whereN[i] isthesizeoftheith
dimension.
4-142