RTable.numElements - return the number of elements stored in the RTable
|
Calling Sequence
|
|
int numElements( ) throws MapleException
|
|
Description
|
|
•
|
The numElements function returns the number of elements stored within the RTable.
|
|
|
Examples
|
|
import com.maplesoft.openmaple.*;
|
import com.maplesoft.externalcall.MapleException;
|
class Example
|
{
|
public static void main( String notused[] ) throws MapleException
|
{
|
String mapleArgs[];
|
Engine engine;
|
RTable a;
|
int index[];
|
Numeric one;
|
int n, i;
|
mapleArgs = new String[1];
|
mapleArgs[0] = "java";
|
engine = new Engine( mapleArgs, new EngineCallBacksDefault(),
|
null, null );
|
a = (RTable)engine.evaluate( "Array( 1..3, 1..3, (i,j)->(i*j)+1 ):" );
|
n = a.numElements();
|
System.out.println( "Number of elements: "+n );
|
a = (RTable)engine.evaluate( "Array( 10..30, 13..15, 11..17, (i,j)->(i*j)+1 ):" );
|
n = a.numElements();
|
System.out.println( "Number of elements: "+n );
|
}
|
}
|
|
|
Executing this code produces the following output.
Number of elements: 9
|
Number of elements: 441
|
|
|
|
|
Download Help Document
Was this information helpful?