 MultiSet/= - Maple Programming Help

Home : Support : Online Help : Programming : Data Types : MultiSet : MultiSet/=

MultiSet/=

test if two MultiSets are equal

MultiSet/<>

test if two MultiSets are not equal

 Calling Sequence M = N M <> N

Parameters

 M - MultiSet; a MultiSet, set, or list N - MultiSet; a MultiSet, set, or list

Description

 • M = N constructs a boolean expression which tests if M and N are equal as MultiSets, under evaluation either explicity via evalb or implicitly as the test of a conditional, such as an if ... then ... end if statement.
 • M <> N similarly tests for inequality of MultiSets.
 • At least one argument must be a MultiSet for this routine to be invoked.  Any other argument which is expected to be a MultiSet can be a MultiSet, a set or a list; in the latter two cases the argument is converted to a MultiSet before proceeding to evaluate this command.  IsGeneralized(M) must return the same value for all MultiSet arguments M, and all non-MultiSet arguments will be promoted to MultiSets with this same property.

Examples

 > $M≔\mathrm{MultiSet}\left(a=2,b=5\right)$
 ${M}{≔}\left\{\left[{a}{,}{2}\right]{,}\left[{b}{,}{5}\right]\right\}$ (1)
 > $N≔\mathrm{MultiSet}\left(M\right)$
 ${N}{≔}\left\{\left[{a}{,}{2}\right]{,}\left[{b}{,}{5}\right]\right\}$ (2)
 > $\mathrm{evalb}\left(M=N\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{Remove}\left(N,b,2\right)$
 ${3}$ (4)
 > $N$
 $\left\{\left[{a}{,}{2}\right]{,}\left[{b}{,}{3}\right]\right\}$ (5)
 > $\mathrm{evalb}\left(M\ne N\right)$
 ${\mathrm{true}}$ (6)
 > $\mathrm{evalb}\left(N=\left[a,b,a,b,b\right]\right)$
 ${\mathrm{true}}$ (7)

Compatibility

 • The MultiSet/= and MultiSet/<> operators were introduced in Maple 2016.