MultiSet/+ - Maple Programming Help

Online Help

All Products    Maple    MapleSim


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

MultiSet/+

MultiSet + operator

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

M + N

M + N + P + ...

Parameters

M, N, P, ...

-

MultiSet; MultiSets, sets, or lists

Description

• 

M + N returns the MultiSet which is the sum of M and N, accounting for multiplicities.  For example, if a has multiplicity 2 in M and 3 in N then it will have multiplicity 5 in M + N.

• 

The M + N + P ... command performs the n-ary sum of the arguments

• 

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

MMultiSeta=2,b=5,c=4

Ma,2,b,5,c,4

(1)

NMultiSeta=4,c=3,d=7

Na,4,c,3,d,7

(2)

M+N

a,6,b,5,c,7,d,7

(3)

M+N+b,c,c,e

a,6,b,6,c,9,d,7,e,1

(4)

Increment the multiplicity of every element by 1:

M+convertM,set

a,3,b,6,c,5

(5)

Compatibility

• 

The MultiSet/+ operator was introduced in Maple 2016.

• 

For more information on Maple 2016 changes, see Updates in Maple 2016.

See Also

convert/MultiSet

MultiSet

MultiSet/intersect

MultiSet/minus

MultiSet/subset

MultiSet/symmdiff

MultiSet/union