Skip to content

Commit

Permalink
RingMapOntoRewrittenResidueClassRing avoids creating a new ring if no…
Browse files Browse the repository at this point in the history
…t necessary
  • Loading branch information
mohamed-barakat committed May 10, 2019
1 parent 0818f01 commit 0c7bcbc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion MatricesForHomalg/PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PackageName := "MatricesForHomalg",
Subtitle := "Matrices for the homalg project",

Version := Maximum( [
"2019.02.10", ## Mohamed's version
"2019.02.13", ## Mohamed's version
## this line prevents merge conflicts
"2019.02.11", ## Fabian's version
## this line prevents merge conflicts
Expand Down
10 changes: 7 additions & 3 deletions MatricesForHomalg/gap/Tools.gi
Original file line number Diff line number Diff line change
Expand Up @@ -7269,9 +7269,13 @@ InstallMethod( RingMapOntoRewrittenResidueClassRing,

zero_rows := ZeroRows( matrix - images );

indets := indets{zero_rows};

S := k * List( indets, String );
if Length( indets ) = Length( zero_rows ) and
IsIdenticalObj( k, CoefficientsRing( A ) ) then
S := A;
else
indets := indets{zero_rows};
S := k * List( indets, String );
fi;

if not zero_rows = [ ] then
map := RingMap( indets, S, R );
Expand Down

0 comments on commit 0c7bcbc

Please sign in to comment.