is diag() right?

26 views
Skip to first unread message

smichr

unread,
Oct 1, 2012, 7:39:30 AM10/1/12
to sy...@googlegroups.com
In the diag docstring is this example:

    >>> diag(a, 7, b, c)
    [x, 0, 0, 0, 0, 0]
    [y, 0, 0, 0, 0, 0]
    [z, 0, 0, 0, 0, 0]
    [0, 7, 0, 0, 0, 0]
    [0, 0, 1, 2, 0, 0]
    [0, 0, 3, 4, 0, 0]
    [0, 0, 0, 0, 5, 6]


Should the 7 be on the diagonal or is this "feature" (where it appears in the cell diagonal to where the last, a = vec(x, y, z) left off) correct?

Aaron Meurer

unread,
Oct 1, 2012, 10:48:19 AM10/1/12
to sy...@googlegroups.com
This is correct.  The different blocks are placed diagonal of one another. They will be on the diagonal of the resulting matrix if the blocks are all square. 

Aaron Meurer
--
You received this message because you are subscribed to the Google Groups "sympy" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sympy/-/ippHfatDBAoJ.
To post to this group, send email to sy...@googlegroups.com.
To unsubscribe from this group, send email to sympy+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
Reply all
Reply to author
Forward
0 new messages