@@ -293,7 +293,11 @@ InstallGlobalFunction( "CapJitPrecompileCategory", function ( category_construct
293
293
294
294
if ValueOption( " operations" ) = fail then
295
295
296
- operations := Intersection( ListInstalledOperationsOfCategory( cat ) );
296
+ operations := ListInstalledOperationsOfCategory( cat );
297
+
298
+ elif ValueOption( " operations" ) = " primitive" then
299
+
300
+ operations := ListPrimitivelyInstalledOperationsOfCategory( cat );
297
301
298
302
else
299
303
@@ -479,6 +483,12 @@ InstallGlobalFunction( "CapJitPrecompileCategory", function ( category_construct
479
483
od ;
480
484
481
485
current_string := Concatenation(
486
+ " \n " ,
487
+ " if ValueOption( \" FinalizeCategory\" ) = false then\n " ,
488
+ " \n " ,
489
+ " return cat;\n " ,
490
+ " \n " ,
491
+ " fi;\n " ,
482
492
" \n " ,
483
493
" Finalize( cat );\n " ,
484
494
" \n " ,
@@ -491,3 +501,45 @@ InstallGlobalFunction( "CapJitPrecompileCategory", function ( category_construct
491
501
WriteFileInPackageForHomalg( package_name, Concatenation( " precompiled_categories/" , compiled_category_name, " .gi" ), output_string );
492
502
493
503
end );
504
+
505
+ InstallGlobalFunction( " CapJitPrecompileCategoryAndCompareResult" , function ( category_constructor, given_arguments, package_name, compiled_category_name )
506
+ local filepath, dirs, complete_path, old_file_content, new_file_content;
507
+
508
+ filepath := Concatenation( " precompiled_categories/" , compiled_category_name, " .gi" );
509
+
510
+ dirs := DirectoriesPackageLibrary( package_name, " gap" );
511
+
512
+ if Length( dirs ) <> 1 then
513
+
514
+ Error( Concatenation( " could not find gap directory of package " , package_name ) );
515
+
516
+ fi ;
517
+
518
+ complete_path := Filename( dirs[ 1 ] , filepath );
519
+
520
+ if IsExistingFile( complete_path ) then
521
+
522
+ old_file_content := ReadFileFromPackageForHomalg( package_name, filepath );
523
+
524
+ else
525
+
526
+ old_file_content := " " ;
527
+
528
+ fi ;
529
+
530
+ CapJitPrecompileCategory(
531
+ category_constructor,
532
+ given_arguments,
533
+ package_name,
534
+ compiled_category_name
535
+ );
536
+
537
+ new_file_content := ReadFileFromPackageForHomalg( package_name, filepath );
538
+
539
+ if old_file_content <> new_file_content then
540
+
541
+ Display( " WARNING: old and new file contents differ" );
542
+
543
+ fi ;
544
+
545
+ end );
0 commit comments