> < ^ Date: Fri, 10 Sep 1999 05:57:12 -0500 (CDT)
> ^ From: Robert F. Morse <rm43@evansville.edu >
> < ^ Subject: Re: Collections of tuples

Dear Gap forum,

On Fri, 10 Sep 1999, Sergio Polini wrote:

Please, could anybody tell me how to build a collection of tuples?
I can't understand how to build "elems" in:

GeneralMappingByElements(S, R, elems)

"elems" is a list of objects of type Tuple whose first component is an
element from the domain S and the second is from R. The basic constructor
is Tuple(<object list>)

Here's a quick example:

gap> S := Domain([1,2,3]);
<object>
gap> R := Domain([(1,2), (2,3), (3,4)]);
<object>
gap> elems := [Tuple([1,(1,2)]),Tuple([2,(3,4)])];
[ Tuple( [ 1, (1,2) ] ), Tuple( [ 2, (3,4) ] ) ]
gap> m := GeneralMappingByElements(S,R,elems);
<general mapping: <object> -> <object> >
gap> Images(m,S);
[ (3,4), (1,2) ]

Hope this helps.

Robert

.......................................................................

Robert F. Morse
Associate Professor of Computer Science
University of Evansville
1800 Lincoln Ave
Evansville, IN 47722

Phone: (812) 479-2994
e-mail: rfmorse@evansville.edu
http://www.evansville.edu/~rm43

Miles-Receive-Header: reply


> < [top]