combinat::finiteClass – Finite combinatorial classes.
combinat::finiteClass(lst) creates a finite combinatorial class from a list lst.
Creating the Type
combinat::finiteClass(DOM_LIST lst)
Parameters:
lst: |
a list of MuPAD objects. |
Details:
Given a list lst it is sometime useful to build a combinatorial classes whose objects are the elements of the list lst, for example for use as a basis set for a Dom::FreeModule. This can be done simply using combinat::finiteClass(lst).
The created class is a facade domain so there is no need to create directly objects of this class; in particular, no constructor is defined.
Categories
Cat::CombinatorialClass, Cat::FacadeDomain
See Also:
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 , 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.
Let us consider the class of vowels:
vowels := combinat::finiteClass(["a","e","i","o","u","y"]);
Then the interface of vowels is compatible with Cat::CombinatorialClass. It is therefore now possible to ask for the lists of vowels:
vowels::list()
to count the vowels:
vowels::count();
to rank them:
vowels::rank("e")
or to find the fourth vowel:
vowels::unrank(4)
Changes in MuPAD 4.0
New Function.