copyReal - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.
Our website is currently undergoing maintenance, which may result in occasional errors while browsing. We apologize for any inconvenience this may cause and are working swiftly to restore full functionality. Thank you for your patience.

Online Help

All Products    Maple    MapleSim


ComplexDoubleRTable.copyReal

create and return a copy of the real values of the current ComplexDoubleRTable

 

Calling Sequence

Description

Examples

Calling Sequence

DoubleRTable copyReal( ) throws MapleException

Description

• 

The copyReal function creates and returns a new DoubleRTable that contains the real components of each element of the current ComplexDoubleRTable.

• 

As RTables do not have unique representations, the returned copy is a different Maple object from the original.  Therefore 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 );

        ComplexDoubleRTable a1 = (ComplexDoubleRTable)engine.evaluate( "Array( 1..2, 1..2, [[0.1,0.2],[0.3+.3*I,0.4+0.4*I]], datatype=complex[8]):" );

        System.out.println( a1 );

        ComplexDoubleRTable iCopy = a1.copyReal();

        System.out.println( iCopy );

        int[] index = new int[2];

        index[0] = 1;

        index[1] = 1;

        iCopy.assign( index, 10.0, 10.0 );

        System.out.println( a1 );

        System.out.println( iCopy );

    }

}

Executing this code produces the following output.

Array(1..2, 1..2,

[[.100000000000000004+0.*I,.200000000000000010+0.*I],[.299999999999999988+.299999999999999988*I,.400000000000000022+.400000000000000022*I]],

datatype = complex[8], storage = rectangular, order = Fortran_order)

Array(1..2, 1..2,

[[.100000000000000004+0.*I,.200000000000000010+0.*I],[.299999999999999988+0.*I,.400000000000000022+0.*I]],

datatype = complex[8], storage = rectangular, order = Fortran_order)

Array(1..2, 1..2,

[[.100000000000000004+0.*I,.200000000000000010+0.*I],[.299999999999999988+.299999999999999988*I,.400000000000000022+.400000000000000022*I]],

datatype = complex[8], storage = rectangular, order = Fortran_order)

Array(1..2, 1..2,

[[10.+10.*I,.200000000000000010+0.*I],[.299999999999999988+0.*I,.400000000000000022+0.*I]],

datatype = complex[8], storage = rectangular, order = Fortran_order)

See Also

ExternalCalling/Java/MapleException

OpenMaple

OpenMaple/Java/API

OpenMaple/Java/ComplexDoubleRTable

OpenMaple/Java/ComplexDoubleRTable/copyImaginary

OpenMaple/Java/RTable/copy

 


Download Help Document