[sage-support] How to return an RDF (or CDF) value from a Cython function ?

2016-10-17 Thread Emmanuel Charpentier
I need to use a fast random (complex) number generatot. The following : sage: %%cython : from sage.misc.prandom import random : cpdef complex crand(double x): : return x*random()+x*1j*random() is about 77 times faster than its Python equivalent : sage: def prand(x): : r

Re: [sage-support] How to return an RDF (or CDF) value from a Cython function ?

2016-10-17 Thread Jeroen Demeyer
On 2016-10-17 09:53, Emmanuel Charpentier wrote: I need to use a fast random (complex) number generatot. The following : sage: %%cython : from sage.misc.prandom import random : cpdef complex crand(double x): : return x*random()+x*1j*random() is about 77 times faster than its P

Re: [sage-support] How to return an RDF (or CDF) value from a Cython function ?

2016-10-17 Thread Emmanuel Charpentier
Dear Jeroen, Le lundi 17 octobre 2016 09:58:38 UTC+2, Jeroen Demeyer a écrit : > > On 2016-10-17 09:53, Emmanuel Charpentier wrote: > > I need to use a fast random (complex) number generatot. > > > > The following : > > > > sage: %%cython > > : from sage.misc.prandom import random > > .

Re: [sage-support] How to return an RDF (or CDF) value from a Cython function ?

2016-10-17 Thread Vincent Delecroix
CDF is the name of a Python variable not a type. sage: a = CDF.an_element() sage: type(a) You need to use this ComplexDoubleElement to type your function. -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop

Re: [sage-support] How to return an RDF (or CDF) value from a Cython function ?

2016-10-17 Thread Emmanuel Charpentier
Thank you Vincent. this is much clearer. It seems that I have some things left to understand about the Sage class and types hierarchies. Sorry for the noise... -- Emmanuel Charpentier Le lundi 17 octobre 2016 13:55:14 UTC+2, vdelecroix a écrit : > > CDF is the name of a Python variable not a ty

Re: [sage-support] How to return an RDF (or CDF) value from a Cython function ?

2016-10-17 Thread Jeroen Demeyer
On 2016-10-17 15:10, Emmanuel Charpentier wrote: Thank you Vincent. this is much clearer. It seems that I have some things left to understand about the Sage class and types hierarchies. There is a difference between a type and a parent. A parent is a mathematical object. It is the mathematica

Re: [sage-support] How to return an RDF (or CDF) value from a Cython function ?

2016-10-17 Thread Emmanuel Charpentier
I think I already understood this distinction between type and parent. What was not clear (and still is not, but I have homework to do about this before making new noise on the list...) is how this translates in terms of (Python) programming. Provisorily, I conclude : - type : look for some

[sage-support] Installing Sage 7.3

2016-10-17 Thread Jack Foster
After downloading the .dmg file and dragging it to my Applications folder, I go to it's location via terminal: cd /Applications/SageMath Then, when I try to run sage: ./sage I get this error message ERROR: The Sage installation tree has moved from /Users/buildslave-sage/slave/binary_pkg/b

[sage-support] Re: Installing Sage 7.3

2016-10-17 Thread Jack Foster
I did drag the SageMath file, not the .dmg - sorry, I was unclear. On Monday, October 17, 2016 at 3:16:21 PM UTC+1, Jack Foster wrote: > > After downloading the .dmg file and dragging it to my Applications folder, > I go to it's location via terminal: > > cd /Applications/SageMath > > Then, when

Re: [sage-support] Installing Sage 7.3

2016-10-17 Thread Vincent Delecroix
It seems that you used the wrong procedure. As mentioned in the error message that you copied 1. Open the .tar.bz2 archive (or .dmg on OSX) 2. Move the SageMath folder/app to where you want it to be. You can also rename the directory now. The step 2 is *not* about moving the dmg file but only

Re: [sage-support] Installing Sage 7.3

2016-10-17 Thread Jack Foster
I did drag the SageMath file, not the .dmg - sorry, I was unclear. On Monday, October 17, 2016 at 3:21:12 PM UTC+1, vdelecroix wrote: > > It seems that you used the wrong procedure. As mentioned in the error > message that you copied > > 1. Open the .tar.bz2 archive (or .dmg on OSX) > > 2. Move

Re: [sage-support] Installing Sage 7.3

2016-10-17 Thread Jack Foster
By "it" I meant the SageMath file, not the .dmg - sorry, I was unclear. I followed the instructions exactly but it won't work. On Monday, October 17, 2016 at 3:21:12 PM UTC+1, vdelecroix wrote: > > It seems that you used the wrong procedure. As mentioned in the error > message that you copied