#17665: Change binary_matrix data type to use bitset
-------------------------------------+-------------------------------------
       Reporter:  dcoudert           |        Owner:
           Type:  enhancement        |       Status:  needs_work
       Priority:  major              |    Milestone:  sage-6.5
      Component:  misc               |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  David Coudert      |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/jdemeyer/ticket/17665            |  5cc5d22f48de853f3775e459afed1b5bc99170c9
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by jdemeyer):

 Replying to [comment:21 dcoudert]:
 > Replying to [comment:20 jdemeyer]:
 > > Why did you replace
 > > {{{
 > > for i in range(m.n_rows):
 > > }}}
 > > by
 > > {{{
 > > for i from 0 <= i < m.n_rows:
 > > }}}
 > > everywhere? The latter is considered legacy syntax.
 >
 > I thought it was better this way, but if it's not the correct cython
 syntax, we can go back to `range(n)`.
 It's technically correct but not recommended.

 > > Also: make sure your types match. `n_rows` and `n_cols` are declared
 as `long`, then loop indices should also be `long` (you use `int` in many
 places).
 >
 > It was already `int`in many places. So we can try to unify the stuff.
 > Honestly I doubt that we really need `long` for `n_rows` and `n_cols`.
 `int` should be large enough, no?
 I would personally use `long` (or even better: `Py_ssize_t`). There is no
 reason to artificially restrict to 2^32 rows and columns. Even if you
 don't see an obvious use-case for this, perhaps other people do.

 Given that
 {{{
 sage: Matrix(GF(2), 2^32, 1)
 4294967296 x 1 dense matrix over Finite Field of size 2 (use the '.str()'
 method to see the entries)
 }}}
 works fine, the same would work for this `binary_matrix` class.

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