[top][index]
search for:

length ChainComplex -- length of a chain complex or graded module

Synopsis:

  • Function: length -- length
  • Input:
  • an instance of class ChainComplex.
  • Output:
  • an instance of class ZZ.
  • length C -- the length of a chain complex.

    The length of a chain complex is defined to be the difference between the smallest and largest indices of spots occupied by modules, even if those modules happen to be zero.

    Code:

         -- ../../../Macaulay2/m2/chaincomplexes.m2:44-47
         length ChainComplex := (C) -> (
              s := select(spots complete C, i -> C_i != 0);
              if #s === 0 then 0 else max s - min s
              )

    [top][index]
    search for: