Skip to content

Commit

Permalink
converted Display -> DisplayString for AdditiveClosure
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamed-barakat committed Oct 30, 2024
1 parent a11065f commit 0ff862d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
2 changes: 1 addition & 1 deletion FreydCategoriesForCAP/PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SetPackageInfo( rec(

PackageName := "FreydCategoriesForCAP",
Subtitle := "Freyd categories - Formal (co)kernels for additive categories",
Version := "2024.10-02",
Version := "2024.10-03",
Date := (function ( ) if IsBound( GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE ) then return GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE; else return Concatenation( ~.Version{[ 1 .. 4 ]}, "-", ~.Version{[ 6, 7 ]}, "-01" ); fi; end)( ),
License := "GPL-2.0-or-later",

Expand Down
6 changes: 6 additions & 0 deletions FreydCategoriesForCAP/examples/AdditiveClosureKronecker.g
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,10 @@ Display( T );
#! [1,2]: <4>
#! [1,3]: <6>
#! [1,4]: <8>
Display( Range( T ) );
#! A formal direct sum consisting of 4 objects.
#! *
#! *
#! *
#! *
#! @EndExample
26 changes: 15 additions & 11 deletions FreydCategoriesForCAP/gap/AdditiveClosure.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1686,53 +1686,57 @@ InstallMethod( ViewString,
end );

##
InstallMethod( Display,
InstallMethod( DisplayString,
[ IsAdditiveClosureMorphism ],

function( morphism )
local nr_rows, nr_cols, i, j;
local nr_rows, nr_cols, string, i, j;

nr_rows := NrRows( morphism );

nr_cols := NrCols( morphism );

Print( Concatenation( "A ", String( nr_rows ), " x ", String( nr_cols ), " matrix with entries in ", Name( UnderlyingCategory( CapCategory( morphism ) ) ), "\n" ) );
string := Concatenation( "A ", String( nr_rows ), " x ", String( nr_cols ), " matrix with entries in ", Name( UnderlyingCategory( CapCategory( morphism ) ) ), "\n" );

for i in [ 1 .. nr_rows ] do

for j in [ 1 .. nr_cols ] do

Print( Concatenation( "\n[", String(i), ",", String(j), "]: " ) );
string := Concatenation( string, Concatenation( "\n[", String(i), ",", String(j), "]: " ) );

ViewObj( morphism[i, j] );
string := Concatenation( string, ViewString( morphism[i, j] ) );

od;

od;

Print( "\n" );
string := Concatenation( string, "\n" );

return string;

end );

##
InstallMethod( Display,
InstallMethod( DisplayString,
[ IsAdditiveClosureObject ],

function( object )
local object_list, obj;
local object_list, string, obj;

object_list := ObjectList( object );

Print( Concatenation( "A formal direct sum consisting of ", String( Length( object_list ) ), " objects.\n" ) );
string := Concatenation( "A formal direct sum consisting of ", String( Length( object_list ) ), " objects.\n" );

for obj in object_list do

ViewObj( obj );
string := Concatenation( string, ViewString( obj ) );

Print( "\n" );
string := Concatenation( string, "\n" );

od;

return string;

end );

#= comment for Julia
Expand Down

0 comments on commit 0ff862d

Please sign in to comment.