[top][index]
search for:

length GradedModule -- length of a graded module

Synopsis:

  • Function: length -- length
  • Input:
  • an instance of class GradedModule.
  • Output:
  • an instance of class ZZ.
  • 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

          1      3      3      1
    o2 = R  <-- R  <-- R  <-- R  <-- 0
                                      
         0      1      2      3      4

    o2 : ChainComplex
    i3 : length C

    o3 = 3

    Code:

         -- ../../../Macaulay2/m2/gradedmodules.m2:22-24
         length GradedModule := (M) -> (
              s := spots M;
              if #s === 0 then 0 else max s - min s)

    [top][index]
    search for: