ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 29 Oct 2012 03:31:33 -0500Deriving from Matrix classhttp://ask.sagemath.org/question/9436/deriving-from-matrix-class/Sage doesn't recognize Matrix_generic_dense. How can I create a Matrix class?
Say I want to create a class of generic matrices which I could tack on various other attributes to. I am hoping for something like:
class MatrixNew(Matrix_generic_dense): Sun, 28 Oct 2012 11:27:20 -0500http://ask.sagemath.org/question/9436/deriving-from-matrix-class/Comment by kcrisman for <p>Sage doesn't recognize Matrix_generic_dense. How can I create a Matrix class?</p>
<p>Say I want to create a class of generic matrices which I could tack on various other attributes to. I am hoping for something like:</p>
<pre><code>class MatrixNew(Matrix_generic_dense):
</code></pre>
http://ask.sagemath.org/question/9436/deriving-from-matrix-class/?comment=18791#post-id-18791It probably needs to be imported from the relevant place? This is a very vague question as it stands :(Sun, 28 Oct 2012 16:24:48 -0500http://ask.sagemath.org/question/9436/deriving-from-matrix-class/?comment=18791#post-id-18791Comment by SLOtoSF for <p>Sage doesn't recognize Matrix_generic_dense. How can I create a Matrix class?</p>
<p>Say I want to create a class of generic matrices which I could tack on various other attributes to. I am hoping for something like:</p>
<pre><code>class MatrixNew(Matrix_generic_dense):
</code></pre>
http://ask.sagemath.org/question/9436/deriving-from-matrix-class/?comment=18789#post-id-18789Sorry, let me rephrase.Sun, 28 Oct 2012 16:54:38 -0500http://ask.sagemath.org/question/9436/deriving-from-matrix-class/?comment=18789#post-id-18789Answer by Jason Grout for <p>Sage doesn't recognize Matrix_generic_dense. How can I create a Matrix class?</p>
<p>Say I want to create a class of generic matrices which I could tack on various other attributes to. I am hoping for something like:</p>
<pre><code>class MatrixNew(Matrix_generic_dense):
</code></pre>
http://ask.sagemath.org/question/9436/deriving-from-matrix-class/?answer=14206#post-id-14206Look in the `devel/sage/sage/matrix/` directory for examples. `matrix_mpolynomial_dense.pyx` looks like a pretty minimal example. `matrix_symbolic_dense.pyx` and `matrix_double_dense.pyx` might be good examples too.Mon, 29 Oct 2012 03:31:33 -0500http://ask.sagemath.org/question/9436/deriving-from-matrix-class/?answer=14206#post-id-14206