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 29, 2024
1 parent 5604ca4 commit afcfb54
Show file tree
Hide file tree
Showing 2 changed files with 16 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
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" );

Check warning on line 1728 in FreydCategoriesForCAP/gap/AdditiveClosure.gi

View check run for this annotation

Codecov / codecov/patch

FreydCategoriesForCAP/gap/AdditiveClosure.gi#L1728

Added line #L1728 was not covered by tests

for obj in object_list do

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

Check warning on line 1732 in FreydCategoriesForCAP/gap/AdditiveClosure.gi

View check run for this annotation

Codecov / codecov/patch

FreydCategoriesForCAP/gap/AdditiveClosure.gi#L1732

Added line #L1732 was not covered by tests

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

Check warning on line 1734 in FreydCategoriesForCAP/gap/AdditiveClosure.gi

View check run for this annotation

Codecov / codecov/patch

FreydCategoriesForCAP/gap/AdditiveClosure.gi#L1734

Added line #L1734 was not covered by tests

od;

return string;

Check warning on line 1738 in FreydCategoriesForCAP/gap/AdditiveClosure.gi

View check run for this annotation

Codecov / codecov/patch

FreydCategoriesForCAP/gap/AdditiveClosure.gi#L1738

Added line #L1738 was not covered by tests

end );

#= comment for Julia
Expand Down

0 comments on commit afcfb54

Please sign in to comment.