> < ^ Date: Thu, 19 Oct 1995 15:39:00 +0100 (MET)
> < ^ From: Heiko Theissen <heiko.theissen@math.rwth-aachen.de >
^ Subject: Re: IsConjugate / Print (fwd)

Dear forum readers,

1. Andreas Prinz has reported a strange behaviour of the function
`IsConjugate'. This is no bug, it really is a feature.

The conjugacy test whether <a> is conjugate to <b> in <G> is performed
by a backtrack search over <G> where elements are considered in turn
and for each such element <g> it is tested whether $a^g = b$. A search
tree is used to determine the order of the search and this tree also
makes it possible to

- discard large subtrees of elements because they can never
conjugate <a> to <b> and
- consider only one element per coset of the centralizer of <b>.

The special structure of the search tree is based on the cycle
structure of <a> and on the base chosen for <G>. `IsConjugate' returns
`true' when one conjugating element is found.

Now in the fast variant of Andreas Prinz's example the *first* element
considered in this way was already a conjugating element, whereas in
the slow variant (with <a> and <b> interchanged) only the 103681st
element did it. That's why it took so much longer.

Since the order in which the elements are considered depends on the
ordering of the basic orbits inside the stabilizer chain of <G>, the
only way I see which could catch this (rather exceptional) case would
be to set up the search tree for either choice of <a> and then see
whether the first element (or one of the first ten, or the first
hundred?) conjugates <a> to <b>. Better suggestions are of course
welcome.

2. Andreas Prinz also asked why he gets extra characters when long
lines are printed. I assume he meant that GAP prints a slosh `\' in
the 79th column (leaving the 80th column blank) and continues in the
next line when it prints a string that is longer than 78 characters.
(This applies to an 80 column screen.) GAP certainly never prints an
extra `\n' (or was a newline character meant?).

If you use `SizeScreen( [ <nrcols>, <nrrows> ] )', GAP behaves as if
your screen was <nrcols> columns wide and will therefore print fewer
extra sloshes. If the screen is actually not so wide it is your
operating system's duty to handle this situation. Beware: <nrcols> can
be at most 256.

3. Andreas Prinz also asked how to print something on the screen
without moving the cursor position. It is possible to include the
control sequence `\b' in a string, which -- when printed -- moves the
cursor back one position. Similarly, the control sequence `\c' at the
end of a string forces printing even if the string includes no newline
character. For example,

Print("for exemple\c");Lattice(SymmetricGroup(10));;Print("\b\b\b\b\ba\n");

prints `for exemple', waits quite some time and then overwrites
`exemple' with `example'.

Hope this helps, Heiko Thei{\ss}en


> < [top]