On Thu, Jan 15, 2009 at 4:26 PM, William Stein <wst...@gmail.com> wrote:
> On Thu, Jan 15, 2009 at 3:12 PM, Jason Grout
> <jason-s...@creativetrax.com> wrote:
>>
>> c mullan wrote:
>>> Hi,
>>>
>>> Suppose I compute the Jordan Normal Form of a matrix,
>>>
>>> A.jordan_form()
>>>
>>> Then in the output I can see that the block sizes are indicated (by
>>> subdivide='True'), but I can't extract this information. I would like
>>> a list of block sizes, (e.g. [2,2,1,1,1] for a 7x7 matrix).
>>>
>>> I cannot figure out how to do this, any ideas?
>>>
>>
>>
>> sage: a = matrix(ZZ,4,[1, 0, 0, 0, 0, 1, 0, 0, 1, -1, 1, 0, 1, -1, 1, 2])
>> sage: b=a.jordan_form()
>> sage: b
>>
>> [2|0 0|0]
>> [-+---+-]
>> [0|1 1|0]
>> [0|0 1|0]
>> [-+---+-]
>> [0|0 0|1]
>> sage: b.subdivisions
>> ([0, 1, 3, 4], [0, 1, 3, 4])
>
> I just have to comment:
>
> 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])
>
>
> One could argue that throughout Sage maybe we should use attributes
> for properties and function calls much less. However, there's no
> hundreds of thousands of lines of code, and it mostly uses the
> "b.subdivisions() style" instead of the "b.subdivisions" style, so for
> consistency at this point, I think we should just stick to that.
>
> Thoughts?
>

OH, this is now trac # 4983:

  http://trac.sagemath.org/sage_trac/ticket/4983

William

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to