ShortRTable.assign
assign a short into an element of the ShortRTable
Calling Sequence
Parameters
Description
Examples
void assign( int index[], short val ) throws MapleException
index
-
index of the entry to assign
val
value to assign to the list
The assign function assigns the Java short val into the element of the ShortRTable indexed by index.
The index parameter is an array of integers, one for each dimension of the ShortRTable. Each integer must be within the bounds determined by lowerBound and upperBound. The index for dimension i is stored in the array at position i−1.
As RTables do not have unique representations, elements of an RTable can be assigned to at any time.
import com.maplesoft.openmaple.*;
import com.maplesoft.externalcall.MapleException;
class Example
{
public static void main( String notused[] ) throws MapleException
String[] mapleArgs = { "java" };
Engine engine = new Engine( mapleArgs, new EngineCallBacksDefault(), null, null );
String cmd = "Array( 1..2, 1..2, [[1000,2000],[3000,4000]], datatype=integer[2]):";
ShortRTable a1 = (ShortRTable)engine.evaluate( cmd );
int[] index = new int[2];
short s = 5000;
index[0] = 1;
index[1] = 1;
a1.assign( index, s );
s = 6000;
index[0] = 2;
s = 8000;
index[1] = 2;
System.out.println( a1 );
}
Executing this code produces the following output.
Array(1..2, 1..2, [[5000,8000],[6000,8000]], datatype = integer[2], storage = rectangular, order = Fortran_order)
See Also
ExternalCalling/Java/MapleException
OpenMaple
OpenMaple/Java/API
OpenMaple/Java/RTable
OpenMaple/Java/RTable/lowerBound
OpenMaple/Java/RTable/upperBound
OpenMaple/Java/ShortRTable
OpenMaple/Java/ShortRTable/select
Download Help Document