[GAP Forum] File input

Joe Bohanon jbohanon2 at gmail.com
Tue Feb 3 18:16:23 GMT 2009


Here's a previous post on the forum about this subject.

http://www.gap-system.org/ForumArchive/Index/Subject/F.html#factors_of_a_permutation_cycle

Don King wrote:
>
> Thanks for all who helped me with this issue. I used a 
> "Sortex(<list>)" method, and now it seems everything is working fine.
>  
> I am wondering if only outputs with transposes are also possible with 
> "Sortex" method.
>  
> For instance,
> <<Permutation Notation>> 
> [1,3,2,4]
> [2,4,1,3]
> ...........
>
> The output of a "Sortex" method
> <<Cycle Notation>>
> (2,3)
> (1, 2, 4, 3)
> .......
>  
> The (desired) output of  only transposes
> <<Transopose Notation>>
> (2,3)
> (1,3)(1,4)(1,2)
>  
> Many thanks
> Don
>  
>
>  
> ------------------------------------------------------------------------
> *From:* Joe Bohanon <jbohanon2 at gmail.com>
> *To:* Don King <symmetryholic at yahoo.ca>
> *Cc:* forum at gap-system.org
> *Sent:* Monday, February 2, 2009 11:28:39 PM
> *Subject:* Re: [GAP Forum] File input
>
> Sortex(<list>) will convert the list into the elements of S_n you want.
>
> If you want to input a txt file, I would first open the file in a word 
> processor and turn it into a big list.  For instance, add "list:=[" to 
> the beginning, do a find-and-replace finding ] and replacing with ],.  
> Then go to the end of the file, remove the extraneous comma and add "]:"
>
> Then in GAP you do Read("file.txt"); (or put in the correct path if 
> necessary).  Then List(list,Sortex) will give you what you want.  If 
> you want a list without the commas, you can do, for instance:
> list2:=List(list,Sortex);
> for m in list2 do Print(m,"\n"); od;
>
> Joe
>
> On Mon, Feb 2, 2009 at 9:09 PM, Don King <symmetryholic at yahoo.ca 
> <mailto:symmetryholic at yahoo.ca>> wrote:
>
>     Hello,
>
>     I am wondering if a file input is supported to convert a list of
>     permutations into a list of cycles.
>
>     For instance,
>
>     I have an "a.txt" that includes
>
>     [1,3,2,4]
>     [2,4,1,3]
>     ...........
>
>     The output I'd like to get is  cycle formatted, such as
>     (2,3)
>     (1, 2, 4, 3)
>     ....
>
>     If the file input is not supported, what commands can be used to
>     convert multiple permutations into cycles?
>
>     Thanks in advance.
>
>     Best regards,
>     Don 
>
>
>        
>      __________________________________________________________________
>     Yahoo! Canada Toolbar: Search from anywhere on the web, and
>     bookmark your favourite sites. Download it now at
>     http://ca.toolbar.yahoo.com <http://ca.toolbar.yahoo.com/>.
>     _______________________________________________
>     Forum mailing list
>     Forum at mail.gap-system.org <mailto:Forum at mail.gap-system.org>
>     http://mail.gap-system.org/mailman/listinfo/forum
>
>
>
> ------------------------------------------------------------------------
> Now with a new friend-happy design! Try the new *Yahoo! Canada 
> Messenger* <http://ca.beta.messenger.yahoo.com/>



More information about the Forum mailing list