MultiSet Selection - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Data Types : MultiSet : MultiSet Selection

MultiSet Selection

get or set the multiplicity of an element of a MultiSet

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

M[x]

M[x] := n;

Parameters

M

-

MultiSet; a MultiSet

x

-

anything, an expression

n

-

numeric, the new multiplicity of x in M

Description

• 

M[x] returns the multiplicity of the member x of the MultiSet M.

• 

M[x] := n sets the multiplicity of x in M to n.  Note that this is different from Insert( M, x=n ), which increases the multiplicity of x in M by n.

• 

Note M[x] := 0 is equivalent to Remove( M, x ).

• 

If M is a generalized MultiSet, n may be any real number.  Otherwise, it must be a non-negative integer.

Examples

> 

M≔MultiSet⁡a=2,b=5

M≔a,2,b,5

(1)
> 

Ma

2

(2)
> 

Mb≔7

Mb≔7

(3)
> 

Ma≔0

Ma≔0

(4)
> 

Mc≔4

Mc≔4

(5)
> 

M

b,7,c,4

(6)
> 

N≔MultiSetgeneralized⁡

N≔∅

(7)
> 

Nw≔3.14159

Nw≔3.14159

(8)
> 

N

w,3.14159

(9)

See Also

MultiSet

MultiSet/Insert

MultiSet/Remove