Re: [sage-devel] Integer from mpz_t

2015-08-19 Thread Ralf Stephan
On Wednesday, August 19, 2015 at 11:51:49 AM UTC+2, David Roe wrote: Since you have an mpz_t, presumably you're writing in Cython. Unfortunately, no. I'm improving Pynac to use gmp internally. But at some time we must convert back. I completely missed set_from_mpz though. With that I just need

[sage-combinat-devel] Re: problems with hash for tableaux

2015-08-19 Thread Darij Grinberg
Hi Anne, On Wed, Aug 19, 2015 at 12:23 PM, Anne Schilling a...@math.ucdavis.edu wrote: Nicolas and I just did some experiments with Sage and stumbled upon the following: sage: t = StandardTableaux([3,2,1]).an_element() sage: tt = Tableau(t[:]) sage: t == tt True sage: hash(t) == hash(tt)

Re: [sage-devel] Re: SSLv3 and Sage 6.8

2015-08-19 Thread Dima Pasechnik
On Tuesday, 18 August 2015 22:56:45 UTC-7, Jori Mäntysalo wrote: On Tue, 18 Aug 2015, Dima Pasechnik wrote: At http://trac.sagemath.org/ticket/17164 it seems that Sage 6.8 has not support for vulnerable SSLv3 anymore. But it still seems to have - at least on SageNB. I have and

Re: [sage-devel] About plot(sin(x))

2015-08-19 Thread William Stein
On Wed, Aug 19, 2015 at 12:30 PM, Travis Scrimshaw tsc...@ucdavis.edu wrote: More of random thought, but would people be interested in adding a value to the builtin functions which says what a good default plot interval is, e.g., for sin(x) would be [-pi, pi] or [-2pi, 2pi] (and hope there's

Re: [sage-devel] About plot(sin(x))

2015-08-19 Thread Travis Scrimshaw
More of random thought, but would people be interested in adding a value to the builtin functions which says what a good default plot interval is, e.g., for sin(x) would be [-pi, pi] or [-2pi, 2pi] (and hope there's not too much bikeshedding)? Best, Travis On Tuesday, August 18, 2015 at

[sage-devel] Re: Default ipython profile

2015-08-19 Thread Kwankyu Lee
This is a one-line ticket waiting for review, but is in pending state for patchbots since it touches an unsafe file (sage-ipython). Would any of you review? http://trac.sagemath.org/ticket/19021 -- You received this message because you are subscribed to the Google Groups sage-devel group. To

Re: [sage-devel] Re: Integer from mpz_t

2015-08-19 Thread Jean-Pierre Flori
On Wednesday, August 19, 2015 at 12:21:36 PM UTC+2, vdelecroix wrote: Note that all the solutions given will *copy* the mpz_t to the Integer. Is that what you want? It is also possible to avoid the copy if it is worth it (i.e. you have a big integer). And one shall not use PY_NEW but

Re: [sage-devel] Re: Integer from mpz_t

2015-08-19 Thread Vincent Delecroix
On 19/08/15 12:31, Jean-Pierre Flori wrote: On Wednesday, August 19, 2015 at 12:21:36 PM UTC+2, vdelecroix wrote: Note that all the solutions given will *copy* the mpz_t to the Integer. Is that what you want? It is also possible to avoid the copy if it is worth it (i.e. you have a big

Re: [sage-devel] Re: Integer from mpz_t

2015-08-19 Thread Jean-Pierre Flori
On Wednesday, August 19, 2015 at 12:36:07 PM UTC+2, vdelecroix wrote: On 19/08/15 12:31, Jean-Pierre Flori wrote: On Wednesday, August 19, 2015 at 12:21:36 PM UTC+2, vdelecroix wrote: Note that all the solutions given will *copy* the mpz_t to the Integer. Is that what you

Re: [sage-devel] Re: Integer from mpz_t

2015-08-19 Thread Vincent Delecroix
Note that all the solutions given will *copy* the mpz_t to the Integer. Is that what you want? It is also possible to avoid the copy if it is worth it (i.e. you have a big integer). On 19/08/15 11:52, Jean-Pierre Flori wrote: On Wednesday, August 19, 2015 at 11:19:30 AM UTC+2, Ralf Stephan

[sage-devel] Re: Integer from mpz_t

2015-08-19 Thread Jean-Pierre Flori
On Wednesday, August 19, 2015 at 11:19:30 AM UTC+2, Ralf Stephan wrote: Given an mpz_t, how to most effectively create an Integer? The best I can come up with is through the string representation. Or, of course, by patching integer.pyx. Am I missing something? From Cython you can use the

Re: [sage-devel] Integer from mpz_t

2015-08-19 Thread David Roe
Since you have an mpz_t, presumably you're writing in Cython. Then you can do something like the following. cdef mpz_t input cdef Integer output = PY_NEW(Integer) output.set_from_mpz(input) Or something like mpz_set(output.value, input). David On Wed, Aug 19, 2015 at 2:19 AM, Ralf Stephan

[sage-devel] Integer from mpz_t

2015-08-19 Thread Ralf Stephan
Given an mpz_t, how to most effectively create an Integer? The best I can come up with is through the string representation. Or, of course, by patching integer.pyx. Am I missing something? -- You received this message because you are subscribed to the Google Groups sage-devel group. To