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

Matrix _ {...} -- get some columns from a matrix

Synopsis:

  • Operator: _
  • Input:
  • an instance of class Matrix.
  • an instance of class List.
  • Output:
  • an instance of class Matrix.
  • f_{i,j,k,...} -- produce the submatrix of a matrix f consisting of columns numbered i, j, k, ... .

    Repetitions of the indices are allowed.

    If the list of column indices is a permutation of 0 .. n-1, where n is the number of columns, then the result is the corresponding permutation of the columns of f.

    i1 : R = ZZ/101[a..f];

    i2 : p = matrix {{a,b,c},{d,e,f}}

    o2 = | a b c |
         | d e f |

                 2       3
    o2 : Matrix R  <--- R
    i3 : p_{1}

    o3 = | b |
         | e |

                 2       1
    o3 : Matrix R  <--- R
    i4 : p_{1,1,2}

    o4 = | b b c |
         | e e f |

                 2       3
    o4 : Matrix R  <--- R
    i5 : p_{2,1,0}

    o5 = | c b a |
         | f e d |

                 2       3
    o5 : Matrix R  <--- R

    See also:

  • _
  • Code:

         -- ../../../Macaulay2/m2/matrix.m2:404-408
         Matrix _ List := Matrix => (f,v) -> (
              v = splice v;
              listZ v;
              submatrix(f,v)
              )

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