muEC::COMP::ListCompo – list of compositions of a given weight

The muEC::COMP::ListCompo function gives all compositions of n. A composition of n is a list of positive integers, called parts, with sum n.

→ Examples

Call:

muEC::COMP::ListCompo(n, <Options>)

Parameters:

n

any non negative integer

Options:

lg = l | lg <= l

number (or maximal number) of parts of each composition

allowzeros

compositions may include zeros

nb

only counts objects

maxouter = p

outermost possible shape of the diagram

Return Value:

a list of compositions or their number

Related Functions:

muEC::COMP::ListCompoFatter, muEC::COMP::ListCompoFiner, muEC::TYP::IsCompo

Details:

The muEC::COMP::ListCompo function gives all compositions of n. A composition of n is a list of positive integers, called parts, with sum n.

When called with one argument, say n, the function returns the list of all compositions of n.

Given a composition comp, _plus(op(comp)) gives its weight.

Use the syntax hold(identifier), instead of identifier, if one of the identifiers above is already defined.

Example 1:

muEC::COMP::ListCompo( 3 );

math

muEC::COMP::ListCompo( 2, allowzeros, lg=3 );

math

muEC::COMP::ListCompo( 5, maxouter=[4,3], allowzeros, lg<=4 );

math

muEC::COMP::ListCompo( 20, lg<=10, nb );

math