BinaryPredicates - Maple Help

RealBox

 BinaryPredicates
 binary predicates for RealBox objects
 Equal
 check for data structure equality of two RealBox objects
 Eq
 check for mathematical equality of two RealBox objects
 NotEq
 check for non-equality of two RealBox objects
 LessThan
 check for strict inequality of two RealBox objects
 <
 check for strict inequality of two RealBox objects
 LessEqual
 check for inequality of two RealBox objects
 <=
 check for inequality of two RealBox objects
 Overlaps
 check for a nonempty intersection of two RealBox objects
 Contains
 check for inclusion between two RealBox objects

 Calling Sequence Equal( b1, b2 ) Eq( b1, b2 ) NotEq( b1, b2 ) b1 < b2 b1 <= b2 LessThan( b1, b2 ) LessEqual( b1, b2 ) Overlaps( b1, b2 ) Contains( b1, b2 )

Parameters

 b1 - RealBox object b2 - RealBox object precopt - (optional) equation of the form precision = n, where n is a positive integer

Description

 • Each RealBox object defines a number of predicates that can be used to query various properties of the box.
 • Predicates may be further subdivided into unary predicates (of a single RealBox object) or binary (for comparing two RealBox objects).
 • The following table describes briefly the defined binary predicate methods for RealBox objects.

 Predicate Description Equal returns true if the arguments are equal as boxes Eq returns true if the arguments are equal in a way that is "mathematically meaningful" NotEq returns true if the arguments are unequal in a way that is "mathematically meaningful" LessThan returns true if every member of the first argument is less than every member of the second < operator form of LessThan LessEqual returns true if every member of the first argument is less than or equal to every member of the second <= operator form of LessEqual Overlaps returns true if the operands have nonempty intersection Contains returns true if the first operand contains the second operand

 • Use the 'precision' = n option to control the precision used in these methods. For more details on precision, see BoxPrecision.

Examples

The Equal predicate returns true when its two arguments are "equal as boxes".

 > $\mathrm{Equal}\left(\mathrm{RealBox}\left(0,1.{10}^{-10}\right),\mathrm{RealBox}\left(0,1.{10}^{-10}\right)\right)$
 ${\mathrm{true}}$ (1)

The Eq predicate is different; it returns a "mathematically meaningful" test for equality.

 > $\mathrm{Eq}\left(\mathrm{RealBox}\left(0,1.{10}^{-10}\right),\mathrm{RealBox}\left(0,1.{10}^{-10}\right)\right)$
 ${\mathrm{false}}$ (2)
 > $\mathrm{Eq}\left(\mathrm{RealBox}\left(0\right),\mathrm{RealBox}\left(0\right)\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{Eq}\left(\mathrm{RealBox}\left(0.0\right),\mathrm{RealBox}\left(0\right)\right)$
 ${\mathrm{true}}$ (4)
 > $\mathrm{Eq}\left(\mathrm{RealBox}\left(-0.0\right),\mathrm{RealBox}\left(0\right)\right)$
 ${\mathrm{true}}$ (5)
 > $\mathrm{Eq}\left(\mathrm{RealBox}\left(0.0\right),\mathrm{RealBox}\left(-0.0\right)\right)$
 ${\mathrm{true}}$ (6)

The NotEq predicate returns true when its two arguments are not equal in  a "mathematically meaningful" way.

 > $\mathrm{NotEq}\left(\mathrm{RealBox}\left(0,1.{10}^{-10}\right),\mathrm{RealBox}\left(0,1.{10}^{-10}\right)\right)$
 ${\mathrm{false}}$ (7)

The comparison predicates LessThan and LessEqual, as well as their infix operator counterparts < and <=, return true if the indicates comparison is true for all members of their box operands.

 > $\mathrm{LessEqual}\left(\mathrm{RealBox}\left(1,1\right),\mathrm{RealBox}\left(3,1\right)\right)$
 ${\mathrm{true}}$ (8)

Also note that < and <= require that you use evalb in a non-boolean context.

 > $\mathrm{evalb}\left(\mathrm{RealBox}\left(1,1\right)\le \mathrm{RealBox}\left(3,1\right)\right)$
 ${\mathrm{true}}$ (9)
 > $\mathrm{evalb}\left(\mathrm{RealBox}\left(1,1\right)<\mathrm{RealBox}\left(4,1\right)\right)$
 ${\mathrm{true}}$ (10)
 > $\mathrm{Contains}\left(\mathrm{RealBox}\left(4,4\right),\mathrm{RealBox}\left(3,1\right)\right)$
 ${\mathrm{true}}$ (11)
 > $\mathrm{Contains}\left(\mathrm{RealBox}\left(0,2\right),\mathrm{RealBox}\left(3,1\right)\right)$
 ${\mathrm{false}}$ (12)
 > $\mathrm{Overlaps}\left(\mathrm{RealBox}\left(0,2\right),\mathrm{RealBox}\left(3,1\right)\right)$
 ${\mathrm{true}}$ (13)

Compatibility

 • The RealBox[BinaryPredicates], RealBox[Equal], RealBox[Eq], RealBox[NotEq], RealBox[LessThan], RealBox[<], RealBox[LessEqual], RealBox[<=], RealBox[Overlaps] and RealBox[Contains] commands were introduced in Maple 2022.