|
| 1 | +#! @Chapter Precompilation |
| 2 | + |
| 3 | +#! @Section Precompiling ProjectionInFactorOfBinaryDirectProduct |
| 4 | + |
| 5 | +#! @Example |
| 6 | + |
| 7 | +#! #@if ValueOption( "no_precompiled_code" ) <> true |
| 8 | + |
| 9 | +LoadPackage( "FinSetsForCAP", false ); |
| 10 | +#! true |
| 11 | +LoadPackage( "CompilerForCAP", ">= 2023.12-09", false ); |
| 12 | +#! true |
| 13 | +ReadPackageOnce( "FinSetsForCAP", "gap/CompilerLogic.gi" ); |
| 14 | +#! true |
| 15 | + |
| 16 | +sFinSets := CategoryOfSkeletalFinSets( : no_precompiled_code := true ); |
| 17 | +#! SkeletalFinSets |
| 18 | + |
| 19 | +LeftProjectionInFactorOfBinaryDirectProduct := |
| 20 | + function( cat, a, b, axb ) |
| 21 | + return ProjectionInFactorOfDirectProductWithGivenDirectProduct( cat, |
| 22 | + [ a, b ], |
| 23 | + 1, |
| 24 | + axb ); end; |
| 25 | +#! function( cat, a, b, axb ) ... end |
| 26 | + |
| 27 | +RightProjectionInFactorOfBinaryDirectProduct := |
| 28 | + function( cat, a, b, axb ) |
| 29 | + return ProjectionInFactorOfDirectProductWithGivenDirectProduct( cat, |
| 30 | + [ a, b ], |
| 31 | + 2, |
| 32 | + axb ); end; |
| 33 | +#! function( cat, a, b, axb ) ... end |
| 34 | + |
| 35 | +StartTimer( "ProjectionInFactorOfBinaryDirectProduct" ); |
| 36 | + |
| 37 | +compiled_LeftProjectionInFactorOfBinaryDirectProduct := |
| 38 | + CapJitCompiledFunction( LeftProjectionInFactorOfBinaryDirectProduct, |
| 39 | + sFinSets, |
| 40 | + [ "category", "object", "object", "object" ], |
| 41 | + "morphism" ); |
| 42 | +#! function( cat_1, a_1, b_1, axb_1 ) ... end |
| 43 | + |
| 44 | +compiled_RightProjectionInFactorOfBinaryDirectProduct := |
| 45 | + CapJitCompiledFunction( RightProjectionInFactorOfBinaryDirectProduct, |
| 46 | + sFinSets, |
| 47 | + [ "category", "object", "object", "object" ], |
| 48 | + "morphism" ); |
| 49 | +#! function( cat_1, a_1, b_1, axb_1 ) ... end |
| 50 | + |
| 51 | +StopTimer( "ProjectionInFactorOfBinaryDirectProduct" ); |
| 52 | +#DisplayTimer( "ProjectionInFactorOfBinaryDirectProduct" ); |
| 53 | + |
| 54 | +Display( compiled_LeftProjectionInFactorOfBinaryDirectProduct ); |
| 55 | +#! function ( cat_1, a_1, b_1, axb_1 ) |
| 56 | +#! local hoisted_1_1, deduped_3_1; |
| 57 | +#! deduped_3_1 := Length( axb_1 ); |
| 58 | +#! hoisted_1_1 := Length( a_1 ); |
| 59 | +#! return CreateCapCategoryMorphismWithAttributes( cat_1, axb_1, a_1, |
| 60 | +#! AsList, List( [ 0 .. deduped_3_1 - 1 ], function ( i_2 ) |
| 61 | +#! return RemIntWithDomain( i_2, hoisted_1_1, deduped_3_1 ); |
| 62 | +#! end ) ); |
| 63 | +#! end |
| 64 | + |
| 65 | +Display( compiled_RightProjectionInFactorOfBinaryDirectProduct ); |
| 66 | +#! function ( cat_1, a_1, b_1, axb_1 ) |
| 67 | +#! local hoisted_1_1, deduped_3_1; |
| 68 | +#! deduped_3_1 := Length( axb_1 ); |
| 69 | +#! hoisted_1_1 := Length( a_1 ); |
| 70 | +#! return CreateCapCategoryMorphismWithAttributes( cat_1, axb_1, b_1, |
| 71 | +#! AsList, List( [ 0 .. deduped_3_1 - 1 ], function ( i_2 ) |
| 72 | +#! return QuoIntWithDomain( i_2, hoisted_1_1, deduped_3_1 ); |
| 73 | +#! end ) ); |
| 74 | +#! end |
| 75 | + |
| 76 | +#! #@fi |
| 77 | + |
| 78 | +#! @EndExample |
0 commit comments