<#GAPDoc Label="AsZFunctionWithInductiveSides" >
<Example><![CDATA [
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 ]
]]></Example>
<#/GAPDoc>
quality 100%
¤ Dauer der Verarbeitung: 0.22 Sekunden
(vorverarbeitet)
¤
*© Formatika GbR, Deutschland