Skip to content

Commit 798c9fb

Browse files
simplified CartesianEvaluationMorphismWithGivenSource
for SkeletalFinSets
1 parent 0099b00 commit 798c9fb

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

gap/SkeletalFinSetsForCAP.gi

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -802,12 +802,13 @@ end );
802802
##
803803
AddCartesianBraidingInverseWithGivenDirectProducts( SkeletalFinSets,
804804
function ( cat, MN, M, N, NM )
805-
local m, n;
805+
local n, mn;
806806

807-
m := Length( M );
808807
n := Length( N );
809808

810-
return MapOfFinSets( MN, List( AsList( MN ), k -> ( k-1 ) mod n * m + Int( ( k-1 ) / n ) + 1 ), NM );
809+
mn := Length( MN );
810+
811+
return MapOfFinSets( MN, List( [ 0 .. mn - 1 ] , i -> 1 + ( i mod mn ) + QuoInt( i, n ) ), NM );
811812

812813
end );
813814

gap/precompiled_categories/CategoryOfSkeletalFinSetsPrecompiled.gi

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@ BindGlobal( "ADD_FUNCTIONS_FOR_CategoryOfSkeletalFinSetsPrecompiled", function (
1010

1111
########
1212
function ( cat_1, s_1, a_1, b_1, r_1 )
13-
local hoisted_1_1, hoisted_2_1;
14-
hoisted_2_1 := Length( a_1 );
15-
hoisted_1_1 := Length( b_1 );
16-
return MapOfFinSets( s_1, List( AsList( s_1 ), function ( k_2 )
17-
local deduped_1_2;
18-
deduped_1_2 := k_2 - 1;
19-
return deduped_1_2 mod hoisted_1_1 * hoisted_2_1 + Int( deduped_1_2 / hoisted_1_1 ) + 1;
13+
local hoisted_1_1, hoisted_2_1, deduped_3_1;
14+
deduped_3_1 := Length( s_1 );
15+
hoisted_2_1 := Length( b_1 );
16+
hoisted_1_1 := deduped_3_1;
17+
return MapOfFinSets( s_1, List( [ 0 .. deduped_3_1 - 1 ], function ( i_2 )
18+
return 1 + i_2 mod hoisted_1_1 + QUO_INT( i_2, hoisted_2_1 );
2019
end ), r_1 );
2120
end
2221
########

0 commit comments

Comments
 (0)