Macaulay2 » Documentation
Packages » submatrix > submatrix'
next | previous | forward | backward | up | index | toc

submatrix' -- exclude rows and/or columns of a matrix

Synopsis

Description

Each list of integers may contain ranges and repetitions, as in {3, 5..7, 3:0}. Excluding a row or column more than once is allowed but has no extra effect.

i1 : R = ZZ/101[a .. o];
i2 : f = genericMatrix(R, a, 3, 5)

o2 = | a d g j m |
     | b e h k n |
     | c f i l o |

             3      5
o2 : Matrix R  <-- R
i3 : submatrix'(f, {1}, {2})

o3 = | a d j m |
     | c f l o |

             2      4
o3 : Matrix R  <-- R
i4 : submatrix'(f, {1}, {2,3,3,2,2})

o4 = | a d m |
     | c f o |

             2      3
o4 : Matrix R  <-- R

i5 : submatrix'(f, {1,3}, )

o5 = | a d g j m |
     | c f i l o |

             2      5
o5 : Matrix R  <-- R
i6 : submatrix'(f, , {1,3} )

o6 = | a g m |
     | b h n |
     | c i o |

             3      3
o6 : Matrix R  <-- R
i7 : submatrix'(f, {1,3} )

o7 = | a g m |
     | b h n |
     | c i o |

             3      3
o7 : Matrix R  <-- R

See also

Ways to use submatrix' :

For the programmer

The object submatrix' is a method function.