Hi,

On Wed, Jul 20, 2011 at 11:19 PM, Matt Curry <[email protected]> wrote:

> Hello All,
>
> I've been writing some code that uses SymPy matrices, and part of this
> code has to check to see if a matrix is a scalar matrix (diagonal and
> all diagonal elements are equal). Unless I missed something, SymPy
> only has an is_diagonal() method but not an is_scalar_matrix() method
> or something like that. I wrote my own function that does this (it's
> very basic). Would this be beneficial for SymPy matrices?
>
> Matt Curry


The function is useful at many places.

This is the sort of thing that inspired me to  think of two sub-modules
inside sympy, matrix, and linalg.

linalg.LUdecomp(A) makes sense, but linalg.is_scalar_matrix(A) does not make
much sense.
matrix.is_scalar_matrix(A) is more appropriate. Further by the use of the
name 'matrix' as the sub-module, we cut ambiguity about the nature of the
function, thus we can even call this function is_scalar in the matrix
sub-module namespace.

-Sherjil Ozair

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" 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/sympy?hl=en.

Reply via email to