 copy - Maple Help

RTable.copy

create and return a copy of the current RTable Calling Sequence RTable copy( ) throws MapleException Description

 • The copy function creates and returns a new RTable that contains the same data as the current RTable.
 • As RTables do not have unique representations, the returned copy is a different Maple object from the original.  Changes to the copy do not affect the original. Examples

 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 ); RTable a, b; int index[]; Numeric one; a = (RTable)engine.evaluate( "Array( 1..3, 1..3, (i,j)->(i*j)+1 ):" ); b = a.copy(); index = new int; one = engine.newNumeric( 1 ); index = 1; index = 1; ((AlgebraicRTable)b).assign( index, one ); index = 2; index = 2; ((AlgebraicRTable)b).assign( index, one ); index = 3; index = 3; ((AlgebraicRTable)b).assign( index, one ); System.out.println( a ); System.out.println( b ); } }

Executing this code produces the following output.

 Array(1..3, 1..3, [[2,3,4],[3,5,7],[4,7,10]], datatype = anything, storage = rectangular, order = Fortran_order) Array(1..3, 1..3, [[1,3,4],[3,1,7],[4,7,1]], datatype = anything, storage = rectangular, order = Fortran_order)