Skip to content

Commit f4ef01e

Browse files
implemented faster ClassifyingMorphismOfSubobjectWithGivenSubobjectClassifier
1 parent 37477a2 commit f4ef01e

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

PackageInfo.g

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SetPackageInfo( rec(
1010

1111
PackageName := "FinSetsForCAP",
1212
Subtitle := "The elementary topos of (skeletal) finite sets",
13-
Version := "2020.11-11",
13+
Version := "2020.11-12",
1414

1515
Date := Concatenation( "01/", ~.Version{[ 6, 7 ]}, "/", ~.Version{[ 1 .. 4 ]} ),
1616
License := "GPL-2.0-or-later",

gap/FinSetsForCAP.gi

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,21 +1004,24 @@ end );
10041004

10051005
##
10061006
AddClassifyingMorphismOfSubobjectWithGivenSubobjectClassifier( category_of_finite_sets,
1007-
function ( category_of_finite_sets, monomorphism, omega )
1008-
local range, image, r, x;
1009-
1010-
r := [ ];
1011-
range := Range( monomorphism );
1012-
1013-
for x in range do
1014-
if x in ImageObject( monomorphism ) then
1015-
Add( r, [ x, "true" ] );
1016-
else
1017-
Add( r, [ x, "false" ] );
1018-
fi;
1019-
od;
1020-
1021-
return MapOfFinSets( range, r, omega );
1007+
function ( category_of_finite_sets, monomorphism, Omega )
1008+
local range, images;
1009+
1010+
range := Range( monomorphism );
1011+
1012+
images := List( range,
1013+
function ( x )
1014+
1015+
if x in ImageObject( monomorphism ) then
1016+
return [ x, "true" ];
1017+
fi;
1018+
1019+
return [ x, "false" ];
1020+
1021+
end );
1022+
1023+
return MapOfFinSets( range, images, Omega );
1024+
10221025
end );
10231026

10241027
end );

0 commit comments

Comments
 (0)