#4983: replace subdivisions attribute for matrices with a function
------------------------------+---------------------------------------------
Reporter: was | Owner: was
Type: enhancement | Status: positive_review
Priority: minor | Milestone: sage-4.7
Component: linear algebra | Keywords:
Author: John Palmieri | Upstream: N/A
Reviewer: Rob Beezer | Merged:
Work_issues: |
------------------------------+---------------------------------------------
Old description:
> I do not like this:
>
> {{{
> sage: sage: a = matrix(ZZ,4,[1, 0, 0, 0, 0, 1, 0, 0, 1, -1, 1, 0, 1, -1,
> 1, 2])
> sage: sage: b=a.jordan_form()
> sage: b.subdivisions
> ([0, 1, 3, 4], [0, 1, 3, 4])
> sage: b.subdivisions = 10
> sage: b.subdivisions
> 10
> }}}
>
> Notice that you can make the subdivisions nonsense because it can be
> changed.
> Also, of course,
> {{{
> sage: b.subdivisions?
> ... The Integer class represents arbitrary precision
> integers. It derives from the Element class, so
> [other useless stuff]
> }}}
>
> I don't like that at all either. I wish that subdivisions were a method
> with a proper docstring, doctests, etc., and that variable were hidden.
>
> Then one would do:
> {{{
> sage: b.subdivisions?
> useful stuff (and also it would be in the reference manual)
> and
> sage: b.subdivisions()
> ([0, 1, 3, 4], [0, 1, 3, 4])
> }}}
>
> ------
>
> Apply only [attachment:trac_4983-subdivisions-rebased.patch]. Depends on
> #10974.
New description:
I do not like this:
{{{
sage: sage: a = matrix(ZZ,4,[1, 0, 0, 0, 0, 1, 0, 0, 1, -1, 1, 0, 1, -1,
1, 2])
sage: sage: b=a.jordan_form()
sage: b.subdivisions
([0, 1, 3, 4], [0, 1, 3, 4])
sage: b.subdivisions = 10
sage: b.subdivisions
10
}}}
Notice that you can make the subdivisions nonsense because it can be
changed.
Also, of course,
{{{
sage: b.subdivisions?
... The Integer class represents arbitrary precision
integers. It derives from the Element class, so
[other useless stuff]
}}}
I don't like that at all either. I wish that subdivisions were a method
with a proper docstring, doctests, etc., and that variable were hidden.
Then one would do:
{{{
sage: b.subdivisions?
useful stuff (and also it would be in the reference manual)
and
sage: b.subdivisions()
([0, 1, 3, 4], [0, 1, 3, 4])
}}}
------
'''Depends on:'''
1. #10974
'''Apply:'''
1. [attachment:trac_4983-subdivisions-rebased.patch]
--
Comment(by rbeezer):
Replying to [comment:16 jhpalmieri]:
> (I've already done this, but it's good to double-check it.)
Double-check shows everything is fine on 4.7.alpha3: applies, builds,
passes long tests.
Thanks again, John, for sparing me the work on #10974. As a bonus I
upgraded the depends/apply block to Jeroen's new formatting. ;-)
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4983#comment:18>
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.