verify approximate equality between two plots - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Logic : Boolean : verify : verify/plot

verify/plot - verify approximate equality between two plots

Calling Sequence

verify(P, Q, plot)

verify(P, Q, 'plot'(opts))

Parameters

P, Q

-

anything, assumed to be PLOT data structures

opts

-

equation(s) of the form option=value where option is one of curves, display, display_floats, feature_floats, features, points, polygons, text, or traversal; specify options for the comparison

Description

• 

The verify(P, Q, plot) and verify(P, Q, 'plot'(opts)) calling sequences return true if the two PLOT data structures compare using the default comparator.

• 

The default comparator determines that two PLOT data structures are equal if:

1. 

Given two functions, they must have the same name, the same number of arguments, and their arguments must each compare using the default comparator

2. 

Given either two lists or Arrays, their corresponding entries must be equal

3. 

Given two ranges, their endpoints must be compare using the default comparator

4. 

By default, two floating-point numbers are equal if their difference is 0

5. 

All other objects are compared by using evalb

• 

If either P or Q is not a PLOT data structure then false is returned.

• 

The data structures within a plot object are separated into two classes, display objects, and feature objects.  The data structures, which fall into the first class are CURVES, POINTS, POLYGONS, TEXT, and VIEW.  All other data structures are considered to be feature data structures.

• 

At each stage, display and feature objects are compared separately, and any features are always compared using the default comparator with any options, which may be given by the features option.

• 

The opts argument can contain one or more of the following equations that set unit options.

  

 

  

curves = verification

  

If this option is given, the set of all CURVES objects are compared using this verification.

  

Two common verifications for this purpose may be function_bounds and function_shells.

  

 

  

display = truefalse

  

By default, the display objects of a plot are compared.  This can be turned off by setting this option to false.

  

 

  

display_floats = non-negative or verification

  

Given two display objects, the default comparator compares floating-point numbers by testing if their difference is 0.  If this option is set to a non-negative number, then floats are compared by checking that their difference is less than or equal to the given non-negative number.  If this option is any other verification, then two floating-point numbers are compared using this verification.

  

Common verifications may be float(10) or perhaps neighborhood.

  

 

  

feature_floats = non-negative or verification

  

Given two feature objects, the default comparator compares floating-point numbers by testing if their difference is 0.  If this option is set to a non-negative number, then floats are compared by checking that their difference is less than or equal to the given non-negative number.  If this option is any other verification, then two floating-point numbers are compared using this verification.

  

The feature_floats is different from display_floats as the latter may contain floating-point numbers of arbitrary magnitude, whereas floating-point numbers in features are often much more bounded, for example, color values.

  

Common verifications may be float(10) or perhaps neighborhood.

  

 

  

features = truefalse

  

By default, the feature objects of a plot are compared.  This can be turned off by setting this option to false.

  

 

  

points = verification

  

If this option is given, the set of all POINTS objects are compared using this verification.

  

 

  

polygons = verification

  

If this option is given, the set of all POLYGONS objects are compared using this verification.  Otherwise the default comparator are used to compare POLYGONS objects.

  

 

  

text = verification

  

If this option is given, the set of all TEXT objects are compared using this verification.

  

 

  

traversal = ordered, unordered, or one_to_one

  

By default, this option is set to ordered, in which case objects are compared in the same order in both plots.  If this option is set to unordered, then it is only necessary that a match be found for each object in the other PLOT data structure. If this option is set to one_to_one, then a one-to-one correspondence must be found between data structures in both objects.

  

The option one_to_one is significantly more expensive than either other test.  The option ordered is the least expensive, but is subject to ordering problems, which affect the structure, but not the final plot.

Examples

P:=plotsinx,x=0..1,numpoints=10,adaptive=false:

Q:=plotsinx,x=0..1,numpoints=37,adaptive=false:

R:=plotsinx,x=0..1,numpoints=37,adaptive=false,color=blue:

verifyP,Q,'plotcurves=function_bounds'

true

(1)

verifyP,Q,'plotcurves=function_shells0.1'

true

(2)

verifyQ,R,'plotfeatures=false'

true

(3)

Compare two plots ignoring minor differences

Digits:=20:

P:=plotBesselJ2,x,x=0..10:

Digits:=10:

Q:=plotBesselJ2,x,x=0..10:

verifyP,Q,'plotdisplay_floats=float1,digits=5'

true

(4)

verifyP,Q,'plotdisplay_floats=0.001'

true

(5)

Compare a plot and a PLOT data structure

P:=plot2x+3,x=0..5,numpoints=3,adaptive=false:

Q:=PLOTCURVES0.,3.,2.61565849999999989,8.23131700000000066,5.,13.,COLOURRGB,1.0,0.,0.,AXESLABELSx,,VIEW0...5.,DEFAULT:

verifyP,Q,'plotdisplay_floats=0.0001'

false

(6)

See Also

plot, plot,structure, verify, verify,function_bounds, verify,function_shells


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam