Re: [sage-devel] coercion ZZ, QQ and quadratic number field

2013-05-10 Thread vdelecroix
Thanks for your answer.

Le vendredi 10 mai 2013 22:15:37 UTC+2, David Roe a écrit :
>
> You can do:
>
> sage: K.=QuadraticField(2)
> sage: K.register_coercion(K.coerce_map_from(QQ) * QQ.coerce_map_from(ZZ))
>
> For even more speed you can write your own custom Cython coercion from ZZ 
> to K.
>

This is now #14563.

Vincent 

On Fri, May 10, 2013 at 12:59 PM, vdelecroix <20100.d...@gmail.com
> wrote:

> Hi,
>
> Let K be a quadratic number field (let say K = QuadraticField(2)).
> There are "natural morphisms" implemented in Cython from ZZ to QQ and
> from QQ to K. There is also an other way, somewhat more direct, to go
> from ZZ to K. But at the end it is 10 times faster to go the first way
> and Sage does not choose it!
> {{{
> sage: K.=QuadraticField(2)
> sage: f = K.coerce_map_from(ZZ)
> sage: g = K.coerce_map_from(QQ) * QQ.coerce_map_from(ZZ)
> sage: timeit('f(1)')
> 625 loops, best of 3: 13.8 µs per loop
> sage: timeit('g(1)')
> 625 loops, best of 3: 1.29 µs per loop
> }}}
>
> What can I do to make Sage chooses the undirect way ? In some sense a
> composition of "natural morphisms" (ie mathematically natural and
> Cython implemented) should be prefered to "conversion".
>
> Best,
> Vincent
>
> Note: I get some troubles with #13213 which pops out the natural
> morphism from QQ to K...
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+...@googlegroups.com .
> To post to this group, send email to sage-...@googlegroups.com
> .
> Visit this group at http://groups.google.com/group/sage-devel?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-devel] coercion ZZ, QQ and quadratic number field

2013-05-10 Thread David Roe
You can do:

sage: K.=QuadraticField(2)
sage: K.register_coercion(K.coerce_map_from(QQ) * QQ.coerce_map_from(ZZ))

For even more speed you can write your own custom Cython coercion from ZZ
to K.
David


On Fri, May 10, 2013 at 12:59 PM, vdelecroix <20100.delecr...@gmail.com>wrote:

> Hi,
>
> Let K be a quadratic number field (let say K = QuadraticField(2)).
> There are "natural morphisms" implemented in Cython from ZZ to QQ and
> from QQ to K. There is also an other way, somewhat more direct, to go
> from ZZ to K. But at the end it is 10 times faster to go the first way
> and Sage does not choose it!
> {{{
> sage: K.=QuadraticField(2)
> sage: f = K.coerce_map_from(ZZ)
> sage: g = K.coerce_map_from(QQ) * QQ.coerce_map_from(ZZ)
> sage: timeit('f(1)')
> 625 loops, best of 3: 13.8 µs per loop
> sage: timeit('g(1)')
> 625 loops, best of 3: 1.29 µs per loop
> }}}
>
> What can I do to make Sage chooses the undirect way ? In some sense a
> composition of "natural morphisms" (ie mathematically natural and
> Cython implemented) should be prefered to "conversion".
>
> Best,
> Vincent
>
> Note: I get some troubles with #13213 which pops out the natural
> morphism from QQ to K...
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-devel?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-devel] coercion ZZ, QQ and quadratic number field

2013-05-10 Thread vdelecroix
Hi,

Let K be a quadratic number field (let say K = QuadraticField(2)).
There are "natural morphisms" implemented in Cython from ZZ to QQ and
from QQ to K. There is also an other way, somewhat more direct, to go
from ZZ to K. But at the end it is 10 times faster to go the first way
and Sage does not choose it!
{{{
sage: K.=QuadraticField(2)
sage: f = K.coerce_map_from(ZZ)
sage: g = K.coerce_map_from(QQ) * QQ.coerce_map_from(ZZ)
sage: timeit('f(1)')
625 loops, best of 3: 13.8 µs per loop
sage: timeit('g(1)')
625 loops, best of 3: 1.29 µs per loop
}}}

What can I do to make Sage chooses the undirect way ? In some sense a
composition of "natural morphisms" (ie mathematically natural and
Cython implemented) should be prefered to "conversion".

Best,
Vincent

Note: I get some troubles with #13213 which pops out the natural
morphism from QQ to K...

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-devel] Backspace Key in Notebook

2013-05-10 Thread manday
On Fri, May 10, 2013 at 05:56:03AM -0700, William Stein wrote:
> On Fri, May 10, 2013 at 4:04 AM,   wrote:
> > It might be related. I'm confident this happend while the cursor was at
> > the end of a line, though.
> >
> > Also, I don't think this could explain the Enter-breaks-cell part, could
> > it?
> >
> > If what you say is true and a non-empty (!) cell is joined with the
> > preceeding one when Backspace is pressed on the first line, I think this
> > should be changed. It's too easy to cause this behaviour by accident.
> >
> > Anyway, I'm not aware of any such behaviour. I know that only from empty
> > cells, which is not related to the subject, however.
> 
> That behavior is supposed to be what happens when you press
> "control-enter" and "control-backspace".  Any chance there's something
> going on involving the control key?

Yes, I know. No. I'm absolutely certain there is no control key
involved. If it helps, I have got the impression that it happens when I
place the cursor at the end of a line and do NOT type or move the cursor
before I press backspace. It's, however, only my impression and I can
not claim with certainty that it wouldn't happen under different
circumstances, either.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-devel] Backspace Key in Notebook

2013-05-10 Thread William Stein
On Fri, May 10, 2013 at 4:04 AM,   wrote:
> It might be related. I'm confident this happend while the cursor was at
> the end of a line, though.
>
> Also, I don't think this could explain the Enter-breaks-cell part, could
> it?
>
> If what you say is true and a non-empty (!) cell is joined with the
> preceeding one when Backspace is pressed on the first line, I think this
> should be changed. It's too easy to cause this behaviour by accident.
>
> Anyway, I'm not aware of any such behaviour. I know that only from empty
> cells, which is not related to the subject, however.

That behavior is supposed to be what happens when you press
"control-enter" and "control-backspace".  Any chance there's something
going on involving the control key?

>
> On Fri, May 10, 2013 at 03:25:07AM -0600, David Roe wrote:
>>Do you mean typing backspace when the cursor is at the beginning of the
>>cell?  That's the expected behavior
>>David
>>
>>On Fri, May 10, 2013 at 3:10 AM, <[1]man...@gmx.net> wrote:
>>
>>  Backspace in the Notebook in webkit(gtk) often (not always, haven't
>>  found a pattern) joins the cell with the previous cell. As you might
>>  imagine, that's fairly annoying. Could anyone have a look? Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-devel?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



-- 
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-devel] recompilation with "sage -clone"

2013-05-10 Thread vdelecroix
Hi,

It seems that the behavior of "sage -clone" changes around the version 5.9. 
I freshly compiled a version of 5.10.beta2 and when I do a clone it 
recompiles the wholse sage sources (but hopefully not the auxilliary spkg). 
The first line in the log of "sage -clone" which differs from previous 
version is the following

Updating Cython code
Compiling sage/algebras/quatalg/quaternion_algebra_element.pyx because it 
depends on ./sage/structure/sage_object.pxd
...

I was not able to find some information elsewhere.

Best,
Vincent

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-devel] Backspace Key in Notebook

2013-05-10 Thread manday
It might be related. I'm confident this happend while the cursor was at
the end of a line, though.

Also, I don't think this could explain the Enter-breaks-cell part, could
it?

If what you say is true and a non-empty (!) cell is joined with the
preceeding one when Backspace is pressed on the first line, I think this
should be changed. It's too easy to cause this behaviour by accident.

Anyway, I'm not aware of any such behaviour. I know that only from empty
cells, which is not related to the subject, however.

On Fri, May 10, 2013 at 03:25:07AM -0600, David Roe wrote:
>Do you mean typing backspace when the cursor is at the beginning of the
>cell?  That's the expected behavior
>David
> 
>On Fri, May 10, 2013 at 3:10 AM, <[1]man...@gmx.net> wrote:
> 
>  Backspace in the Notebook in webkit(gtk) often (not always, haven't
>  found a pattern) joins the cell with the previous cell. As you might
>  imagine, that's fairly annoying. Could anyone have a look? Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-devel] Backspace Key in Notebook

2013-05-10 Thread David Roe
Do you mean typing backspace when the cursor is at the beginning of the
cell?  That's the expected behavior
David


On Fri, May 10, 2013 at 3:10 AM,  wrote:

> Backspace in the Notebook in webkit(gtk) often (not always, haven't
> found a pattern) joins the cell with the previous cell. As you might
> imagine, that's fairly annoying. Could anyone have a look? Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-devel?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-devel] Backspace Key in Notebook

2013-05-10 Thread manday
On Fri, May 10, 2013 at 11:10:58AM +0200, man...@gmx.net wrote:
> Backspace in the Notebook in webkit(gtk) often (not always, haven't
> found a pattern) joins the cell with the previous cell. As you might
> imagine, that's fairly annoying. Could anyone have a look? Thanks.

Similarly,  often causes the cell to evaluate and break.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-devel] Backspace Key in Notebook

2013-05-10 Thread manday
Backspace in the Notebook in webkit(gtk) often (not always, haven't
found a pattern) joins the cell with the previous cell. As you might
imagine, that's fairly annoying. Could anyone have a look? Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-devel] Re: Solaris [SPARC] Sage 5.9 / ecl issue

2013-05-10 Thread Rob McMahon

On 09/05/2013 13:02, leif wrote:

Rob McMahon wrote:

On 09/05/2013 07:22, leif wrote:

Rob McMahon wrote:

Solaris 10 SPARC, with libffi and libiconv installed on the system
already for other purposes. Having worked around the iconv issue
(special case for solaris in iconv*/src/src/Makefile.in, make now dies
compiling ecl with:
...
Although it is finding the installed libffi at compile time, it is not
finding it at run time ... the -L flags can't be matching the -R 
flags.


I haven't had coffee yet, but if the dynamic linker picks up the
system-wide(?) libffi from some "default" directory during linking,
why doesn't the runtime linker?  (Except for '.', there are no
directories outside the Sage tree explicitly specified with '-L' in
the link command, so probably something is wrong with your
[environment variable] setup.  You *may* be able to add further
'-Wl,-R,...' to LDFLAGS to work around this though, without changing
any *PATH vars.)

It correctly works out the -L flags for linking, but doesn't add the
corresponding -R flags.


?  So where does your libffi.so come from?  (I.e., where is it 
located, and which env var contains its directory, if the latter is 
not one of the standard places?)  (And is libffi.so.4 located in the 
same place?)
I install this sort of thing in /usr/local/gnu/lib and yes, the .so* 
files are in the same place.  So's the .la file, but linking to this 
turned out to be a mistake later when sage tried to tweak it.  No 
environment variables or crle settings involved, anything that uses them 
gets compiled with a runpath.  The same issues, and the same places 
applied to building R, for libgomp.


The good news is that after creating these links, and the tweak to the 
iconv Makefile, everything is now built and I'm trying a make ptestlong.


Cheers,

Rob

--
E-Mail: rob.mcma...@warwick.ac.uk   PHONE:  +44 24 7652 3037
Rob McMahon, IT Services, Warwick University, Coventry, CV4 7AL, England

--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-devel] Strange deprecation warning in #14136

2013-05-10 Thread Jeroen Demeyer

On 05/10/2013 01:32 AM, Travis Scrimshaw wrote:

Hey everyone,
At http://trac.sagemath.org/sage_trac/ticket/14136 we are getting a
strange deprecation warning that should not appear:
doctest:201: DeprecationWarning: object.__init__() takes no parameters


Are you by accident calling object.__init__()? Perhaps because you have 
a class inheriting from object?


--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.