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

15 Tests
 15.1 GAP categories

15 Tests

15.1 GAP categories

15.1-1 Precompilation
gap> LoadPackage( "Locales", false );
true
gap> LoadPackage( "SubcategoriesForCAP", false );
true
gap> LoadPackage( "FreydCategoriesForCAP", ">= 2024.08-07", 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",
>     )
> );
gap> # matrix * HomalgIdentityMatrix( size, ring ) -> matrix
> CapJitAddLogicTemplate(
>     rec(
>         variable_names := [ "size", "ring", "matrix" ],
>         src_template := "matrix * HomalgIdentityMatrix( size, ring )",
>         dst_template := "matrix",
>     )
> );
gap> # KroneckerMat( matrix, HomalgIdentityMatrix( 1, ring ) ) -> matrix
> CapJitAddLogicTemplate(
>     rec(
>         variable_names := [ "ring", "matrix" ],
>         src_template := "KroneckerMat( matrix, HomalgIdentityMatrix( 1, ring ) )",
>         dst_template := "matrix",
>     )
> );
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 )",
>     )
> );
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 ) )",
>     )
> );
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 14 15 16 Ind

generated by GAPDoc2HTML