Skip to content

Commit

Permalink
Revert "fixed directSum so X^1 doesn't clear the cache"
Browse files Browse the repository at this point in the history
This reverts commit a029b77.
  • Loading branch information
mahrud committed Jan 13, 2024
1 parent a029b77 commit b8f464b
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 20 deletions.
1 change: 0 additions & 1 deletion M2/Macaulay2/m2/chaincomplexes.m2
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,6 @@ formation ChainComplex := M -> if M.cache.?formation then M.cache.formation

directSum ChainComplex := C -> directSum(1 : C)
ChainComplex.directSum = args -> (
if #args === 1 then return args#0;
C := new ChainComplex;
C.ring = ring args#0;
scan(args,D -> (complete D; complete D.dd;));
Expand Down
1 change: 0 additions & 1 deletion M2/Macaulay2/m2/gradedmodules.m2
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ formation GradedModule := M -> if M.cache.?formation then M.cache.formation

directSum GradedModule := GradedModule => M -> directSum(1 : M)
GradedModule.directSum = v -> (
if #v === 1 then return v#0;
E := new GradedModule;
rings := apply(v, ring);
if not same rings
Expand Down
5 changes: 1 addition & 4 deletions M2/Macaulay2/m2/matrix.m2
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ sameringMatrices = mats -> (

directSum Matrix := f -> Matrix.directSum (1 : f)
Matrix.directSum = args -> (
if #args === 1 then return args#0;
args = sameringMatrices args;
R := ring args#0;
if not all(args, f -> ring f === R) then error "expected matrices all over the same ring";
Expand All @@ -293,9 +292,7 @@ Module.directSum = args -> (
R := ring args#0;
if not all(args, f -> ring f === R)
then error "expected modules all over the same ring";
-- this ensures that trivial direct sums don't clear the cache
N := if #args == 1 then args#0
else if all(args, M -> not M.?generators)
N := if all(args, M -> not M.?generators)
then (
if all(args, M -> not M.?relations)
then R ^ (- join toSequence apply(args, degrees))
Expand Down
1 change: 0 additions & 1 deletion M2/Macaulay2/packages/Complexes/ChainComplex.m2
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,6 @@ sum ComplexMap := Matrix => f -> (

Complex.directSum = args -> (
assert(#args > 0);
if #args === 1 then return args#0;
R := ring args#0;
if not all(args, C -> ring C === R) then error "expected all complexes to be over the same ring";
concentrations := for C in args list C.concentration;
Expand Down
1 change: 0 additions & 1 deletion M2/Macaulay2/packages/Complexes/ChainComplexMap.m2
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,6 @@ ComplexMap.directSum = args -> (
-- args: sequence of ComplexMap's
-- args: f_i : C_i --> D_i, having same degree deg
-- result : sum(C_i) --> sum(D_i)
if #args === 1 then return args#0;
R := ring args#0;
deg := degree args#0;
if not all(args, f -> ring f === R) then
Expand Down
1 change: 0 additions & 1 deletion M2/Macaulay2/packages/Varieties/SheafMaps.m2
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ inducedMap(CoherentSheaf, CoherentSheaf) := SheafMap => opts -> (G, F) -> map(G,
--WARNING: the current direct sum of sheaves does not cache components
SheafMap.directSum = args -> (
assert(#args>0);
if #args === 1 then return args#0;
X := variety args#0;
if not same apply(args, variety) then error "expected maps of sheaves over the same variety";
DS := map(
Expand Down
11 changes: 0 additions & 11 deletions M2/Macaulay2/packages/Varieties/tests.m2
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,6 @@ TEST /// -- twisted global section module
assert(module Omega(1) === coker matrix(ring Cubic, {{-x_3, -x_2, -x_1}, {x_2, x_1, x_0}}))
///

TEST ///
S = QQ[a..d];
I = monomialCurveIdeal(S,{1,3,4})
R = S/I
X = Proj R
F = prune sheaf (module I ** R)
assert F.cache.?pruningMap
-- making sure that trivial direct sums don't clear cache
assert(F^1).cache.?pruningMap
///

end

-- multigraded Proj
Expand Down

0 comments on commit b8f464b

Please sign in to comment.