#11528: Allow deleting row or column from matrix
----------------------------------+-----------------------------------------
Reporter: kcrisman | Owner: jason, was
Type: enhancement | Status: needs_work
Priority: minor | Milestone: sage-5.0
Component: linear algebra | Resolution:
Keywords: delete remove | Work issues:
Report Upstream: N/A | Reviewers: Rob Beezer
Authors: Wai Yan Pong | Merged in:
Dependencies: | Stopgaps:
----------------------------------+-----------------------------------------
Changes (by rbeezer):
* priority: major => minor
* status: needs_review => needs_work
Old description:
> This was requested in the 2011 Sage MAA PREP workshop. Names deleted.
> {{{
> : Is there any way to delete specified rows or columns from an existing
> matrix?
> : Hmm, I think that is possible, using a method.
> : I'll look.
> : - we can swap rows, scale rows, add mults of rows, create a matrix
> from specified rows... but not that.
> : Would you find this useful? Is it in Matlab?
> : For list there is a method called pop
> : Right, but not for matrices.
> : if matrix is a list of list...
> : But it's not quite that.
> : I'l make a ticket.
> : this would be useful
> : there is an m.insert_row
> : Hah! But we can't do it backwards
> }}}
> So let's make this happen.
New description:
This was requested in the 2011 Sage MAA PREP workshop. Names deleted.
{{{
: Is there any way to delete specified rows or columns from an existing
matrix?
: Hmm, I think that is possible, using a method.
: I'll look.
: - we can swap rows, scale rows, add mults of rows, create a matrix from
specified rows... but not that.
: Would you find this useful? Is it in Matlab?
: For list there is a method called pop
: Right, but not for matrices.
: if matrix is a list of list...
: But it's not quite that.
: I'l make a ticket.
: this would be useful
: there is an m.insert_row
: Hah! But we can't do it backwards
}}}
So let's make this happen.
'''Apply''':
1. [attachment:trac_11528_delete_rows_and_columns.path.patch]
1. [attachment:trac_11528_matrix_delete_rows_and_columns.patch]
--
Comment:
Dear Pong,
Making good progress. A few small things to work on. Third patch could
be a charm. ;-) You are getting an education, anyway. My time is a
whole lot freer now, so it should not take me 5 weeks to swoop in and
finish this one off. Keep at it - almost there.
Rob
1. Code uses just `check=` (good) but documentation still has
`index_check=`, both in the INPUT block and in an example.
1. An example in `delete_rows` is not formatting right, likely missing
a double-color before it begins. You should preview your documentation
for gross errors before submitting it for review.
{{{
sage -docbuild reference html
}}}
will build the HTML version that you can check in a web browser.
1. The `:meth:` construction should not have a space before the method
name. The effect should be a working link to referenced method, which you
can test in the HTML documentation.
1. I'd format `True` just like `dcols`, it is literal code.
1. Warnings are rarely used in Sage when an error is more appropriate.
{{{
if not (diff_cols == []):
warnings.warn("{d} contains invalid indices.".format(d=diff_cols))
}}}
If the check is on, it should throw an error (for a calling routine to
handle), or if check is off, then it should silently delete the extant
rows/columns. Go back to rasing an error like it was originally.
1. '''Apply''' section goes in the description, like on other tickets.
Part of its purpose is to see which patches to apply. Right now it is not
clear that the second patch is incremental and not a replacement. This
helps the release manger do a difficult job. I'm going to straighten it
out once.
1. We can leave sets like it is, though if anyone every Cythonizes
this, it'll probably need reworking.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11528#comment:15>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.