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

12 Tests
 12.1 GAP Categories

12 Tests

12.1 GAP Categories

12.1-1 Precompilation
gap> LoadPackage( "Locales", false );
true
gap> LoadPackage( "SubcategoriesForCAP", false );
true
gap> LoadPackage( "FreydCategoriesForCAP", ">= 2021.10-03", false );
true
gap> ZZ := HomalgRingOfIntegers( );;
gap> # HomalgIdentityMatrix( size, ring ) * matrix -> matrix
> CapJitAddLogicTemplate(
>     rec(
>         variable_names := [ "size", "ring", "matrix" ],
>         src_template := "HomalgIdentityMatrix( size, ring ) * matrix",
>         dst_template := "matrix",
>         needed_packages := [ [ "MatricesForHomalg", ">= 2020.05.19" ] ],
>     )
> );
gap> # matrix * HomalgIdentityMatrix( size, ring ) -> matrix
> CapJitAddLogicTemplate(
>     rec(
>         variable_names := [ "size", "ring", "matrix" ],
>         src_template := "matrix * HomalgIdentityMatrix( size, ring )",
>         dst_template := "matrix",
>         needed_packages := [ [ "MatricesForHomalg", ">= 2020.05.19" ] ],
>     )
> );
gap> # KroneckerMat( matrix, HomalgIdentityMatrix( 1, ring ) ) -> matrix
> CapJitAddLogicTemplate(
>     rec(
>         variable_names := [ "ring", "matrix" ],
>         src_template := "KroneckerMat( matrix, HomalgIdentityMatrix( 1, ring ) )",
>         dst_template := "matrix",
>         needed_packages := [ [ "MatricesForHomalg", ">= 2020.05.19" ] ],
>     )
> );
gap> # TransposedMatrix( HomalgIdentityMatrix( size, ring ) ) -> HomalgIdentityMatrix( size, ring )
> CapJitAddLogicTemplate(
>     rec(
>         variable_names := [ "size", "ring" ],
>         src_template := "TransposedMatrix( HomalgIdentityMatrix( size, ring ) )",
>         dst_template := "HomalgIdentityMatrix( size, ring )",
>         needed_packages := [ [ "MatricesForHomalg", ">= 2020.05.19" ] ],
>     )
> );
gap> # KroneckerMat( HomalgIdentityMatrix( size, ring ), matrix )
> CapJitAddLogicTemplate(
>     rec(
>         variable_names := [ "size", "ring", "matrix" ],
>         src_template := "KroneckerMat( HomalgIdentityMatrix( size, ring ), matrix )",
>         dst_template := "DiagMat( ring, ListWithIdenticalEntries( size, matrix ) )",
>         needed_packages := [ [ "MatricesForHomalg", ">= 2020.05.19" ] ],
>     )
> );
gap> # we have to work hard to not write semicolons so AutoDoc
> # does not begin a new statement
> category_constructor := EvalString( ReplacedString( """function( R )
>   local F, S, P, L@
>     
>     F := CategoryOfRows( R : FinalizeCategory := true )@
>     S := SliceCategoryOverTensorUnit( F : FinalizeCategory := true )@
>     P := PosetOfCategory( S : FinalizeCategory := true )@
>     L := StablePosetOfCategory( P )@
>     
>     return L@
>     
> end""", "@", ";" ) );;
gap> given_arguments := [ ZZ ];;
gap> compiled_category_name := "StablePosetOfCategoryOfPosetOfCategoryOfSliceCategoryOverTensorUnitOfCategoryOfRowsOfCommutativeRingPrecompiled";;
gap> package_name := "Locales";;
gap> CapJitPrecompileCategoryAndCompareResult(
>     category_constructor,
>     given_arguments,
>     package_name,
>     compiled_category_name :
>     operations := [ "ExponentialOnObjects" ],
>     number_of_objectified_objects_in_data_structure_of_object := 5,
>     number_of_objectified_morphisms_in_data_structure_of_object := 1
> );;
 [Top of Book]  [Contents]   [Previous Chapter]   [Next Chapter] 
Goto Chapter: Top 1 2 3 4 5 6 7 8 9 10 11 12 13 Ind

generated by GAPDoc2HTML