Skip to content

Commit de50ee1

Browse files
committed
Fix bug reported in issue #109
1 parent 1760ba4 commit de50ee1

File tree

2 files changed

+82
-69
lines changed

2 files changed

+82
-69
lines changed

doc/chapter_proj_and_derived.xml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ injective).
3535
</Returns>
3636
<Description>A complex for which this property is true, will be
3737
printed in a different manner than ordinary complexes. Instead of
38-
writing the dimension vector of the objects in each degree, the
39-
indecomposable direct summands are listed (for
40-
instance <C>P1</C>, <C>P2</C> … , where <Math>P_i</Math> is the
41-
indecomposable projective module corresponding to
42-
vertex <Math>i</Math> of the quiver). Note that if a complex is both
43-
projective and injective, it is printed as a projective complex.
38+
writing the dimension vector of the objects in each degree, they are
39+
listed as <C>n1P1 + n2P2 + . . . + ntPt</C>, where <C>ni</C> is the
40+
number of copies of each indecomposable projective module
41+
<Math>P_i</Math> corresponding to vertex <Math>i</Math> of the
42+
quiver). Note that if a complex is both projective and injective, it
43+
is printed as a projective complex.
4444
</Description>
4545
</ManSection>
4646

@@ -56,12 +56,12 @@ injective).
5656
</Returns>
5757
<Description>A complex for which this property is true, will be
5858
printed in a different manner than ordinary complexes. Instead of
59-
writing the dimension vector of the objects in each degree, the
60-
indecomposable direct summands are listed (for
61-
instance <C>I1</C>, <C>I2</C> … , where <Math>I_i</Math> is the
62-
indecomposable injective module corresponding to
63-
vertex <Math>i</Math> of the quiver). Note that if a complex is both
64-
projective and injective, it is printed as a projective complex.
59+
writing the dimension vector of the objects in each degree, they are
60+
listed as <C>n1I1 + n2I2 + . . . + ntIt</C>, where <C>ni</C> is the
61+
number of copies of each indecomposable projective module
62+
<Math>I_i</Math> corresponding to vertex <Math>i</Math> of the
63+
quiver). Note that if a complex is both projective and injective, it
64+
is printed as a projective complex.
6565
</Description>
6666
</ManSection>
6767

lib/derivedcat.gi

Lines changed: 70 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ end);
6161
##
6262
## For a projective complex <C>
6363
## Prints a projective complex such that the objects
64-
## are displayed as "Pi" for the correct vertex i
64+
## are displayed as sums of "nPi" for a vertex i, where
65+
## "n" is the number of copies of the indecomposable
66+
## projective "Pi". If "n = 1", "n" is not printed.
6567
##
6668
## value 1: ensures that a complex which is both
6769
## projective and injective should be printed as projective.
@@ -71,7 +73,7 @@ InstallMethod( PrintObj,
7173
1,
7274
function( C )
7375

74-
local list, start, stop, l, t, symbol, finitetest, upperlimit, x;
76+
local finitetest, start, stop, symbol, list, l, new, t;
7577

7678
# check if C is finite or not
7779
if (IsInt(UpperBound(C))) then
@@ -87,28 +89,39 @@ InstallMethod( PrintObj,
8789
symbol := "P";
8890

8991
if finitetest then
90-
list := Reversed(DescriptionOfFiniteProjComplex(C));
92+
list := Reversed( DescriptionOfFiniteProjComplex( C ) );
9193
else
92-
list := [stop..start];
93-
list := Reversed(List( list, x ->
94-
DescriptionOfProjComplexInDegree(C,x) ));
94+
list := [ stop..start ];
95+
list := Reversed( List( list, x -> DescriptionOfProjComplexInDegree( C, x ) ) );
9596
fi;
9697

9798
# do the printing
98-
if (not finitetest) then
99+
if ( not finitetest ) then
99100
Print("--- ->");
100101
else
101102
Print("0 ->");
102103
fi;
103104
for l in list do
104-
if (not IsEmpty(l)) then
105+
if ( not IsEmpty( l ) ) then
105106
Print(" ",start,": ");
106-
for t in [1..Length(l)] do
107-
if (t = 1) then
108-
Print(symbol,l[t]);
107+
new := true;
108+
for t in [ 1..Length( l ) ] do
109+
if new = true and l[ t ] > 0 then
110+
if l[ t ] = 1 then
111+
Print( symbol, t );
109112
else
110-
Print(" + ",symbol,l[t]);
113+
Print( l[ t ], symbol, t );
114+
fi;
115+
new := false;
116+
else
117+
if l[ t ] > 0 then
118+
if l[ t ] = 1 then
119+
Print(" + ", symbol, t );
120+
else
121+
Print(" + ", l[ t ], symbol, t );
122+
fi;
111123
fi;
124+
fi;
112125
od;
113126
Print(" ->");
114127
start := start - 1;
@@ -124,7 +137,9 @@ end);
124137
##
125138
## For an injective complex <C>
126139
## Prints an injective complex such that the objects
127-
## are displayed as "Ii" for the correct vertex i
140+
## are displayed as sums of "nIi" for a vertex i, where
141+
## "n" is the number of copies of the indecomposable
142+
## injective "Ii". If "n = 1", "n" is not printed.
128143
##
129144
## value 0: ensures that a complex which is both
130145
## projective and injective should be printed as projective.
@@ -134,8 +149,9 @@ InstallMethod( PrintObj,
134149
0,
135150
function( C )
136151

137-
local list, start, stop, l, t, symbol, finitetest, upperlimit, x;
138-
# check if C is finite or not
152+
local finitetest, start, stop, symbol, list, l, new, t;
153+
154+
# check if C is finite or not
139155
if (IsInt(UpperBound(C))) then
140156
finitetest := true;
141157
start := UpperBound(C);
@@ -149,11 +165,10 @@ InstallMethod( PrintObj,
149165
symbol := "I";
150166

151167
if finitetest then
152-
list := Reversed(DescriptionOfFiniteInjComplex(C));
168+
list := Reversed( DescriptionOfFiniteInjComplex( C ) );
153169
else
154-
list := [stop..start];
155-
list := Reversed(List( list, x ->
156-
DescriptionOfInjComplexInDegree(C,x) ));
170+
list := [ stop..start ];
171+
list := Reversed( List( list, x -> DescriptionOfInjComplexInDegree( C, x ) ) );
157172
fi;
158173

159174
# do the printing
@@ -163,21 +178,32 @@ InstallMethod( PrintObj,
163178
Print("0 ->");
164179
fi;
165180
for l in list do
166-
if (not IsEmpty(l)) then
167-
Print(" ",start,": ");
168-
for t in [1..Length(l)] do
169-
if (t = 1) then
170-
Print(symbol,l[t]);
171-
else
172-
Print(" + ",symbol,l[t]);
173-
fi;
174-
od;
175-
Print(" ->");
176-
start := start - 1;
177-
fi;
181+
if ( not IsEmpty( l ) ) then
182+
Print(" ",start,": ");
183+
new := true;
184+
for t in [ 1..Length( l ) ] do
185+
if new = true and l[ t ] > 0 then
186+
if l[ t ] = 1 then
187+
Print( symbol, t );
188+
else
189+
Print( l[ t ], symbol, t );
190+
fi;
191+
new := false;
192+
else
193+
if l[ t ] > 0 then
194+
if l[ t ] = 1 then
195+
Print(" + ", symbol, t );
196+
else
197+
Print(" + ", l[ t ], symbol, t );
198+
fi;
199+
fi;
200+
fi;
201+
od;
202+
Print(" ->");
203+
start := start - 1;
204+
fi;
178205
od;
179206
Print(" 0");
180-
181207
end);
182208

183209

@@ -936,28 +962,15 @@ InstallMethod( DescriptionOfProjOrInjComplexInDegree,
936962
function( C, i, test )
937963
local obj,comp, list, incls, incl;
938964

939-
obj := ObjectOfComplex(C, i);
965+
obj := ObjectOfComplex( C, i );
940966

967+
if IsZero( obj ) then
968+
return [];
969+
fi;
941970
if test then
942-
return DescriptionOfProjectiveModule(obj);
971+
return DimensionVector( TopOfModule( obj ) );
943972
else
944-
list := [];
945-
946-
if IsZero(DimensionVector(obj)) then
947-
return list;
948-
fi;
949-
950-
if(not IsDirectSumOfModules(obj)) then
951-
comp := CompareWithIndecInjective(obj);
952-
Append(list, [comp]);
953-
else
954-
incls := DirectSumInclusions(obj);
955-
for incl in incls do
956-
comp := CompareWithIndecInjective(Source(incl));
957-
Append(list, [comp]);
958-
od;
959-
fi;
960-
return list;
973+
return DimensionVector( SocleOfModule( obj ) );
961974
fi;
962975
end);
963976

@@ -1016,17 +1029,17 @@ InstallMethod( DescriptionOfFiniteProjOrInjComplex,
10161029

10171030
local i,obj,comp, incls, incl, list, templist, start, stop;
10181031

1019-
start := LowerBound(C);
1020-
stop := UpperBound(C);
1032+
start := LowerBound( C );
1033+
stop := UpperBound( C );
10211034
list := [];
10221035

1023-
if(not(IsInt(UpperBound(C)))) then
1036+
if ( not( IsInt( UpperBound( C ) ) ) ) then
10241037
Error("complex entered is not finite!");
10251038
fi;
10261039

1027-
for i in [start..stop] do
1028-
templist := DescriptionOfProjOrInjComplexInDegree(C, i, test);
1029-
Append(list, [templist]);
1040+
for i in [ start..stop ] do
1041+
templist := DescriptionOfProjOrInjComplexInDegree( C, i, test );
1042+
Append( list, [ templist ] );
10301043
od;
10311044

10321045
return list;

0 commit comments

Comments
 (0)