Skip to content

Commit

Permalink
CapJitAddTypeSignature( "LazyArray", [ IsInt, IsFunction ], ... )
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamed-barakat committed Sep 6, 2022
1 parent 9290d59 commit ff06318
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CompilerForCAP/PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SetPackageInfo( rec(

PackageName := "CompilerForCAP",
Subtitle := "Speed up computations in CAP categories",
Version := "2022.09-03",
Version := "2022.09-04",
Date := Concatenation( "01/", ~.Version{[ 6, 7 ]}, "/", ~.Version{[ 1 .. 4 ]} ),
License := "GPL-2.0-or-later",

Expand Down
47 changes: 45 additions & 2 deletions CompilerForCAP/gap/InferDataTypes.gi
Original file line number Diff line number Diff line change
Expand Up @@ -919,10 +919,17 @@ CapJitAddTypeSignature( "ListWithIdenticalEntries", [ IsInt, IsObject ], functio
end );

CapJitAddTypeSignature( "Concatenation", [ IsList ], function ( input_types )
local filter;

Assert( 0, input_types[1].element_type.filter = IsList );
if input_types[1].element_type.filter = IsList then
filter := IsList;
elif input_types[1].element_type.filter = IsLazyArray then
filter := IsLazyArray;
else
Error( input_types[1].element_type.filter, " is not in [ IsList, IsLazyArray ]\n" );
fi;

return rec( filter := IsList, element_type := input_types[1].element_type.element_type );
return rec( filter := filter, element_type := input_types[1].element_type.element_type );

end );

Expand Down Expand Up @@ -1101,6 +1108,42 @@ CapJitAddTypeSignature( "MatElm", [ IsList, IsInt, IsInt ], function ( input_typ

end );

CapJitAddTypeSignature( "LazyArray", [ IsInt, IsFunction ], function ( input_types )

return rec( filter := IsLazyArray, element_type := rec( filter := IsInt ) );

end );

CapJitAddTypeSignature( "LazyStandardInterval", [ IsInt ], function ( input_types )

return rec( filter := IsLazyArray, element_type := rec( filter := IsInt ) );

end );

CapJitAddTypeSignature( "LazyInterval", [ IsInt, IsInt ], function ( input_types )

return rec( filter := IsLazyInterval, element_type := rec( filter := IsInt ) );

end );

CapJitAddTypeSignature( "LazyConstantArray", [ IsInt, IsInt ], function ( input_types )

return rec( filter := IsLazyConstantArray, element_type := rec( filter := IsInt ) );

end );

CapJitAddTypeSignature( "LazyArrayFromList", [ IsList ], function ( input_types )

return rec( filter := IsLazyArrayFromList, element_type := rec( filter := IsInt ) );

end );

CapJitAddTypeSignature( "ListOfValues", [ IsLazyArray ], function ( input_types )

return rec( filter := IsList, element_type := rec( filter := IsInt ) );

end );

CapJitAddTypeSignature( "LazyHList", [ IsList, IsFunction ], function ( args, func_stack )

args := ShallowCopy( args );
Expand Down

0 comments on commit ff06318

Please sign in to comment.