[EMAIL PROTECTED] wrote:
> Hi All,
> 
> I am trying to write a small class which implements symmetric
> matrices, but I'm unclear how to inherit from
> sage.matrix.matrix_dense.  How can I tell what the initialization
> does, and how to properly call it?  I tried looking at
> sage.matrix.matrix_integer_dense.pyx to do this, but I'm still having
> some trouble.  I have included the class and errors below.  Thanks!

I'm not sure of the answer to your question, but I have a related 
question.

It seems that the subclasses of the matrices now focus on the types of 
entries.  Should we also subclass on the matrix structure (i.e., 
DiagonalMatrix, SymmetricMatrix, etc.), or should we instead implement 
these structural things as special construction functions and set an 
attribute in for the matrix indicating that it has the special property.

Just yesterday I needed to construct a diagonal matrix from a vector 
(the diagonal entries).  I ended up writing my own function, but would 
like to contribute it back to SAGE.  Should I contribute it as a 
function in MatrixSpace (like identity_matrix or zero_matrix) or 
something else?  This email brings up the question of if I should 
instead make DiagonalMatrix the subclass of something (if so, then what? 
  Since I might want a DiagonalMatrix of any one of the types of 
matrices that are currently subclasses).

To me, it seems to make the most sense to make a special construction 
function for matrices that have certain properties and then set some 
sort of attribute about the matrix saying it is symmetric, diagonal, 
etc.  Then in the general class, we can modify an algorithm based on if 
the attribute is set (to take advantage of the matrix being symmetric, 
etc.)  We then have all the advantages of the current type-based 
subclass system (e.g., we automatically get diagonal matrices that are 
optimized based on the type of entry).

Thanks,

Jason Grout


--~--~---------~--~----~------------~-------~--~----~
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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to