|
# ToolsForHomalg, single 1
#
# DO NOT EDIT THIS FILE - EDIT EXAMPLES IN THE SOURCE INSTEAD!
#
# This file has been generated by AutoDoc. It contains examples extracted from
# the package documentation. Each example is preceded by a comment which gives
# the name of a GAPDoc XML file and a line range from which the example were
# taken. Note that the XML file in turn may have been generated by AutoDoc
# from some other input.
#
gap> START_TEST("toolsforhomalg01.tst");
# doc/_Chunks.xml:2-55
gap> f := function (i) Print( "Current i is ", i, "\n" ); return i^2; end;;
gap> seq := AsZFunction( f );
<ZFunction>
gap> seq[ 0 ];
Current i is 0
0
gap> seq[ 0 ];
0
gap> upper_func := function ( a )
> if a[ 2 ] <> 0 then return [ a[ 2 ], a[ 1 ] mod a[ 2 ] ]; fi; return a; end;;
gap> lower_func := IdFunc;;
gap> gcd_seq := ZFunctionWithInductiveSides( 0, [ 111, 259 ],
> lower_func, upper_func, \= );
<ZFunction>
gap> HasStableLowerValue( gcd_seq );
false
gap> gcd_seq[ -1 ];
[ 111, 259 ]
gap> HasStableLowerValue( gcd_seq );
true
gap> StableLowerValue( gcd_seq );
[ 111, 259 ]
gap> IndexOfStableLowerValue( gcd_seq );
0
gap> gcd_seq[ 0 ];
[ 111, 259 ]
gap> gcd_seq[ 1 ];
[ 259, 111 ]
gap> gcd_seq[ 2 ];
[ 111, 37 ]
gap> gcd_seq[ 3 ];
[ 37, 0 ]
gap> HasStableUpperValue( gcd_seq );
false
gap> gcd_seq[ 4 ];
[ 37, 0 ]
gap> HasStableUpperValue( gcd_seq );
true
gap> StableUpperValue( gcd_seq );
[ 37, 0 ]
gap> IndexOfStableUpperValue( gcd_seq );
3
gap> sum := ApplyMap( gcd_seq, Sum );
<ZFunction>
gap> sum[ 0 ];
370
gap> sum[ 100 ];
37
gap> c := CombineZFunctions( [ gcd_seq, sum ] );
<ZFunction>
gap> c[ 0 ];
[ [ 111, 259 ], 370 ]
#
gap> STOP_TEST("toolsforhomalg01.tst", 1);
[ Dauer der Verarbeitung: 0.26 Sekunden
(vorverarbeitet)
]
|