[sage-support] Re: integer linear programming in Sage?

2008-10-09 Thread Simon King

Dear John,

On Oct 8, 10:01 pm, John H Palmieri [EMAIL PROTECTED] wrote:
...
 This may be a silly question, but integer linear programming seems to
 be about maximizing some quantity relative to constraints given by a
 matrix equality (or inequality), where everything is happening over
 the integers.  How does this relate to finding integer solutions to a
 matrix equation?

Certainly I am not expert for ILP, but I did some applications of ILP
in 3-dimensional topology. And in that application, ILP always was
about finding non-negative integer solutions of a linear system of
equalities with integer coefficients.

So, nothing about maximizing.

Actually this is a major building block for Wolfgang Haken's theory of
normal surfaces, and thus for certain classification algorithms for a
large class of closed 3-manifolds.

 I find myself wanting to do something similar: find *all* solutions to
 Ax = b, where A, x, and b have non-negative integer entries.  I'm
 trying to figure out if the various responses here will help me.  In
 the situation of interest to me, I know that there are only finitely
 many solutions, and I know one solution.

In the above-mentioned application, you would have b=0, and then there
are *finitely* many non-neg integer solutions (fundamental
solutions) that additively generate all non-neg integer solutions. And
IIRC, for finding the fundamental solutions, you need to detect the
smallest integer points on the edges of the cone of non-negative
solutions to the equation - so, this indeed involves optimisation.

However, it seems that the problem you are interested in is classical
as well, and therefore I suspect you find a solution in
 A. Schrijver:
 Theory of linear and integer programming.
 Wiley-Interscience, Chichester 1986.

Given the various applications, it would be great to have high-
performance ILP in Sage!

Yours
 Simon

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] problem with sagetex

2008-10-09 Thread wiso

I've some problem using sagetex with LaTeX. If I try:

pdflatex prova.tex
sage prova.sage

Traceback (most recent call last):
  File prova.py, line 3, in module
import sagetex
ImportError: No module named sagetex


now I'm working in my directory, but if copy /usr/share/texmf/tex/
latex/sage/sagetex.py in my directory all work. Why sage can't find
sagetex.py ?

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: URGENT - Problem with installing sage on suse10.1

2008-10-09 Thread Ines

I install gcc-4.2.4 in /usr/local
then I set LD_LIBRARY_PATH in /usr/local/lib by :

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH

And SAGE works !
Thank you very much,
Ines.

On 8 oct, 21:43, Ines Abdeljaoued-TEJ [EMAIL PROTECTED] wrote:
 Hi !

 Le Tuesday 07 October 2008 14:57:35 Michael Abshoff, vous avez écrit :

  On Mon, Oct 6, 2008 at 1:03 PM, Ines Abdeljaoued-TEJ [EMAIL PROTECTED] 
  wrote:
   Hi !

   Now I am using gcc-4.2.4 and I have to update libstdc++.SO.6...
   I join to this email the compressed install.log

   Thanks for help,
   Regards, Ines.

  Hi Ines,

  sorry, I was offline for a couple days. When you use the new gcc (I
  assume you add it to $PATH) you also need to point LD_LIBRARY_PATH to
  include the directory of libstdc++.so.

 It's ok for gcc; but how can I point LD_LIBRRY_PATH to libstdc++.so ?

 Regards,

 Ines.

  Cheers,

  Michael
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Cython editor

2008-10-09 Thread Pierre

the gedit editor, shipped with ubuntu and most gnome-based systems, is
much underrated, it is in fact a very good choice. It is highly
configurable, comparable to emacs i dare say, and you use python
instead of lisp to configure it ! for example i have easily added to
gedit a couple of tools to look for the definition of a function in
SAGE's source code, or even to complete what i'm typing.

On Oct 9, 7:38 am, didier deshommes [EMAIL PROTECTED] wrote:
 On Thu, Oct 9, 2008 at 1:04 AM, cesarnda [EMAIL PROTECTED] wrote:
  do this, also vi can do that. The reason I asked this question was
  just to know standard editor you are using to program in cython. Maybe
  I could have found out about another editor.

 I use emacs, which has a decent pyrex/cython mode, but emacs with
 python-mode also works fine with writing cython/pyrex.

 didier
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] integer linear programming in Sage?

2008-10-09 Thread Paul Zimmermann

   This may be a silly question, but integer linear programming seems to
   be about maximizing some quantity relative to constraints given by a
   matrix equality (or inequality), where everything is happening over
   the integers.  How does this relate to finding integer solutions to a
   matrix equation?

for example you could maximize vx with constraint Ax = b for a random vector
v, and do the same for Ax = b. If a solution exists, it should be found this
way.

   I find myself wanting to do something similar: find *all* solutions to
   Ax = b, where A, x, and b have non-negative integer entries.  I'm
   trying to figure out if the various responses here will help me.  In
   the situation of interest to me, I know that there are only finitely
   many solutions, and I know one solution.

By rotating the vector v, you will find solutions on the convex hull of the
solution set with the (very naive) algorithm above.

Paul Zimmermann

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: URGENT - Problem with installing sage on suse10.1

2008-10-09 Thread Ines

Hi !
How can I save worksheet on .pdf ?
Regards, Ines.

On 9 oct, 13:24, Ines [EMAIL PROTECTED] wrote:
 I install gcc-4.2.4 in /usr/local
 then I set LD_LIBRARY_PATH in /usr/local/lib by :

 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
 export LD_LIBRARY_PATH

 And SAGE works !
 Thank you very much,
 Ines.

 On 8 oct, 21:43, Ines Abdeljaoued-TEJ [EMAIL PROTECTED] wrote:

  Hi !

  Le Tuesday 07 October 2008 14:57:35 Michael Abshoff, vous avez écrit :

   On Mon, Oct 6, 2008 at 1:03 PM, Ines Abdeljaoued-TEJ [EMAIL PROTECTED] 
   wrote:
Hi !

Now I am using gcc-4.2.4 and I have to update libstdc++.SO.6...
I join to this email the compressed install.log

Thanks for help,
Regards, Ines.

   Hi Ines,

   sorry, I was offline for a couple days. When you use the new gcc (I
   assume you add it to $PATH) you also need to point LD_LIBRARY_PATH to
   include the directory of libstdc++.so.

  It's ok for gcc; but how can I point LD_LIBRRY_PATH to libstdc++.so ?

  Regards,

  Ines.

   Cheers,

   Michael
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Cython editor

2008-10-09 Thread Jason Grout

Pierre wrote:
 the gedit editor, shipped with ubuntu and most gnome-based systems, is
 much underrated, it is in fact a very good choice. It is highly
 configurable, comparable to emacs i dare say, and you use python
 instead of lisp to configure it ! for example i have easily added to
 gedit a couple of tools to look for the definition of a function in
 SAGE's source code, or even to complete what i'm typing.
 

Do you have these changes posted somewhere?  I'd like to try it out, if 
possible.

Thanks,

Jason


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: problem with sagetex

2008-10-09 Thread Jason Grout

wiso wrote:
 I've some problem using sagetex with LaTeX. If I try:
 
 pdflatex prova.tex
 sage prova.sage
 
 Traceback (most recent call last):
   File prova.py, line 3, in module
 import sagetex
 ImportError: No module named sagetex
 
 
 now I'm working in my directory, but if copy /usr/share/texmf/tex/
 latex/sage/sagetex.py in my directory all work. Why sage can't find
 sagetex.py ?

Python can't find the sagetex.py module because it knows nothing about 
the tex system or its directory tree.  Putting it in the current 
directory makes it so that python can find sagetex.py.   You can also 
put it various other places, just like installing any python module.

Jason


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: problem with sagetex

2008-10-09 Thread kcrisman

Related question:  Where is the 'best' place to put the sagetex
folder?  I have tried a lot of variations on the various texmf folders
(I seem to have an abundance of them, including a texmf-dist which is
where my latex looks for things.  It only seems to be looking in latex/
base/, though.

- kcrisman

On Oct 9, 6:30 am, Jason Grout [EMAIL PROTECTED] wrote:
 wiso wrote:
  I've some problem using sagetex with LaTeX. If I try:

  pdflatex prova.tex
  sage prova.sage

  Traceback (most recent call last):
    File prova.py, line 3, in module
      import sagetex
  ImportError: No module named sagetex

  now I'm working in my directory, but if copy /usr/share/texmf/tex/
  latex/sage/sagetex.py in my directory all work. Why sage can't find
  sagetex.py ?

 Python can't find the sagetex.py module because it knows nothing about
 the tex system or its directory tree.  Putting it in the current
 directory makes it so that python can find sagetex.py.   You can also
 put it various other places, just like installing any python module.

 Jason
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: problem with sagetex

2008-10-09 Thread wiso

I'm using /usr/share/texmf/tex/latex/sage

/usr/share/texmf is the latex root on openSuSE

On 9 Ott, 17:23, kcrisman [EMAIL PROTECTED] wrote:
 Related question:  Where is the 'best' place to put the sagetex
 folder?  I have tried a lot of variations on the various texmf folders
 (I seem to have an abundance of them, including a texmf-dist which is
 where my latex looks for things.  It only seems to be looking in latex/
 base/, though.

 - kcrisman

 On Oct 9, 6:30 am, Jason Grout [EMAIL PROTECTED] wrote:

  wiso wrote:
   I've some problem using sagetex with LaTeX. If I try:

   pdflatex prova.tex
   sage prova.sage

   Traceback (most recent call last):
     File prova.py, line 3, in module
       import sagetex
   ImportError: No module named sagetex

   now I'm working in my directory, but if copy /usr/share/texmf/tex/
   latex/sage/sagetex.py in my directory all work. Why sage can't find
   sagetex.py ?

  Python can't find the sagetex.py module because it knows nothing about
  the tex system or its directory tree.  Putting it in the current
  directory makes it so that python can find sagetex.py.   You can also
  put it various other places, just like installing any python module.

  Jason
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] importing SAGE scripts

2008-10-09 Thread john_perry_usm

Hi,

I have a small library of SAGE functions. I've saved it as
somefile.py. I can import it and run it in SAGE using
 import somefile.py
 somefile.read_blah()

However, this works only as long as somefile.py uses only Python
commands  structures. If I try to define a PolynomialRing, it
complains that the global name 'PolynomialRing' is not defined.

How do I get around this? I tried renaming it as somefile.sage but
that won't import at all.

regards
john perry
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: importing SAGE scripts

2008-10-09 Thread Martin Albrecht

On Thursday 09 October 2008, john_perry_usm wrote:
 Hi,

 I have a small library of SAGE functions. I've saved it as
 somefile.py. I can import it and run it in SAGE using

  import somefile.py
  somefile.read_blah()

 However, this works only as long as somefile.py uses only Python
 commands  structures. If I try to define a PolynomialRing, it
 complains that the global name 'PolynomialRing' is not defined.

 How do I get around this? I tried renaming it as somefile.sage but
 that won't import at all.

try to add

from sage.all import *

at the top of the file.

Cheers,
Martin


-- 
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0x8EF0DC99
_www: http://www.informatik.uni-bremen.de/~malb
_jab: [EMAIL PROTECTED]


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: importing SAGE scripts

2008-10-09 Thread john_perry_usm

Aren't I embarassed. It's the FIRST LINE of the help screen.

regards
john perry

On Oct 9, 12:27 pm, john_perry_usm [EMAIL PROTECTED] wrote:
 Hi,

 I have a small library of SAGE functions. I've saved it as
 somefile.py. I can import it and run it in SAGE using

  import somefile.py
  somefile.read_blah()

 However, this works only as long as somefile.py uses only Python
 commands  structures. If I try to define a PolynomialRing, it
 complains that the global name 'PolynomialRing' is not defined.

 How do I get around this? I tried renaming it as somefile.sage but
 that won't import at all.

 regards
 john perry
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Export html cell to PDF or DVI

2008-10-09 Thread Chris Fronk

Does anyone know of a way in Sage to export the output of a %html cell
to a pdf or dvi file?

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Cython editor

2008-10-09 Thread Robert Bradshaw

I use xcode (OS X) and emacs. Both can be configured to  
recognize .pyx files as Python files, and if you can configure your  
Eclipse plugin to do the same that would probably be ideal for you  
(or, even better, modify the plugin to recognize cdef methods, etc.)

On Oct 8, 2008, at 10:04 PM, cesarnda wrote:

 yes I know, but If I use that same editor for Java or C and I want it
 to indent with 5 spaces when I program with those lenguage I will have
 to reconfigure it. In Eclipse, with the python plugin I don't have to
 do this, also vi can do that. The reason I asked this question was
 just to know standard editor you are using to program in cython. Maybe
 I could have found out about another editor. This question had by no
 mean, to ask about what is an editor, how can I configure my editor,
 is my editor configurable, where can I download an editor? The
 question was meant to find out if someone was using a plugin for an
 editor (like eclipse or netbeans), or there was a special editor for
 cython (like there are for python). It's like Eclipse and Android, I
 might be using netbeans as the editor for my android projects and ask
 google, which editor are you using to program android? and they tell
 me: android (obviously this is not a good example because in the web
 page of android and in google conferences eclipse is the chosen
 editor, but let's just imagine that eclipse is not). As I mention,
 Eclipse works pretty fine with this kind of stuff  and also vi, but as
 I said, I just wanted to know what is the standard you are using, If
 you are only programming in cython or in python, then it wouldn't
 help, because I know I can configure my editor to indent 4 spaces, but
 if I want my programs in C, Java or Maxima to have 5 indents it
 wouldn't work. Another option might be that I use Eclipse to program
 all but cython, and vi to program in cython. But as I repeat (again),
 this question was not about editors, the question was: what do you
 usually use as a cython editor? which Simon King and Carlo Hamalainen
 answered pretty fine, I thought I have ended it with the comment about
 the plugin for eclipse. But I think later the question took another
 direction. I am very sorry if I have made you waste your time with
 this simple question, but as I said, it was to know about what you
 were using, I never asked about teaching me how to use an editor. I
 will try to make clearer questions the next time I post something
 here.

 On 8 oct, 20:20, Joel B. Mohler [EMAIL PROTECTED] wrote:
 On Wednesday 08 October 2008 06:10:16 pm cesarnda wrote:

 but usually they give 5 spaces instead of 4

 That's not the usually that I experience.  But, even if it is  
 what your
 editor does, it is almost certainly configurable.

 --
 Joel
 


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Speeding up the for loop

2008-10-09 Thread Byungchul Cha


I am using sage for my calc III students. The following short code
produces about 500 points on a sphere.

pts=[]; number_of_points=500
for t1 in srange(0, pi, n(pi/sqrt(number_of_points))):
  for t2 in srange(0, 2*pi, n(2*pi/sqrt(number_of_points))):
pts.append((sin(t1)*cos(t2), sin(t1)*sin(t2), cos(t1)))
show(point(pts))

My question is, though, that sage takes, it seems to me, longer time
to execute this than I would expect. (CPU time: 6.66 s,  Wall time:
48.84 s) Am I making some stupid mistake in the above code, or sage
does something unnecessary, which causes the delay? In my (naive)
point of view, plotting as many as 500 points shouldn't take that long
time... Thanks.


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Speeding up the for loop

2008-10-09 Thread Marshall Hampton

I think the culprit is the pi in the srange, which gets Maxima too
involved (and maxima as called through sage is slow).  This may
improve very soon as there is some work being done to shift basic
symbolic things like pi to a more python-based backend.

Anyway for the moment you can avoid this by declaring your own numeric
pi.  The fastest I could do this without using fast_float was:

pts=[];
number_of_points=500
mypi = n(pi)
for t1 in srange(0, mypi, n(pi/sqrt(number_of_points))):
st1 = sin(t1)
ct1 = cos(t1)
for t2 in srange(0, 2*mypi, n(2*pi/sqrt(number_of_points))):
pts.append((st1*cos(t2), st1*sin(t2), ct1))
show(point3d(pts))

...taking the sin(t1) and cos(t1) calc out of the inner loop helps a
bit as well.  That was much faster for me than your original code.

I had to use point3d to plot, what version of sage are you using?

Cheers,
Marshall Hampton

On Oct 9, 2:02 pm, Byungchul Cha [EMAIL PROTECTED] wrote:
 I am using sage for my calc III students. The following short code
 produces about 500 points on a sphere.

 pts=[]; number_of_points=500
 for t1 in srange(0, pi, n(pi/sqrt(number_of_points))):
   for t2 in srange(0, 2*pi, n(2*pi/sqrt(number_of_points))):
 pts.append((sin(t1)*cos(t2), sin(t1)*sin(t2), cos(t1)))
 show(point(pts))

 My question is, though, that sage takes, it seems to me, longer time
 to execute this than I would expect. (CPU time: 6.66 s,  Wall time:
 48.84 s) Am I making some stupid mistake in the above code, or sage
 does something unnecessary, which causes the delay? In my (naive)
 point of view, plotting as many as 500 points shouldn't take that long
 time... Thanks.
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Speeding up the for loop

2008-10-09 Thread Jason Grout

Marshall Hampton wrote:
 I think the culprit is the pi in the srange, which gets Maxima too
 involved (and maxima as called through sage is slow).  This may
 improve very soon as there is some work being done to shift basic
 symbolic things like pi to a more python-based backend.
 
 Anyway for the moment you can avoid this by declaring your own numeric
 pi.  The fastest I could do this without using fast_float was:
 
 pts=[];
 number_of_points=500
 mypi = n(pi)
 for t1 in srange(0, mypi, n(pi/sqrt(number_of_points))):
 st1 = sin(t1)
 ct1 = cos(t1)
 for t2 in srange(0, 2*mypi, n(2*pi/sqrt(number_of_points))):
 pts.append((st1*cos(t2), st1*sin(t2), ct1))
 show(point3d(pts))
 
 ...taking the sin(t1) and cos(t1) calc out of the inner loop helps a
 bit as well.  That was much faster for me than your original code.
 



Here's a version that's about 6x faster yet again by avoiding yet more 
calculations in the inner loop and using the python sin/cos instead of 
the sage sin/cos:

pts=[];
number_of_points=500
twopi = 2*RR(pi)
mystep = twopi/math.sqrt(number_of_points)
mysin,mycos = math.sin,math.cos
for t1 in srange(0, twopi/2, mystep/2):
 st1 = mysin(t1)
 ct1 = mycos(t1)
 for t2 in srange(0, twopi, mystep):
 pts.append((st1*mycos(t2), st1*mysin(t2), ct1))


Thanks,

Jason


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Sage server incredibly slow

2008-10-09 Thread mabshoff



On Oct 9, 1:20 pm, Maike [EMAIL PROTECTED] wrote:
 Hello,

Hii Maike,

 I tried using the sage server at sagenb.org. Generally, it's great,
 but sometimes it's just incredibly slow. I'm having to wait about a
 minute for cells to be executed or worksheets to be loaded or saved
 sometimes.

 Is everyone having these problems or am I doing something wrong?

Every so often Sage backs up all the data and that takes a while.
William did optimize a bunch of the backup code, but there is
certainly still work to do.


 Thanks for any help!
 Maike

Cheers,

Michael
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Using Sage with a large number of undergraduate students.

2008-10-09 Thread mabshoff



On Oct 8, 5:48 am, Pierre [EMAIL PROTECTED] wrote:
  Ironically pretty much everything works under Solaris now but the
  notebook. I think that issue is easy to fix (RAND_MAX related

 incidentally, is it possible to get knoboo to work on solaris instead
 of the notebook ?

 (sorry if this question is somewhat besides the point)

No problem, but I think it could work. The issue right now with the
notebook on Solaris is that the key generation takes forever due to
sucky entropy caused by RANDMAX issues. I can fix that, but I want to
make sure that I do not open a gaping security issue.

Cheers,

Michael
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Speeding up the for loop

2008-10-09 Thread William Stein

Byungchul Cha wrote:
 
 I am using sage for my calc III students. The following short code
 produces about 500 points on a sphere.
 
 pts=[]; number_of_points=500
 for t1 in srange(0, pi, n(pi/sqrt(number_of_points))):
   for t2 in srange(0, 2*pi, n(2*pi/sqrt(number_of_points))):
 pts.append((sin(t1)*cos(t2), sin(t1)*sin(t2), cos(t1)))
 show(point(pts))
 
 My question is, though, that sage takes, it seems to me, longer time
 to execute this than I would expect. (CPU time: 6.66 s,  Wall time:
 48.84 s) Am I making some stupid mistake in the above code, or sage
 does something unnecessary, which causes the delay? In my (naive)
 point of view, plotting as many as 500 points shouldn't take that long
 time... Thanks.

Try putting
   from math import sin, cos
before the rest of your code to use the double precision C-library's
sin and cosine functions instead.

William


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Using Sage with a large number of undergraduate students.

2008-10-09 Thread William Stein

mabshoff wrote:
 
 
 On Oct 8, 5:48 am, Pierre [EMAIL PROTECTED] wrote:
 Ironically pretty much everything works under Solaris now but the
 notebook. I think that issue is easy to fix (RAND_MAX related
 incidentally, is it possible to get knoboo to work on solaris instead
 of the notebook ?

 (sorry if this question is somewhat besides the point)
 
 No problem, but I think it could work. The issue right now with the
 notebook on Solaris is that the key generation takes forever due to
 sucky entropy caused by RANDMAX issues. I can fix that, but I want to
 make sure that I do not open a gaping security issue.

The way we used to fix this before GNUtls stopped totally sucking
at generating keys, was we used openssl to generate keys if it was
installed on the system, and if not only then fell back to using
GNUtls.

  -- William

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Sage server incredibly slow

2008-10-09 Thread William Stein

mabshoff wrote:
 
 
 On Oct 9, 1:20 pm, Maike [EMAIL PROTECTED] wrote:
 Hello,
 
 Hii Maike,
 
 I tried using the sage server at sagenb.org. Generally, it's great,
 but sometimes it's just incredibly slow. I'm having to wait about a
 minute for cells to be executed or worksheets to be loaded or saved
 sometimes.

 Is everyone having these problems or am I doing something wrong?
 
 Every so often Sage backs up all the data and that takes a while.
 William did optimize a bunch of the backup code, but there is
 certainly still work to do.
 

There is substantial work to be done, because sagenb.org just gets
*hammered*.  In the last few weeks almost 1000 separate people
opened new accounts, and people view hundreds of the interactive
documentation/help pages every day.

You might want to try one of the alternative servers:
https://sage.math.washington.edu:8102
https://sage.math.washington.edu:8103
as those get a lot less traffic.

William

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: problem with sagetex

2008-10-09 Thread Dan Drake
On Thu, 09 Oct 2008 at 08:23AM -0700, kcrisman wrote:
 Related question:  Where is the 'best' place to put the sagetex
 folder?  I have tried a lot of variations on the various texmf folders
 (I seem to have an abundance of them, including a texmf-dist which is
 where my latex looks for things.  It only seems to be looking in
 latex/ base/, though.

SageTeX has two parts: a TeX part and a Python/Sage part. Both TeX and
Sage need to find the correct file. TeX and Python look in totally
different places for files, so to use SageTeX you must simultaneously
please both systems.

On Unixy systems, I think it's common for TeX distributions
(well...TeXLive at any rate) to look in your home directory for a texmf/
tree. If you put files there, I *think* they'll be found
automatically...I also do texhash $HOME/texmf which creates an ls-R
file; then certainly the files will be found.

Inside the texmf directory, I have a typical TeX directory tree
hierarchy; I don't know if that's necessary.


   now I'm working in my directory, but if copy /usr/share/texmf/tex/
   latex/sage/sagetex.py in my directory all work. Why sage can't find
   sagetex.py ?

That might be because the ls-R files haven't been updated. Running
`texhash' as root with the proper options should fix that, although I
would avoid dropping single files into such directories; they're likely
to be overwritten during an upgrade. 

I've tried to include logic in SageTeX so that things are automatically
found, but haven't found anything satisfactory yet.

Dan

-- 
---  Dan Drake [EMAIL PROTECTED]
-  KAIST Department of Mathematical Sciences
---  http://mathsci.kaist.ac.kr/~drake


signature.asc
Description: Digital signature


[sage-support] Re: Speeding up the for loop

2008-10-09 Thread Byungchul Cha


Thanks for all of your help. I did

1. Importing sin and cos using from math import sin, cos
2. Removing pi and sqrt out of the loops, following Jason's
suggestion:
twopi = 2*n(pi); mystep = twopi/n(sqrt(number_of_points))

and I got CPU time: 0.21 s,  Wall time: 0.25 s. This looks much
reasonable. Again, thanks for everyone's help.

BTW, I'm using the latest version of sage and both point and point3d
work for me.

On Oct 9, 6:13 pm, William Stein [EMAIL PROTECTED] wrote:
 Byungchul Cha wrote:

  I am using sage for my calc III students. The following short code
  produces about 500 points on a sphere.

  pts=[]; number_of_points=500
  for t1 in srange(0, pi, n(pi/sqrt(number_of_points))):
    for t2 in srange(0, 2*pi, n(2*pi/sqrt(number_of_points))):
      pts.append((sin(t1)*cos(t2), sin(t1)*sin(t2), cos(t1)))
  show(point(pts))

  My question is, though, that sage takes, it seems to me, longer time
  to execute this than I would expect. (CPU time: 6.66 s,  Wall time:
  48.84 s) Am I making some stupid mistake in the above code, or sage
  does something unnecessary, which causes the delay? In my (naive)
  point of view, plotting as many as 500 points shouldn't take that long
  time... Thanks.

 Try putting
    from math import sin, cos
 before the rest of your code to use the double precision C-library's
 sin and cosine functions instead.

 William
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---