Synopsis:
The length of a graded module is the difference between the largest and smallest indices of occupied spots. Chain complexes are graded modules, so this function applies to them, too.
i1 : R = QQ[x..z]; |
i2 : C = res coker vars R |
i3 : length C |
Code:
-- ../../../Macaulay2/m2/gradedmodules.m2:22-24 length GradedModule := (M) -> ( s := spots M; if #s === 0 then 0 else max s - min s)