#12604: A patch adding .dimensions() to a matrix.
-----------------------------+----------------------------------------------
Reporter: blundell | Owner: tbd
Type: enhancement | Status: needs_review
Priority: trivial | Milestone: sage-5.0
Component: PLEASE CHANGE | Keywords: Matricies
Work_issues: | Upstream: N/A
Reviewer: | Author:
Merged: | Dependencies:
-----------------------------+----------------------------------------------
Changes (by was):
* status: needs_info => needs_review
Comment:
Replying to [comment:1 dsm]:
> I'm not sure we can use ".dimensions()" for this, at least by itself.
I personally can not remember using or hearing the word "dimensions" to
refer to the number of rows and columns of a matrix. However, I just did
a google search, and this is *definitely* very standard terminology all
over the place. So I think it is very sensible to add this.
> Our terminology is already a little weird.. in the parent MatrixSpace,
we have:
>
> {{{
> sage: m = Matrix(QQ, 3, 5)
> sage: m
> [0 0 0 0 0]
> [0 0 0 0 0]
> [0 0 0 0 0]
> sage: parent(m)
> Full MatrixSpace of 3 by 5 dense matrices over Rational Field
> sage: ms = parent(m)
> sage: ms.dim
> ms.dimension ms.dims
> sage: ms.dims()
> (3, 5)
It would be good to have dims = dimensions as an alias for consistency.
Don't just change it since that will break code.
> sage: ms.dimension()
> 15
> }}}
ms.dimension() is literally the dimension of the matrix space itself.
This has nothing to do with "dimensions()", except that it is the product
of them.
>
> Those aren't the names I'd have chosen, but given that they're there, we
shouldn't have .dims() work for the MatrixSpace and .dimensions() work for
an element in the space.
>
> .dimensions() is a better name, IMHO, so maybe we should make both
.dimensions() and .dimension() work
> for the MatrixSpace and for a Matrix, and let .dims() be an alias for
.dimensions() for backward
> compatibility purposes. Above my pay grade, though.
I totally agree with your conclusion. But I'm not convinced that changes
to MatrixSpace should be part of this ticket. It could be in another
ticket.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12604#comment:2>
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.