#18376: New encoding structure for linear codes
-------------------------+-------------------------------------------------
       Reporter:         |        Owner:
  dlucas                 |       Status:  needs_work
           Type:         |    Milestone:  sage-6.8
  enhancement            |   Resolution:
       Priority:  major  |    Merged in:
      Component:         |    Reviewers:
  coding theory          |  Work issues:
       Keywords:         |       Commit:
        Authors:  David  |  aa42238c6754cff63c5cc42e8d77e78b36074fbc
  Lucas                  |     Stopgaps:
Report Upstream:  N/A    |
         Branch:         |
  u/dlucas/encoder       |
   Dependencies:         |
-------------------------+-------------------------------------------------

Comment (by ncohen):

 Hello,

 I do not think that there is something inherently wrong in the way you
 expect user to call your code. To me, there is something wrong in the
 design of classes, and the way it is implemented. I tried to show that
 'accepting the class design' would lead you to a different user interface.

 For a while, I tried to forget what you wanted to represent (easier for me
 than for you), and it appeared to me that you were implementing class
 inheritance backwards.

 Look at it, it is quite surprising: here is the list of methods of an
 encoder object I built:
 {{{
 sage: e.
 e.category          e.db                e.dumps
 e.generator_matrix  e.parent            e.reset_name        e.unencode
 e.version
 e.code              e.dump              e.encode
 e.message_space     e.rename            e.save
 e.unencode_nocheck
 }}}

 If you remove the useless ones, you are left with those:
 {{{
 e.code()             # returns the 'parent' code()
 e.encode()           # =e.code().encode()
 e.generator_matrix() # =e.code().generator_matrix()
 e.message_space()    # =e.code().ambiant_space()
 e.unencode()         # =e.code().unencode()
 }}}

 It is funny to notice two things:
 1) All encoder methods can be called directly from the code (i.e. at the
 moment there is no point to build the encoder object)
 2) Some code functions call the encoder's function, which leads you to
 create one-line functions with 30 lines of doc each time.

 If I just look at the code, it seems that you just want your code to
 inherit the methods implemented in the encoder, i.e. generator_matrix,
 encode, and unencode. Then you get this for free.

 If you find a way to make all these functions available at the level of
 the code without having to copy/paste a lot of things, it would solve my
 main (and perhaps only) objection about the classes' design.

 Nathann

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