Goto Chapter: Top 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Ind
 [Top of Book]  [Contents]   [Previous Chapter]   [Next Chapter] 

15 Precompilation
 15.1 Precompiling the category of finite quivers
 15.2 Precompiling the category of finite reflexive quivers

15 Precompilation

15.1 Precompiling the category of finite quivers

gap> LoadPackage( "FunctorCategories", false );
true
gap> LoadPackage( "CompilerForCAP", ">= 2022.09-02", false );
true
gap> ReadPackageOnce( "FinSetsForCAP", "gap/CompilerLogic.gi" );
true
gap> ReadPackageOnce( "Algebroids", "gap/CompilerLogic.gi" );
true
gap> ReadPackageOnce( "FunctorCategories", "gap/CompilerLogic.gi" );
true
gap> category_constructor := { } -> CategoryOfBouquetsEnrichedOver( CategoryOfSkeletalFinSets( : FinalizeCategory := true ) );;
gap> given_arguments := [ ];;
gap> compiled_category_name := "FinBouquetsPrecompiled";;
gap> package_name := "FunctorCategories";;
gap> CapJitPrecompileCategoryAndCompareResult(
>     category_constructor,
>     given_arguments,
>     package_name,
>     compiled_category_name
>    : operations := [ "InitialObject",
>                      "Coproduct",
>                      "InjectionOfCofactorOfCoproductWithGivenCoproduct",
>                      "UniversalMorphismFromCoproductWithGivenCoproduct",
>                      #"CoproductOnMorphismsWithGivenCoproducts", # <- derived and leads to an error
>                      #"CoproductFunctorialWithGivenCoproducts", # <- derived
>                      "DistinguishedObjectOfHomomorphismStructure",
>                      "HomomorphismStructureOnObjects",
>                      #"HomomorphismStructureOnMorphismsWithGivenObjects",
>                      "InterpretMorphismFromDistinguishedObjectToHomomorphismStructureAsMorphism",
>                      "MorphismsOfExternalHom",
>                      ]
> );;
gap> FinBouquetsPrecompiled( );
CategoryOfBouquetsEnrichedOver( SkeletalFinSets )
gap> cat := CategoryOfBouquetsEnrichedOver( SkeletalFinSets );
CategoryOfBouquetsEnrichedOver( SkeletalFinSets )
gap> # Now we check whether the compiled code is loaded automatically.
> # For this we use the name of the argument of `InitialObject`;
gap> # for non-compiled code it is "cat", while for compiled code it is "cat_1":
> argument_name := NamesLocalVariablesFunction(
>     Last( cat!.added_functions.InitialObject )[1] )[1];;
gap> (ValueOption( "no_precompiled_code" ) = true and argument_name = "cat") or
>     (ValueOption( "no_precompiled_code" ) = fail and argument_name = "cat_1");
true
gap> LoadPackage( "FunctorCategories", false );
true
gap> LoadPackage( "CompilerForCAP", ">= 2022.09-02", false );
true
gap> ReadPackageOnce( "FinSetsForCAP", "gap/CompilerLogic.gi" );
true
gap> ReadPackageOnce( "Algebroids", "gap/CompilerLogic.gi" );
true
gap> ReadPackageOnce( "FunctorCategories", "gap/CompilerLogic.gi" );
true
gap> category_constructor := { } -> CategoryOfQuiversEnrichedOver( CategoryOfSkeletalFinSets( : FinalizeCategory := true ) );;
gap> given_arguments := [ ];;
gap> compiled_category_name := "FinQuiversPrecompiled";;
gap> package_name := "FunctorCategories";;
gap> CapJitPrecompileCategoryAndCompareResult(
>     category_constructor,
>     given_arguments,
>     package_name,
>     compiled_category_name
>    : operations := [ "InitialObject",
>                      "Coproduct",
>                      #"InjectionOfCofactorOfCoproductWithGivenCoproduct",
>                      #"UniversalMorphismFromCoproductWithGivenCoproduct",
>                      #"CoproductOnMorphismsWithGivenCoproducts", # <- derived and leads to an error
>                      #"CoproductFunctorialWithGivenCoproducts", # <- derived
>                      "DistinguishedObjectOfHomomorphismStructure",
>                      "HomomorphismStructureOnObjects",
>                      #"HomomorphismStructureOnMorphismsWithGivenObjects",
>                      "InterpretMorphismFromDistinguishedObjectToHomomorphismStructureAsMorphism",
>                      "MorphismsOfExternalHom",
>                      ]
> );;
gap> FinQuiversPrecompiled( );
CategoryOfQuiversEnrichedOver( SkeletalFinSets )
gap> cat := CategoryOfQuiversEnrichedOver( SkeletalFinSets );
CategoryOfQuiversEnrichedOver( SkeletalFinSets )
gap> # Now we check whether the compiled code is loaded automatically.
> # For this we use the name of the argument of `InitialObject`;
gap> # for non-compiled code it is "cat", while for compiled code it is "cat_1":
> argument_name := NamesLocalVariablesFunction(
>     Last( cat!.added_functions.InitialObject )[1] )[1];;
gap> (ValueOption( "no_precompiled_code" ) = true and argument_name = "cat") or
>     (ValueOption( "no_precompiled_code" ) = fail and argument_name = "cat_1");
true

15.2 Precompiling the category of finite reflexive quivers

gap> LoadPackage( "FunctorCategories", false );
true
gap> LoadPackage( "CompilerForCAP", ">= 2022.09-02", false );
true
gap> ReadPackageOnce( "FinSetsForCAP", "gap/CompilerLogic.gi" );
true
gap> ReadPackageOnce( "Algebroids", "gap/CompilerLogic.gi" );
true
gap> ReadPackageOnce( "FunctorCategories", "gap/CompilerLogic.gi" );
true
gap> category_constructor := { } -> CategoryOfReflexiveQuiversEnrichedOver( CategoryOfSkeletalFinSets( : FinalizeCategory := true ) );;
gap> given_arguments := [ ];;
gap> compiled_category_name := "FinReflexiveQuiversPrecompiled";;
gap> package_name := "FunctorCategories";;
gap> CapJitPrecompileCategoryAndCompareResult(
>     category_constructor,
>     given_arguments,
>     package_name,
>     compiled_category_name
>    : operations := [ "InitialObject",
>                      "Coproduct",
>                      #"InjectionOfCofactorOfCoproductWithGivenCoproduct",
>                      #"UniversalMorphismFromCoproductWithGivenCoproduct",
>                      #"CoproductOnMorphismsWithGivenCoproducts", # <- derived and leads to an error
>                      #"CoproductFunctorialWithGivenCoproducts", # <- derived
>                      "DistinguishedObjectOfHomomorphismStructure",
>                      "HomomorphismStructureOnObjects",
>                      #"HomomorphismStructureOnMorphismsWithGivenObjects",
>                      "InterpretMorphismFromDistinguishedObjectToHomomorphismStructureAsMorphism",
>                      "MorphismsOfExternalHom",
>                      ]
> );;
gap> FinReflexiveQuiversPrecompiled( );
CategoryOfReflexiveQuiversEnrichedOver( SkeletalFinSets )
gap> cat := CategoryOfReflexiveQuiversEnrichedOver( SkeletalFinSets );
CategoryOfReflexiveQuiversEnrichedOver( SkeletalFinSets )
gap> # Now we check whether the compiled code is loaded automatically.
> # For this we use the name of the argument of `InitialObject`;
gap> # for non-compiled code it is "cat", while for compiled code it is "cat_1":
> argument_name := NamesLocalVariablesFunction(
>     Last( cat!.added_functions.InitialObject )[1] )[1];;
gap> (ValueOption( "no_precompiled_code" ) = true and argument_name = "cat") or
>     (ValueOption( "no_precompiled_code" ) = fail and argument_name = "cat_1");
true
 [Top of Book]  [Contents]   [Previous Chapter]   [Next Chapter] 
Goto Chapter: Top 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Ind

generated by GAPDoc2HTML