Maple für Professional
Maple für Akademiker
Maple für Studenten
Maple Personal Edition
Maple Player
Maple Player für iPad
MapleSim für Professional
MapleSim für Akademiker
Maple T.A. - Testen & beurteilen
Maple T.A. MAA Placement Test Suite
Möbius - Online-Courseware
Machine Design / Industrial Automation
Luft- und Raumfahrt
Fahrzeugtechnik
Robotics
Energiebranche
System Simulation and Analysis
Model development for HIL
Anlagenmodelle für den Regelungsentwurf
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematikausbildung
Technik
Allgemein- und berufsbildende Schulen
Testen und beurteilen
Studierende
Finanzmodelle
Betriebsforschung
Hochleistungsrechnen
Physik
Live-Webinare
Aufgezeichnete Webinare
Geplante Veranstaltungen
MaplePrimes
Maplesoft-Blog
Maplesoft-Mitgliedschaft
Maple Ambassador Program
MapleCloud
Technische Whitepapers
E-Mail Newsletters
Maple-Bücher
Math Matters
Anwendungs-Center
MapleSim Modell-Galerie
Anwenderberichte
Exploring Engineering Fundamentals
Lehrkonzepte mit Maple
Maplesoft Welcome-Center
Resource-Center für Lehrer
Help-Center für Studierende
Algebraic.unique - get the unique representation of a Maple expression
Calling Sequence
Algebraic unique() throws MapleException
Description
The unique function returns the unique representation of the current Maple expression.
Most Maple expressions have a unique representation within Maple. Sometimes working with the unique representation is useful (two expressions can be compared very efficiently, see dagEquals) and sometimes it is not (while adding elements to a list or expression sequence it is very inefficient to unique each intermediate stage). Most functions in Java OpenMaple return objects already using their unique representation; however, in some cases the object returned is not unique.
The Algebraic objects returned by newList and newExpseq are not in their unique representation. Once they have been initialized, unique should be called on them to obtain the unique representation. Failing to do so can lead to unpredictable results.
The current Algebraic object is unchanged by this call.
Calling unique on an Algebraic that already stores a unique representation returns a reference to the same Algebraic object.
If a unique representation for the current Maple expression does not exist, the current Maple expression becomes that unique representation. Therefore the Algebraic returned by unique may refer to the same Maple object as the original. The dagEquals function can be used to determine if they refer to the same Maple object.
Examples
import com.maplesoft.openmaple.*;
import com.maplesoft.externalcall.MapleException;
class Example
{
public static void main( String notused[] ) throws MapleException
String mapleArgs[];
Engine engine;
List original, unique, global;
mapleArgs = new String[1];
mapleArgs[0] = "java";
engine = new Engine( mapleArgs, new EngineCallBacksDefault(),
null, null );
global = (List)engine.evaluate( "[100]:" );
original = engine.newList( 1 );
original.assign( 1, engine.newNumeric( 100 ) );
unique = (List)original.unique();
if ( !original.dagEquals( unique ) )
System.out.println( "unique not equal to original" );
}
if ( !original.dagEquals( global ) )
System.out.println( "global not equal to original" );
if ( unique.dagEquals( global ) )
System.out.println( "unique and global are equal" );
Executing this code produces the following output.
unique not equal to original
global not equal to original
unique and global are equal
See Also
ExternalCalling/Java/MapleException, OpenMaple, OpenMaple/C/MapleUnique, OpenMaple/Java/Algebraic, OpenMaple/Java/Algebraic/dagEquals, OpenMaple/Java/API, OpenMaple/Java/Engine/newExpseq, OpenMaple/Java/Engine/newList
Download Help Document