On 18 Apr., 18:07, Florent Hivert <florent.hiv...@lri.fr> wrote: > On Wed, Apr 18, 2012 at 09:03:25AM -0700, Daniel Krenn wrote: > > If I perform a scalar multiplication e.g. of an integer with a module > > element, it seems that a double-and-add algorithm is used. Where (in > > which file/class) is that algorithm exactly implemented? > > > It is called, for example by > > sage: E = EllipticCurve('37a') > > sage: P = E(0,0) > > sage: 5*P > > (1/4 : -5/8 : 1) > > sage/structure/element.pyx: > > def generic_power(a, n, one=None): > """ > Computes `a^n`, where `n` is an integer, and `a` is an object which > supports multiplication. Optionally an additional argument, > which is used in the case that n == 0: > > - ``one`` - the "unit" element, returned directly (can be anything) > ... > """
In the elliptic curve example given above, that method (generic_power) is not called. Daniel -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org