#19136: NO and NU graphs
-------------------------+-------------------------------------------------
       Reporter:         |        Owner:
  dimpase                |       Status:  needs_review
           Type:         |    Milestone:  sage-6.9
  enhancement            |   Resolution:
       Priority:  major  |    Merged in:
      Component:  graph  |    Reviewers:  Nathann Cohen
  theory                 |  Work issues:
       Keywords:         |       Commit:
        Authors:  Dima   |  dbc50b1b074afe22f4fb32542e8b1ca76c41525e
  Pasechnik              |     Stopgaps:
Report Upstream:  N/A    |
         Branch:         |
  u/dimpase/NONU         |
   Dependencies:         |
  #19098, #19180         |
-------------------------+-------------------------------------------------

Comment (by dimpase):

 Replying to [comment:30 ncohen]:

 > {{{
 > (tmp|✔)~/sage/graphs$ grep "^# " strongly_regular_db.pyx
 > # -*- coding: utf-8 -*-
 > #    print "ev: ", r, " ", s, "\n"
 > #    print "p=", p, " t=", t, " r=", r, " s=", s,"\n"
 > #            print "2nd try: p=", p, " t=", t, " r=", r, " s=", s,"\n"
 > #    print "q=", q, "e=", e, "\n"
 > #    n  = t/kk + 2
 > #    print q**(n-1)*(q**n - e)/(q + 1), " ",\
 > #          (q**(n-1) + e)*(q**(n-2) - e), " ",\
 > #          q**(2*n-5)*(q+1) - e*q**(n-2)*(q-1) - 2, " ",\
 > #          q**(n-3)*(q + 1)*(q**(n-2) - e),"\n"
 > }}}

 OK, removed, sorry.

 >
 > > > - Why 5 `is_NO*` functions instead of one `is_NO` ? I remember a
 comment of
 > > >   yours about copy/paste...
 > >
 > > it's because the arithmetic properties of parameters are quite
 different in each of these
 > > cases. Each has a different algorithm coded.
 >
 > So the test is different in each case, but the tests for prime powers,
 the ordering or `s,r`, the eigenvalues..

 no, read the code: in some cases eigenvalues aren't even computed; if they
 are used then they are used differently in different functions, etc. Also
 note that there is a lot in common between all of the following:
 {{{
 is_affine_polar,is_orthogonal_polar,is_NOodd, is_NOperp_F5,
 is_NO_F2, is_NO_F3, is_NU,
 is_unitary_polar,is_unitary_dual_polar
 }}}

 And most of these test for more than one series of graphs, if you count
 all these '+', '-', etc.

 > All this is common (not to mention a big part of the doc). Why not one
 function, with several 'if' for each case?

 because several ifs suck and make code unreadable and harder to debug, and
 hard to document and test. Imagine e.g. how hard it would be to figure out
 what doctest tests what.

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