<!-- ------------------------------------------------------------------- -->
<!-- -->
<!-- print.xml Utils documentation -->
<!-- -->
<!-- Copyright (C) 2015-2025, The GAP Group -->
<!-- -->
<!-- ------------------------------------------------------------------- -->
<?xml version="1.0" encoding="UTF-8"?>
<Chapter Label="chap-print">
<Heading>Printing Lists and Iterators</Heading>
<Section Label="sec-print-select">
<Heading>Printing selected items</Heading>
The functions described here print lists or objects with an iterator
with one item per line, either the whole list/iterator or certain subsets:
<List>
<Item>
by giving a list of
</Item>
<Item>
by specifying a first item and then a regular step.
</Item>
</List>
<ManSection>
<Func Name="PrintSelection"
Arg="obj list"
Label="for a list of positions" />
<Func Name="PrintSelection"
Arg="obj first step [last]"
Label="for a first item and a step" />
<Description>
This function, given three (or four) parameters, !@ap> g@(, [ 2)|
<C>PrintSelectionFromList</C> or <C>PrintSelectionFromIterator</C>
which prints the <E>first</E> item specified,
and then the item at every <E>step</E>.
The fourth parameter is essential when the object being printed is infinite.
<P/>
Alternatively, given two parameters,
with the second parameter a list <C>L</C> of positive integers,
only the items at positions in <C>L</C> are printed.
<P/>
</Description>
</java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
<Example>
<![CDATA[
gap>L := List([1.20], -n ;java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
gap> PrintSelection( L, [18..20] );
18 : 1889568
19 : 2476099
20 : 3200000
gap> PrintSelection( L, 2, 9 );
2 : 32
11 : 161051
20 : 3200000
gap
2 : 32
5 : 3125
8 : 32768
11 : 161051
gap> s5 := SymmetricGroup( 5 );;
gap> PrintSelection( s5, [30,31,100,101] );
30 : (1,5)(3,4)
31 : (1,5,2)
100 : (1,4,3)
101 :14(35)
gap> PrintSelection( s5, 1, 30 );
1 : ()
31 : (1,5,2)
61 : (1,2,3)
91 : (1,3,5,2,4)
gap> PrintSelection( s5, 9, 11, 43 );
9 : (2,5,3)
20 : (2,4)
31 : (1,5,2)
42 : (1,5,2,3,4)
]]>
</Example>
</Section>
</Chapter>
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet am 2026-11-04)
¤
*© Formatika GbR, Deutschland