#18383: Coercion and comparison for alternating sign matrices
-------------------------------------+-------------------------------------
       Reporter:  vdelecroix         |        Owner:
           Type:  enhancement        |       Status:  needs_work
       Priority:  major              |    Milestone:  sage-6.7
      Component:  combinatorics      |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Vincent Delecroix  |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/vdelecroix/18383                 |  390e2d7cf57899cde4c7b096ef5b97f0be909574
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by tscrim):

 Replying to [comment:18 vdelecroix]:
 > Replying to [comment:17 tscrim]:
 > > For rich comparisons, yes. However for `cmp`, the code path currently
 completely bypasses the rich comparisons because it calls `__cmp__` (which
 calls `_cmp` which calls `_cmp_` and errors out).
 >
 > This has been fixed in #18322.

 If that does have the rich comparisons in the code path, then it should
 fix the issue without having to define a `_cmp_`.

 > > > Do you have an example involving rich comparisons that differ?
 >
 > > I'm not sure what you're asking for.
 >
 > I wanted an example of a comparison that is different before and after
 my branch.

 Here is one:
 {{{
 sage: ASM = AlternatingSignMatrices(3)
 sage: x = ASM[3]
 sage: x
 [ 0  1  0]
 [ 1 -1  1]
 [ 0  1  0]
 sage: x < matrix.identity(3)   # True with this branch
 False
 }}}
 and it is because the coercion framework gets involved. Although ASM's
 only have the inequality comparisons for plotting due to the digraph
 calling `sorted` in `vertices()` which fails (#15372, which was a quick
 hack around the problem IMO) rather than just choosing some order. So the
 inequality comparisons are not mathematically defined as-is (even for
 matrices IMO, where they are just considered as 2-dim arrays). So now I'm
 completely convinced they should be rewritten to use the lattice.

--
Ticket URL: <http://trac.sagemath.org/ticket/18383#comment:19>
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