#18979: avoid Maxima on creation of symbolic matrices
-------------------------------------+-------------------------------------
       Reporter:  rws                |        Owner:
           Type:  defect             |       Status:  needs_work
       Priority:  major              |    Milestone:  sage-6.9
      Component:  linear algebra     |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Ralf Stephan       |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/rws/avoid_maxima_on_creation_of_symbolic_matrices|  
75e679c687019c9657188003306bbd08314919a5
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------
Changes (by vdelecroix):

 * status:  needs_review => needs_work


Comment:

 Hi,

 I really do not like your solution. You are invading a generic class with
 some specialized code. Moreover, the issue you found might be present in a
 lot of other places. You should find a better way to do this test without
 having to care whether the input is symbolic. If each ring needs a
 specialized treatment it will become a complete nightmare.

 Secondly, the operations `import XYZ` and `isinstance(x, my_type)` are not
 at all negligeable. Though, in this case it is not very noticeable since
 the cost is elsewhere. But with your strategy, you are potentially slowing
 down everthing for a corner case speed up.

 In this very particular case of matrices, there is a simpler way to fix
 the issue. You can just avoid testing anything. In case `x` is zero a
 useless filling will be done but of no harm (it is very quick compared to
 the rest of the initialization). If you like better my solution, write at
 least a comment that we should not test wheter the input is zero.

 Vincent

--
Ticket URL: <http://trac.sagemath.org/ticket/18979#comment:5>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to