combinat::finiteClass – Finite combinatorial classes.

combinat::finiteClass(lst) creates a finite combinatorial class from a list lst.

→ Examples

Creating the Type

combinat::finiteClass(DOM_LIST lst)

Parameters:

lst

a list of MuPAD objects.

Details:

Categories

Cat::CombinatorialClass, Cat::FacadeDomain

See Also:

combinat::subClass

isA – tests if an object belongs to the class

(combinat::finiteClass(DOM_LIST lst))::isA(object obj)

Returns TRUE if obj belongs to the list lst.

list – list the objects of the class

(combinat::finiteClass(DOM_LIST lst))::list()

Returns the list lst itself.

generator – generator for the objects of the class

(combinat::finiteClass(DOM_LIST lst))::generator()

Returns a generator for the elements of the list lst.

count – count the objects of the class

(combinat::finiteClass(DOM_LIST lst))::count()

Returns the number of elements in the list lst.

rank – rank of an object of the class

(combinat::finiteClass(DOM_LIST lst))::rank(object obj)

Returns the rank of the object math, that is its position in the list lst.

unrank – unranking of an object of the class

(combinat::finiteClass(DOM_LIST lst))::unrank(nonnegative integer r)

Returns the element of the list lst in position r.

Example 1:

Let us consider the class of vowels:

  vowels := combinat::finiteClass(["a","e","i","o","u","y"]);

math

Then the interface of vowels is compatible with Cat::CombinatorialClass. It is therefore now possible to ask for the lists of vowels:

  vowels::list()

math

to count the vowels:

   vowels::count();

math

to rank them:

  vowels::rank("e")

math

or to find the fourth vowel:

  vowels::unrank(4)

math

Changes in MuPAD 4.0

New Function.