#15820: Implement sequences of bounded integers
--------------------------------------------+------------------------
       Reporter:  SimonKing                 |        Owner:
           Type:  enhancement               |       Status:  new
       Priority:  major                     |    Milestone:  sage-6.2
      Component:  algebra                   |   Resolution:
       Keywords:  sequence bounded integer  |    Merged in:
        Authors:                            |    Reviewers:
Report Upstream:  N/A                       |  Work issues:
         Branch:                            |       Commit:
   Dependencies:                            |     Stopgaps:
--------------------------------------------+------------------------

Comment (by ncohen):

 > Sure. And you want to do this same computation `10^7` times?

 I don't get it. If the width is a power of two, then there are 6 possible
 values, i.e. 2^1, 2^2, 2^3, 2^4, 2^5, 2^6. Otherwise you have at most 64,
 but really who cares in the end ?

 > Yes. Probably my problem is that I don't think "C++", but I think
 "Cython". And there it is a bit clumsy (I think templating is mimicked in
 Cython by including .pxi files, isn't it?).

 I am thinking of this :
 http://stackoverflow.com/questions/4840819/c-template-specialization-with-
 constant-value

 That's C++, and I don't see how to do it in Cython, though. The point is
 that you can parameter a data structure with a constant value, and the
 data structure will be compiled for each value of the constant *that
 appears in the code at compile-time* (not all possible values, or course).
 The point is that the code is optimized while knowing the value(which can
 lead to optimization) and also that  you can do things that would not be
 possible otherwise, like "cdef int a[k]" where k is a (templated)
 variable.

 Nathann

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