[previous][up][top][index]
search for:

VisibleList _ {...} -- get some entries of a list

Synopsis:

  • Usage: v = w_{i,j,...}
  • Operator: _
  • Input:
  • w, an instance of class VisibleList: a list
  • {i,j,...}, an instance of class List: the list of subscripts
  • Output:
  • an instance of class VisibleList: .
  • i1 : w = {a,b,c,d,e,f,g,h};
    i2 : w_{1,3,4}

    o2 = {b, d, e}

    o2 : List

    We can use this operation to compute composition of permutations represented as lists.

    i3 : {4,2,3,1,0} _ {2,1,3,4,0}

    o3 = {3, 2, 1, 0, 4}

    o3 : List

    Remark: any subscripts which are sequences will have their elements spliced into the rest of the list.

    i4 : {a,b,c,d,e}_{2..4}

    o4 = {c, d, e}

    o4 : List

    Code:

         -- ../../../Macaulay2/m2/lists.m2:17
         VisibleList _ List := VisibleList => (x,y) -> apply(splice y, i -> x#i)

    [previous][up][top][index]
    search for: