Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caching does not deal with lists of lists correctly #379

Open
zickgraf opened this issue Oct 22, 2020 · 1 comment
Open

Caching does not deal with lists of lists correctly #379

zickgraf opened this issue Oct 22, 2020 · 1 comment

Comments

@zickgraf
Copy link
Member

zickgraf commented Oct 22, 2020

The inner lists might get garbage collected. Hence, despite crisp caching, MorphismBetweenDirectSums is computed twice in the following example:

LoadPackage( "CAP" );

cat := CreateCapCategory( );

SetCachingOfCategoryCrisp( cat );

myobj := SymmetricGroup( 3 );
AddObject( cat, myobj );
mymor := GroupHomomorphismByImages( myobj, myobj );
AddMorphism( cat, mymor );

AddDirectSum( cat, function( l )
    
    Display( "DirectSum" );
    
    return myobj;
    
end );

AddMorphismBetweenDirectSums( cat, function( s, l, r )
    
    Display( "MorphismBetweenDirectSums" );
    
    return mymor;
    
end );

Finalize( cat );

result := MorphismBetweenDirectSums( [ [ mymor ] ] );
GASMAN("collect");
MorphismBetweenDirectSums( [ [ mymor ] ] );
@mohamed-barakat
Copy link
Member

Impressive 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants