Re: [sage-devel] test Flask-based notebook

2011-02-08 Thread didier deshommes
On Mon, Feb 7, 2011 at 3:27 PM, Jason Grout jason-s...@creativetrax.com wrote:
 It would also be very interesting to see if this code is more scalable than
 the current notebook.  For example, I wonder if running this flask-based

This is somewhat off-topic, but has anyone considered celery for
executing computation-heavy tasks?
http://ask.github.com/celery/getting-started/introduction.html . The
idea is to send jobs/tasks to a remote server that does the grunt
work and retrieve the result later ( possibly from a db) when it is
available. One obvious use case is when you don't want a web page to
hang even if you're doing something cpu/db-heavy on the server (e.g.
deleting/updating millions of entries in a database). Scaling this
straightforward: just add another machine itself running celery too.

didier

-- 
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


Re: [sage-devel] test Flask-based notebook

2011-02-07 Thread didier deshommes
On Mon, Feb 7, 2011 at 3:27 PM, Jason Grout jason-s...@creativetrax.com wrote:
 It would also be very interesting to see if this code is more scalable than
 the current notebook.  For example, I wonder if running this flask-based
 notebook on top of, say, nginx using uwsgi, would scale better?  It would
 also be interesting to see if changing our polling strategy to long-polling
 would help (I don't think we long-poll currently, do we? See
 http://en.wikipedia.org/wiki/Push_technology for a definition of
 long-polling).

Keep in mind that if you are using long-polling techniques you cannot
use servers that adhere to the  WSGI standard, since it's not part of
it. uwsgi has some experimental support for asynchronous operations
but you must know what you're doing:
http://projects.unbit.it/uwsgi/wiki/AsyncSupport .

didier


 Of course, back up your worksheets before doing this, or start the notebook
 with a different notebook directory.

 Thanks,

 Jason

 --
 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


-- 
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


[sage-devel] Re: Cardinality of a set...

2009-02-25 Thread didier deshommes

+1 for s.card() but I would suggest also making s.cardinality() an
alias for it.

didier

On Wed, Feb 25, 2009 at 5:43 PM, Florent Hivert
florent.hiv...@univ-rouen.fr wrote:

      Dear All,

 We working in combinat have a problem of naming convention which is likely to
 concern everyone in sage. As you can guess, in combinatorics we like to count
 sets an iterate through them. So we designed some objects called for now
 CombinatorialClass which represent a finite or countable set sorted in a
 particular order (eg the permutations of 4 in the lexicographic order). Such a
 set can be counted and iterated through.

 My question is the following: we are looking for a good name for the method
 which returns the number of element of a set S.

 Note that we will widely implement this method for sets which can be of any
 combinatorial use, including for example the sets of natural numbers N, the
 finite rings and fields Z/pZ, any finite groups. So we want the name to be
 consistent through all sage.

 Until now we use len(S) but this is bad because in python specification
 __len__ must returns a python int, whereas we want to have an arbitrary large
 integer and even +infinity:

   object.__len__(self)
      Called to implement the built-in function len(). Should return the
      length of the object, an integer = 0.

 We were going to use s.count() until someone pointed out than there is a
 collision with a standard python methods for list.

   s.count(x)
      return number of i‘s for which s[i] == x

 Other suggestion are:
  - s.length() : this is more ore less coherent with data structures but
 seems to me to be too far from the mathematical thinking;
  - s.cardinality() : we don't like it because this is too long. Remember that
 we will type it every two lines;
  - s.card() is currently my favorite...

 Sorry for asking a question and giving at the same time my opinion. But I'd
 like this decision to be taken as soon as possible: there are a bunch of patch
 waiting only this answer...

 If you also have any suggestion for CombinatorialClass which was good in MuPAD
 when (object oriented) class where called domains but which is now too much
 confusing... Thanks for your help and comments.

 Cheers,

 Florent

 


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



[sage-devel] Re: The Spies Sage Development Prize

2008-10-10 Thread didier deshommes

On Fri, Oct 10, 2008 at 4:57 AM, William Stein [EMAIL PROTECTED] wrote:
 The first annual Spies Sage Development Prize is awarded to Michael Abshoff 
 for
 his superb work improving the overall quality of the sage development process,
 making numerous high quality Sage releases, leading the way in drastically
 reducing memory leaks in Sage, and porting Sage to run on Windows, Solaris
 and 64-bit OS X.

 Please join me in congratulating Michael Abshoff!  ([EMAIL PROTECTED])

This is well-deserved: Michael never seems to run out of steam:
merging patches, testing new builds, mercilessly hunting mem leaks and
being all-around helpful in irc. Congratulation!

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: Proposal for Inclusion into Sage: Sphinx, Docutils, Pygments, and Jinja

2008-09-30 Thread didier deshommes

On Mon, Sep 29, 2008 at 7:16 PM, Mike Hansen [EMAIL PROTECTED] wrote:
 VOTE:
  [ ] Yes, include these in Sage
  [ ] No, do not (please explain)
  [ ] Hmm, I have questions (please ask).

+1, and a question. As far as I know, pygments doesn't have
syntax-highlighting for pyrex files. If you wrote your own, it would
be nice if you could contribute back to the pygments project :)

see http://dev.pocoo.org/projects/pygments/ticket/359

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: Proposal for inclusion of GINAC/pynac-0.1 in Sage.

2008-08-25 Thread didier deshommes

On Mon, Aug 25, 2008 at 4:59 AM, William Stein [EMAIL PROTECTED] wrote:

 Hi,

 I propose that pynac be included in Sage.

 VOTE:
  [ ] Yes, include Pynac in Sage
  [ ] No, do not (please explain)
  [ ] Hmm, I have questions (please ask).

I have a question: what will happen to gfurnish's work? Is it going to
be completely abandoned?

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: xmaxima is built if you have tcl/tk!

2008-06-24 Thread didier deshommes

On Tue, Jun 24, 2008 at 8:32 AM, Michael Abshoff
[EMAIL PROTECTED] wrote:
 I am not sure if there is any harm if Maxima builds it. When woulds building
 xmaxima cause a problem?

I'm sure it doesn't; the issue is that sage builds something behind
your back, so you won't find it if you're not looking for it. Also,
the behavior is not consistent since this seems to depend the user's
machine (ie tk vs non-tk).

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: lite.sagemath.org

2008-06-09 Thread didier deshommes

Why are sage developers missing from
http://lite.sagemath.org/development-ack.html ? Oh I see.. they're on
the dev map. Could there be an explicit link to this page from
http://lite.sagemath.org/development-ack.html ?

On Mon, Jun 9, 2008 at 12:25 PM, William Stein [EMAIL PROTECTED] wrote:

 Hi,

 So we're going to switch lite.sagemath.org to be the official
 sage website soon.  Could you take a quick glance at it
 and see if there is anything that is *horribly totally wrong*
 in your humble opinion.  If not, we'll be good to go.
 I'm not trying to solicit little nitpicks with this email, but
 trying to avoid major blunders.

  --William

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

 


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: hg clone and symlinks...

2008-06-05 Thread didier deshommes

On Thu, Jun 5, 2008 at 2:36 PM, Glenn H Tarbox, PhD [EMAIL PROTECTED] wrote:
 So, I propose there's a misunderstanding of Hg and clone vs. branch.  I
 claim that branching is a trivial operation, switching between branches
 is fast, and that the entire point of DVCS is lost with the clone
 operation.

Yes, branching is trivial but I still prefer cloning. I've worked with
both methods of development (branch or clone) and I prefer cloning
because:
- I don't need to think which branch I'm working on at any given moment.
- I don't have worry about merging my changes back into main at some
point in time. I suspect this is more psychological than anything.

But then again, I found branching to be useful for moderate-to-massive
rewrites and the work I've done on sage has mainly been bug fixes
(which are mostly small-ish rewrites).


 P.S.  Below is a broader discussion of the issue...

 WARNING: its entirely up to you whether you wanna get into this... and
 DVCS wars easily exceed politics and religion in the emotions and
 vitriol generated.

 The DVCS battle is currently between hg, bzr and git with hg giving up
 ground to bzr... and git being git

  opinion warning 

 IMHO, git is technically superior than the others but because Linus is
 such a git will likely not become mainstream... I personally believe
 there is a very intentional barrier to keep git users at the level of
 kernel hackers where folks pine for the day when you needed to be a hard
 core hacker to even dabble in linux... a cabal where only the anointed
 need apply.

 a shame, but such is life.

I think you are wrong about git not becoming mainstream. Git is being
made more and more popular and hip because of http://github.com . It's
a really impressive web app. This is the killer app for git, just as
the Launchpad is the killer app for bzr.  This is the kind of app
that Hg is missing and it's glaring.

On Thu, Jun 5, 2008 at 3:12 PM, William Stein [EMAIL PROTECTED] wrote:
 I was hoping you could write a little more about the sense in which you
 see that hg is giving up ground to bzr.  Are project switching from hg
 to bzr? Is this just a feature comparison?

My impression is that more new projects are being started in bzr
because of its nice integration with Launchpad.net.

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: time for cloning

2008-05-07 Thread didier deshommes

On Wed, May 7, 2008 at 2:27 PM, Nick Alexander [EMAIL PROTECTED] wrote:
   I just installed a fresh copy of Sage on my Mac and ran 'sage -clone
   blah', and it took almost 15 minutes to complete. Running 'sage -clone
   temp' a second time took just over one minute.  Neither of these, and
   especially not the first one, is about 30 seconds.

  Cloning a repository is limited by your disk's throughput and
  latency.  Your second run is working with a primed disk cache -- this
  says a lot about your disk's random access :)

Are you using a binary  install, or did you build from source? If
you're using a binary install of sage, cloning for the first time
rebuilds the entire sage library on top of cloning it. The subsequent
ones are much faster though.

didier


   This is on a 2.4 GHz Mac Book Pro.

  I have a similar machine and cloning is reasonably snappy.  I had an
  older Powerbook and the disk was ridiculously slow.

  You might find mercurial queues lets you work with fewer clones.

  Nick



  


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: Computing large Bernoulli numbers

2008-05-02 Thread didier deshommes

On Fri, May 2, 2008 at 3:40 PM, William Stein [EMAIL PROTECTED] wrote:

  On Fri, May 2, 2008 at 11:34 AM, Fredrik Johansson
  [EMAIL PROTECTED] wrote:
  

   Oleksandr Pavlyk reports on the Wolfram Blog that he has computed the
10 millionth Bernoulli number using Mathematica:

 http://blog.wolfram.com/2008/04/29/today-we-broke-the-bernoulli-record-from-the-analytical-engine-to-mathematica/
  
How does sage's Bernoulli number implementation compare? I'd like to
see bernoulli(10^7) in sage beating Mathematica's time. And then
computing the 20 millionth Bernoulli number...

  I couldn't find any information about the hardware that guy used.
  64-bit?  32-bit?
  1.8Ghz or 3Ghz?   Could somebody write and ask?

I  did earlier, and I hope he will answer.

didier


  Also, when I tried

 bernoulli(10^7+2)

  directly in Sage there were a couple of issues that arose, since that command
  is much more designed for smaller input.   I fixed those small issues.
  I guess we'll see in a week ..

  William



  


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: Computing large Bernoulli numbers

2008-05-02 Thread didier deshommes

Here is some more information about the machine used to compute this:

-- Forwarded message --
From: Oleksandr Pavlyk [EMAIL PROTECTED]
Date: Fri, May 2, 2008 at 4:29 PM
Subject: Re: Today We Broke the Bernoulli Record: From the Analytical
Engine to Mathematica
To: didier deshommes [EMAIL PROTECTED]


Hi Didier,

 I used Linux, with 64 bit AMD processor:

 AMD Opteron(tm) Processor 250
 cpu MHz : 1000.000
 cache size  : 1024 KB

 and 8GB of memory, but as I say in the blog, I did
 not use that much.

 The calculations were done using development build of
 Mathematica, but calculations will go through in any
 flavor of Mathematica version  6 as well, to the best of
 my knowledge.  Just run

 Timing[ result = BernoulliB[10^7]; ]

 It will take about twice longer on 32-bit processors,
 thus about 2 weeks.

 Please do not hesitate to ask further questions.

 Sincerely,
 Oleksandr Pavlyk



 On Fri, May 2, 2008 at 2:12 PM, didier deshommes [EMAIL PROTECTED] wrote:
  Hi Dr. Pavlyk,
   My question is in referrence to your blog post:
   
  http://blog.wolfram.com/2008/04/29/today-we-broke-the-bernoulli-record-from-the-analytical-engine-to-mathematica/
 
   - Do you have the specs of the machine you ran this off? CPU, memory, etc.
   - I assume this function is in the development version of mathematica?
 
   Thanks for your informative post!
 
   didier
 



On Fri, May 2, 2008 at 3:43 PM, didier deshommes [EMAIL PROTECTED] wrote:
 On Fri, May 2, 2008 at 3:40 PM, William Stein [EMAIL PROTECTED] wrote:
  
On Fri, May 2, 2008 at 11:34 AM, Fredrik Johansson
[EMAIL PROTECTED] wrote:

  
 Oleksandr Pavlyk reports on the Wolfram Blog that he has computed the
  10 millionth Bernoulli number using Mathematica:
  
 http://blog.wolfram.com/2008/04/29/today-we-broke-the-bernoulli-record-from-the-analytical-engine-to-mathematica/

  How does sage's Bernoulli number implementation compare? I'd like to
  see bernoulli(10^7) in sage beating Mathematica's time. And then
  computing the 20 millionth Bernoulli number...
  
I couldn't find any information about the hardware that guy used.
64-bit?  32-bit?
1.8Ghz or 3Ghz?   Could somebody write and ask?

  I  did earlier, and I hope he will answer.

  didier



  
Also, when I tried
  
   bernoulli(10^7+2)
  
directly in Sage there were a couple of issues that arose, since that 
 command
is much more designed for smaller input.   I fixed those small issues.
I guess we'll see in a week ..
  
William
  
  
  
  
  


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: trouble with linear algebra over CC and CDF

2008-04-15 Thread didier deshommes
On Fri, Apr 11, 2008 at 8:00 PM, Alex Ghitza [EMAIL PROTECTED] wrote:

  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1

  Hi,

  There are some inconsistencies in linear algebra over fields like CDF.
  Some trouble was already reported in #2256.  The following is another issue:

  sage: M = matrix(CDF, 2, 2, [(-1 - 2*I, 5 - 6*I), (-2 - 4*I, 10 - 12*I)])
  sage: M.is_invertible()
  True
  sage: M.determinant()
  5.3290705182e-15 + 1.7763568394e-15*I
  sage: M.inverse()
  [ 1.01330991616e+15 - 2.58956978574e+15*I -5.06654958079e+14 +
  1.29478489287e+15*I]
  [ 5.62949953421e+14 + 5.62949953421e+14*I -2.81474976711e+14 -
  2.81474976711e+14*I]

  So because of roundoff errors, Sage thinks that we have an invertible
  matrix.  But the code for echelon_form knows that it's not invertible:

  sage: M.echelon_form()
  [1.0 1.4
  + 3.2*I]
  [-2.22044604925e-16 - 4.4408920985e-16*I
  ~   0]
  sage: M.rank()
  1

  This behavior is inconsistent.  Either there is enough precision to
  decide that the matrix is invertible, or there isn't.  Doing this in two
  different ways should not yield two mutually exclusive answers.

  Similar problems occur over CC.

  I hope it's clear by now that I have no idea how CDF and friends
  actually work, so I don't know what would be a good solution or even
  whether such a solution should exist.  My initial guess would be that
  finding the determinant requires more computations so there is more
  precision loss than in computing the echelon form; in that case, maybe
  over such fields we should not base is_invertible() and inverse() on
  determinant() but rather on echelon_form().

This is now #2932: http://trac.sagemath.org/sage_trac/ticket/2932:

Just looking at the value of M.rank() should be enough, I think. Also,
M.rank() seems much faster than computing the determinant:
{{{
sage: M = matrix(CDF, 2, 2, [(-1 - 2*I, 5 - 6*I), (-2 - 4*I, 10 - 12*I)])
sage: %timeit M.rank()
100 loops, best of 3: 676 ns per loop
sage: %timeit M.det()
10 loops, best of 3: 2.81 µs per loop
}}}

Timings are comparable over ZZ,QQ,RR.

didier


  Note also that this problem does not seem to occur over RR or RDF.

  Best,
  Alex


  - --
  Alexandru Ghitza
  Assistant Professor
  Department of Mathematics
  Colby College
  Waterville, ME 04901
  http://bayes.colby.edu/~ghitza/
  -BEGIN PGP SIGNATURE-
  Version: GnuPG v2.0.7 (GNU/Linux)
  Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

  iD8DBQFH//uydZTaNFFPILgRArYKAJ4r9QOJNYSSCgVzSutUW7gEfcv3uQCfd3aj
  nYV2EFH6znwShoGL7q2BjRY=
  =74HR
  -END PGP SIGNATURE-

  


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: sage -n?

2008-04-15 Thread didier deshommes

On Tue, Apr 15, 2008 at 1:11 PM, Kiran Kedlaya [EMAIL PROTECTED] wrote:

  Currently the command-line option to start sage directly in (secure)
  notebook mode is -notebook. What do people think of adding a shorter
  alternative, such as sage -n? If people are wary about assigning
  single-letter options, then sage -nb is another possibility.

I would prefer sage -nb

didier


  Kiran

  


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: should bool(x 0) be False or an exception?

2008-04-09 Thread didier deshommes

On Wed, Apr 9, 2008 at 10:18 PM, Carl Witty [EMAIL PROTECTED] wrote:

  I'd like to reopen discussion of #2781, bool() for SymbolicEquation
  should raise an error when it doesn't know the answer.  Jason created
  a prototype patch to implement this, but gave up on it and closed the
  ticket when he was convinced that this is not pythonic.

  I like the raise an exception behavior, because it would eliminate
  questions asking why form1 and form2 below are different (from this
  sage-support thread 
 http://groups.google.com/group/sage-support/browse_thread/thread/79d0d6d94cfe9526#).
  (I have seen this exact problem at least twice on sage-support.)  What
  do you think?

-1
I like bool(x0) to be False by default if the answer is not known.
mhansen raised this great point that we rely so much on things like :
if (condition on x):
  do something

that it would be cumbersome to surround this statement with a try,catch block.

I'm only opposing this because it is unpythonic but I don't see any
reason not to define methods that have the same functionality for
SymbolicEquation but *can* raise an exception when appropriate.

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: mercurial -- plain text -- mercurial

2008-03-28 Thread didier deshommes
Thanks Martin,
I think the issue is that we want a version of our repository that has no
binary data in it for transparency. The virus part is just a  possible
scenario that has been blown out of proportion because of the way I asked
the question, since I didn't understand it well enough myself :)

didier

Forwarded conversation
Subject: [EMAIL PROTECTED] Posting error: sage-devel


From: *Martin Geisler* [EMAIL PROTECTED]
Date: Fri, Mar 28, 2008 at 5:47 AM
To: [EMAIL PROTECTED]


Hi,

I tried to post the following message to the SAGE group to participate
in the discussion about Mercurial. But I apparently have to register
first -- could you instead forward it?

 William Stein [EMAIL PROTECTED] writes:

  Carl Witty said:
  Second, are you worried about people checking in viruses, or
  people concealing a virus in the .hg directory without it being
  checked in?
 
  Both. Yes, I'm worried about people checking viruses. Yes, I'm
  also worried about people concealing a virus in the .hg directory
  without it being checked in.

 No matter what files I put in the .hg directory in my clone, they
 wont be copied to other clones via 'hg push' and 'hg pull'. So I
 don't see why you are afraid that I might put a virus there.

 The only way I could inject a virus into somebone elses Mercurial
 repository (without having direct write access to it) is to commit
 it and convince the other party to 'hg pull' from me.

 I think that checking that people do not commit stupid things (build
 products, virusses, etc) is more of a social problem. And still: if
 they do commit something bad, then (assuming you are using an OS
 that wont randomly execute files on your harddisk...) you can safely
 pull the changes since you can always strip them away again if you
 want.

--
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multi-Party Computation) to Python. See: http://viff.dk/.
--
From: *Martin Geisler* [EMAIL PROTECTED]
Date: Fri, Mar 28, 2008 at 8:14 AM
To: [EMAIL PROTECTED]



The following message is a courtesy copy of an article that has been
posted to gmane.comp.version-control.mercurial.general as well.

didier deshommes [EMAIL PROTECTED] writes:

 Hi everyone,
 Sage (http://www.sagemath.org/) uses hg for its source control and
 recently a question has come up about the possibility of doing the
 following:

  (1) export everything in the .hg repo to something (perhaps a ton of
 stuff) in plain text format,
  (2) delete .hg/ directory
  (3) do something that recovers the .hg/ directory from the output of (1).

From reading the messages in this thread I gather that you want the
plain text format to be able to inspect the files and make sure that
they have not been changed by a virus?

It is not necessary to have the repository contents in plain text to
do that -- all you need is to sign a trusted revision number with a
GnuPG key. You can then later verify the integrity of the repository.

The gpg Mercurial extension makes this (already easy step) even
easier: http://www.selenic.com/mercurial/wiki/index.cgi/GpgExtension

The point is that the revision number (the hexadecimal string printed
using, say, 'hg id') depends on *everything* in the repository. So it
is impossible for a virus to change any meta-data without also
disturbing the hash value.

You can therefore easily trust a repository given to you by a
stranger, as long as you verify the integrity (with 'hg verify') and
check that the revision of the repository is trusted.

If the tip-most revision is unknown to you, then you can always strip
the unknown revisions away using 'hg strip' and then start from a last
known good revision.

And please note that this property is not unique to Mercurial: all the
other modern revision control systems use the same technique to make
it easy to verify the integrity of a repository.

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: mercurial -- plain text -- mercurial

2008-03-27 Thread didier deshommes

On Wed, Mar 26, 2008 at 3:21 PM, Mike Hansen [EMAIL PROTECTED] wrote:

  It seems like the mercurial mailing list would be the best place to go for 
 this.

Done: http://selenic.com/pipermail/mercurial/2008-March/018133.html

didier


  Using queues has made me quite a bit more productive, and I'd like to
  avoid switching to a version control system without them.  Also, the
  git documentation leaves something to be desired compared to the
  Mercurial book.

  --Mike



  On Wed, Mar 26, 2008 at 12:12 PM, William Stein [EMAIL PROTECTED] wrote:
  
On Wed, Mar 26, 2008 at 1:18 PM, root [EMAIL PROTECTED] wrote:

  William,

  git can do this. Since git uses a hash it will always regenerate the
  same hash from the same file.

  In fact, git uses hashes all the way down the tree so you can just
  look at the hash code of the root of the tree to see if anything
  changes. Equal hash codes, even across the net, imply exact copies
  of the source tree.

  Axiom uses arch, cvs, svn, and git. I have used several other systems
  in the past. Now all of the primary work is in git and is export-only
  to the other systems (git can work with them transparently). git has
  fundamentally changed the way I work and the way Axiom is maintained,
  all for the better.

  I know it is a challenge to change source code systems but the gain
  is well worth the pain in this case. The fact that git works with
  legacy humans is a huge plus in minimizing the pain.
  
We are indeed considering changing to git.  The
  repo -- plain text -- original repo
problem is a show stopper -- i.e., if Mercurial absolutely can't
do that, then we have no choice but to dump mercurial for git.
I hope Mercurial can do that though, since we've spent a lot
of time getting going with Mercurial, and it works fairly well.
  
 -- William
  
  
  

  

  


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Fwd: mercurial -- plain text -- mercurial

2008-03-27 Thread didier deshommes

FYI, this is a proposed solution...


-- Forwarded message --
From: Matt Mackall [EMAIL PROTECTED]
Date: Thu, Mar 27, 2008 at 12:09 PM
Subject: Re: mercurial -- plain text -- mercurial
To: didier deshommes [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]



 On Thu, 2008-03-27 at 14:24 +, didier deshommes wrote:
  Hi everyone,
  Sage (http://www.sagemath.org/) uses hg for its source control and recently a
  question has come up about the possibility of doing the following:
 
   (1) export everything in the .hg repo to something (perhaps a ton of
  stuff) in plain text format,
   (2) delete .hg/ directory
   (3) do something that recovers the .hg/ directory from the output of (1).

 This will work for the export side:

 #!/usr/bin/env python
 import sys
 from mercurial import revlog, node

 for f in sys.argv[1:]:
r = revlog.revlog(open, f)
print file:, f
for i in xrange(r.count()):
n = r.node(i)
p = r.parents(i)
d = r.revision(n)
print node:, node.hex(n)
print linkrev:, r.linkrev(n)
print parents:, node.hex(p[0]), node.hex(p[1])
print length:, len(d)
print -start-
print d
print -end-

 Then you can do something like:

 find .hg/store -name *.i | xargs ./dumprevlog  repo.dump

 This will make a nice flat, uncompressed file with everything you need
 to reconstruct a repo. But it'll be huge. The mercurial repo goes from
 11MB to 435MB. Other projects will get -much- bigger; I've seen large
 revlogs with compression ratios of  1000:1.

 I'm too busy to write the import side of this today, but it'll be about
 as long. And you shouldn't actually need that piece if you only need to
 scan the dump.

 --
 Mathematics is the supreme nostalgia of our time.

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Fwd: mercurial -- plain text -- mercurial

2008-03-27 Thread didier deshommes

From the scripts below I was able to dump a text version of the SAGE
repo and recover it to make another hg repo out of it. This requires:
 - mercurial 1.0
 - a change in the layout of the sage repo. It's not too hard: hg
clone --pull $SAGE_REPO will create an exact copy of the repository in
the new format.

Here's what I did:
$ pwd  # old repo
old-hg/
$ find .hg/store/ -name *.i | xargs dumprevlog  repo.dump

$ cd ~/new-hg # new repo
$ hg init
$ undumprevlog  ~/old-repo/repo.dump
[stuff happens...]

$ hg tip
dfdeshom at sage:~/new-hg$ hg tip
changeset:   8962:211b127eab5d
tag: tip
user:William Stein wstein at gmail.com
date:Mon Mar 17 16:03:46 2008 -0700
files:   sage/rings/polynomial/multi_polynomial_element.py sage/version.py
description:
2.10.4

And doing hg co will re-populate this directory. And it looks like
these scripts will be incorporated in the new version of hg (in
/contribs/ I guess). Thanks to Matt for his quick response!

didier

-- Forwarded message --
From: Matt Mackall [EMAIL PROTECTED]
Date: Thu, Mar 27, 2008 at 1:49 PM
Subject: Re: mercurial -- plain text -- mercurial
To: didier deshommes [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]


Alright, here's a pair of scripts that will do end-to-end:

 diff -r bc142ee1522c contrib/dumprevlog
 --- /dev/null   Thu Jan 01 00:00:00 1970 +
 +++ b/contrib/dumprevlogThu Mar 27 12:40:17 2008 -0500
 @@ -0,0 +1,21 @@
 +#!/usr/bin/env python
 +# Dump revlogs as raw data stream
 +# $ find .hg/store/ -name *.i | xargs dumprevlog  repo.dump
 +
 +import sys

+from mercurial import revlog, node
 +
 +for f in sys.argv[1:]:
 +r = revlog.revlog(open, f)
 +print file:, f
 +for i in xrange(r.count()):
 +n = r.node(i)
 +p = r.parents(n)
 +d = r.revision(n)

+print node:, node.hex(n)
 +print linkrev:, r.linkrev(n)
 +print parents:, node.hex(p[0]), node.hex(p[1])
 +print length:, len(d)
 +print -start-
 +print d
 +print -end-
 diff -r bc142ee1522c contrib/undumprevlog
 --- /dev/null   Thu Jan 01 00:00:00 1970 +
 +++ b/contrib/undumprevlog  Thu Mar 27 12:40:17 2008 -0500
 @@ -0,0 +1,34 @@
 +#!/usr/bin/env python
 +# Undump a dump from dumprevlog
 +# $ hg init
 +# $ undumprevlog  repo.dump
 +
 +import sys
 +from mercurial import revlog, node, util, transaction
 +
 +opener = util.opener('.', False)
 +tr = transaction.transaction(sys.stderr.write, opener, undump.journal)
 +while 1:
 +l = sys.stdin.readline()
 +if not l:
 +break
 +if l.startswith(file:):
 +f = l[6:-1]
 +r = revlog.revlog(opener, f)
 +print f
 +elif l.startswith(node:):
 +n = node.bin(l[6:-1])
 +elif l.startswith(linkrev:):
 +lr = int(l[9:-1])
 +elif l.startswith(parents:):
 +p = l[9:-1].split()
 +p1 = node.bin(p[0])
 +p2 = node.bin(p[1])
 +elif l.startswith(length:):
 +length = int(l[8:-1])
 +sys.stdin.readline() # start marker
 +d = sys.stdin.read(length)
 +sys.stdin.readline() # end marker
 +r.addrevision(d, tr, lr, p1, p2)
 +
 +tr.close()

 Tested on the Mercurial repo.

 ps: making this work on systems that have braindead notions about text
 vs binary files is an exercise left to the reader



 --
 Mathematics is the supreme nostalgia of our time.

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: another matrix() corner case for sparse matrices

2008-03-26 Thread didier deshommes

On Wed, Mar 26, 2008 at 2:01 PM, Jason Grout
[EMAIL PROTECTED] wrote:

  Ryan Hinton brought up a good point at #2651:

  Currently, matrix(3,{(1,1): 2}) gives the 3x2 sparse matrix

  [0 0]
  [0 2]
  [0 0]


  However, for other cases, if we specify just the number of rows, the
  returned matrix is square (except when we are giving all the entries of
  the matrix and there aren't enough entries).  So:

  Should the above command return the following instead?

  [0 0 0]
  [0 2 0]
  [0 0 0]

Yes, I think the matrix should be square way since that is the
behavior for dense matrices.

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: Glib algorithms #2436 vote

2008-03-26 Thread didier deshommes

On Wed, Mar 26, 2008 at 1:52 PM, mabshoff
[EMAIL PROTECTED] wrote:



  On Mar 26, 6:43 pm, William Stein [EMAIL PROTECTED] wrote:
   On Wed, Mar 26, 2008 at 10:09 AM, mabshoff
  

  [EMAIL PROTECTED] wrote:
  
 On Mar 26, 6:02 pm, William Stein [EMAIL PROTECTED] wrote:
  Is any of the code gpl v3+ only?
  
 No.
  
   That's good.
  
  
  
  How difficult will it be to update our version whenever upstream
  changes?  Do only you know how to do this?
  
 Not particularly hard.
  
   You didn't answer my second question.

  Gary did it and I didn't pay much attention to it. I assume it will be
  documented. I don't consider such a thing hard once it has been
  documented.


  Why put this in c_lib instead of a separate spkg called glib-min?
  Couldn't such a package be useful outside of sage?
  
 It is easiest if we put it into libcsage.
  
   That's not a good enough answer.   Until now almost all code in libcsage 
 and
   the main sage library has been new code we've written -- except a few
   exceptions,
   where we greatly regretted them greatly and moved the code out later.
   So from experience I'm very opposed to this code being in c_lib.
  
   I vote -1 to this code going into sage unless:
  (1) it is put in a separate spkg, and

  We can certainly do that.


  (2) the process of extracting glib-min from the official glib
   tarball is automated.

  That is unlikely to happen since it requires manual interaction. It
  will break in the next release in six months and writing automated
  tools will take longer than actually doing the work in the first
  place.

How frequent are the glib releases? If they're not that frequent, this
should less than an issue as long as Gary documents what he's done
somewhere :)

didier

 -- William

  Cheers,

  Michael


 


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: trac is down.....

2008-03-03 Thread didier deshommes

Down again!
{{{
Python Traceback

Traceback (most recent call last):
  File /var/lib/python-support/python2.4/trac/web/main.py, line 387,
in dispatch_request
dispatcher.dispatch(req)
  File /var/lib/python-support/python2.4/trac/web/main.py, line 237,
in dispatch
resp = chosen_handler.process_request(req)
  File /var/lib/python-support/python2.4/trac/ticket/web_ui.py, line
279, in process_request
self._do_save(req, db, ticket)
  File /var/lib/python-support/python2.4/trac/ticket/web_ui.py, line
546, in _do_save
cnum=internal_cnum):
  File /var/lib/python-support/python2.4/trac/ticket/model.py, line
240, in save_changes
(self[name], self.id))
  File /var/lib/python-support/python2.4/trac/db/util.py, line 50, in execute
return self.cursor.execute(sql_escape_percent(sql), args)
  File /var/lib/python-support/python2.4/trac/db/sqlite_backend.py,
line 56, in execute
args or [])
  File /var/lib/python-support/python2.4/trac/db/sqlite_backend.py,
line 48, in _rollback_on_error
return function(self, *args, **kwargs)
OperationalError: database or disk is full
}}}

On Mon, Mar 3, 2008 at 9:15 AM, William Stein [EMAIL PROTECTED] wrote:

  Trac is back.  (I restarted it.)

  William


  On Mon, Mar 3, 2008 at 8:10 AM, David Harvey [EMAIL PROTECTED] wrote:
  
   Proxy Error
  
   The proxy server received an invalid response from an upstream server.
   The proxy server could not handle the request GET /sage_trac/.
  
   Reason: Error reading from remote server
  
   ?
  
   david
  
  

  



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



  


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: sage-edu, standard API, etc.

2008-02-25 Thread didier deshommes

On Sat, Feb 23, 2008 at 1:24 PM, William Stein [EMAIL PROTECTED] wrote:
  I'm actually pretty curious about how pexpect and XMLRPC both
  done locally compare speedwise.  I've done some simple benchmarks
  below.  The short answer is that pexpect is between several hundred
  to several thousand times faster than XMLRPC, depending on the
  platform.

More benchmarks:
pyxmlrpc (http://sourceforge.net/projects/py-xmlrpc/) is a c
implementation that is roughly 2 times faster  than xmlrpclib on small
inputs. Here are some numbers on linux running sage 2.10.1:

pyxmlrpc:
sage: %timeit (c.execute('add', [2r, 3r]))
100 loops, best of 3: 65.8 ns per loop
sage: timeit c.execute('add', [2r, 3r])
1000 loops, best of 3: 1.46 ms per loop


xmlrpclib:
sage: %timeit (s.add([2r,3r]))
100 loops, best of 3: 158 ns per loop
sage: timeit s.add([2r,3r])
100 loops, best of 3: 1.94 ms per loop


overall:
sage: time for _ in range(10^3): gp.eval('2+3')
CPU times: user 0.34 s, sys: 0.10 s, total: 0.45 s
Wall time: 0.82

sage: time for _ in range(10^3): c.execute('add', [2r, 3r])
CPU times: user 0.08 s, sys: 0.02 s, total: 0.10 s
Wall time: 1.66

sage: time for _ in range(10^3): s.add([2r,3r])
CPU times: user 0.99 s, sys: 0.38 s, total: 1.37 s
Wall time: 2.51

Note: The pyxmlrpc is currently unmaintained (last realease was in
2004) and needs to be patched against 2.5 (there's a fix at the bottom
of 
http://sourceforge.net/tracker/index.php?func=detailaid=1734819group_id=23992atid=380301).

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: sage-edu, standard API, etc.

2008-02-23 Thread didier deshommes

On Fri, Feb 22, 2008 at 5:57 PM, alex clemesha [EMAIL PROTECTED] wrote:
 In Knoboo we *decouple* the idea of a kernel, it could be another
 Python (Sage) process, with communication through Pexpect

 ... but it also couple be another Python (Sage) process running a very
 minimal XML-RPC server, and all communication occurs through
  *** HTTP instead of Pexpect ***.

I personally am not too familiar with web development, so it's always
great to hear from someone who has (which is exactly why this
discussion was started). Regarding XML-RPC vs Pexpect:
 - how slow is one compared to the other?  I expect xml-rpc to be
slower, but not so slow to render it unusable.
- I understand xml-rpc working for inter-communication, ie SAGE -
outside world, but I don't see how it would work for
intra-communication, SAGE - maxima. Maxima would have to be already
running in the background, right? If that is the case, then every sage
session would have to spawn singular, maxima, maple, etc sessions at
start-up. I don't like that. Is there something I'm not getting here?

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: Adding JSON capabilities to SAGE

2008-01-22 Thread didier deshommes

 On Tue, 22 Jan 2008, Nick Alexander wrote:
  I would like to establish some (roughly) like this: If a
  computation cannot be
  expressed from the command line (in pure Python) then it cannot be
  a standard
  part of Sage. E.g. if you cannot compute $sin(x)$ for some $x$
  from the
  command line but you can do it by clicking some Java buttons, then
  this
  functionality would not be considered a part of (standard) Sage.
 
  Would that make sense?
  Martin

There is something I don't get: it seems like JSON is going to be used
by clients to simply send or receive data from SAGE. What the client
does with the result of the computation is its problem. Why do we have
to worry about testing this at all?

 The interface itself might be tricky -- however, the communication protocol 
 isn't hard to test, whatever computations go on behind the scenes aren't hard 
 to test, and Java has some *great* unit-testing capabilities, so that side 
 isn't hard to test either.  In short, there is very little that we wouldn't 
 be able to test in an automated way.


And what is there to test? That the data is well-formed?

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: Block matrices?

2008-01-10 Thread didier deshommes

On Jan 9, 2008 3:23 AM, Robert Bradshaw [EMAIL PROTECTED] wrote:

 http://sagetrac.org/sage_trac/ticket/1732

2 questions about the patch:
* Why is this function named block_sum? What are we summing?
* Why are we limited to 4 arguments? Ideally, I would love to pass a
list to this function and have it concatenate each matrix in the list
(horizontally in the following case):
A.block_matrix([A_1, A_2, ..., A_n])

You could pass the functions an argument, indicating the number of
rows (or columns) you want so that you can do things like
A =  [ A1 A2]
[ A3 A4]

like this:
A=block_matrix([A1,A2,A3,A4],num_cols=2*3,num_rows=None). Here each A
is 3x3 and we are concatenating 2 of them in each row.

On a more general note, block_sum as of 2.9.3 is really constructing a
block diagonal matrix, isn't it? Why not call it block_diagonal? Of
course, for now, it's only using one argument, why not pass it a list
of matrices?

Thoughts?

didier



 On Jan 8, 2008, at 4:27 AM, vgermrk wrote:

 
  Is there a way to construct block matrices in SAGE?
  Not just the block_sum, augment and stack functions.
 
  As an example, let A, B, C, D be matrices and i want to construct a
  matrix like E=[[A,B],[C,D]]
 
  Such a feature would be very nice.
 
  -vgermrk-
 

 


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: Wiris -- something like the Sage notebook sort of

2008-01-08 Thread didier deshommes

On Jan 8, 2008 11:51 PM, William Stein [EMAIL PROTECTED] wrote:
  Just a quick question:  Isn't Flash a closed-source commercial product, hence
 completely unsuitable for use as a core technology in Sage?  (In contrast,
 Java is (supposed to be?) GPL'd now. )

  -- William

Yes it is closed (btw, I don't think Tom was advocating the use of
Flash in Sage, just pointing out the fact that it is near-perfect for
web developement in his view).  I just want  to point out the obvious
about Javascript: it's a bona fide platform for web development that
is installed by default on most modern browsers. You actually have
to install Java (now that it's GPL-compatible) and you don't gain much
in the short run for web dev. If you want to get serious about web
development why not ship PHP, which was specifically written for the
web?

So it's -1 from me on Java *for web dev*. I would not discount Java
for other things: a combination of Java platform + scripting language
(like python, php, perl) could open up exciting possibilities for Sage
.

didier



 


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: new SPKG.txt format and spkg tracking in the wiki

2007-12-31 Thread didier deshommes
2007/12/31, mabshoff [EMAIL PROTECTED]:
  == Dependencies ==

  * gmp
  * pari
  * NTL


I feel like this is too much information required for an spkg. I think
that only the name, upstream contact and maintainers fields should be
required to distribute one. The changelog could be inferred from the
hg changelog, the distribution field does not seem to be of any value
to me as a user.

 * How do we keep SPKG.txt and the wiki page in sync? In an ideal world
 we would just copy over the updated SPKG.txt into the wiki and be done
 with it. But people will edit the wiki page, i.e. to add contact info
 or correct issues. One way would be for the maintainers to subscribe
 to the pages of the spkgs they handle and sync it manually. Since the
 wiki preserves all edits and offers an interface to diff this should
 be relatively easy.

That's a great solution.

didier


   == Distribution ==
 
   === Padus ===
* Contact: Ismail D�nmez
* EMail: [EMAIL PROTECTED]
* Website: N/A
 
   == Changelog ==
 
   === eclib-20071231 (John Cremona) ===
 
* renamed to eclib
* allows elliptic curves as input with rational (as opposed to just
   integer) coefficients.
 
   === cremona-20071219.p1 (Michael Abshoff) ===
 
* patch to fix Internal error: can't free this _ntl_gbigint (John
   Cremona)
 
   === cremona-20071219.p0 (John Cremona) ===
 
* fix main Makefile mismerge (Michael Abshoff)
* add missing export to g0n/Makefile (John Cremona)
* fix permission issue (Michael Abshoff)
 
   === cremona-20071219 (John Cremona) ===
 
* update to latest source
* fix mwrank error on non-minimal curves (#1233)
 
   === cremona-20071124.p4 (Michael Abshoff) ===
 
* apply John Cremoan's second patch for #1403
* delete $SAGE_LOCAL/include/mwrank (#1410)
* strip the mwrank binaries and link dynamically (#1410)
* delete $SAGE_LOCAL/lib/libmwrank.[so|dylib] (#1410)
 
   === cremona-20071124.p3 (Michael Abshoff) ===
 
* apply John Cremoan's patch for #1403
* fix #1256, i.e. remove the now obsolete mwrank.spkg
 
   === previous versions ===
 
* lost to history
   [end example]
 
   I pasted the verbatim text file intohttp://wiki.sagemath.org/spkg/eclib
 
   Is there anything missing? Should anything be removed?
 
   But now there are a couple issues we need to resolve:
 
   * How do we keep SPKG.txt and the wiki page in sync? In an ideal world
   we would just copy over the updated SPKG.txt into the wiki and be done
   with it. But people will edit the wiki page, i.e. to add contact info
   or correct issues. One way would be for the maintainers to subscribe
   to the pages of the spkgs they handle and sync it manually. Since the
   wiki preserves all edits and offers an interface to diff this should
   be relatively easy.
 
   * We currently have two couple pages in the wiki that list spkgs:
 
http://wiki.sagemath.org/standard_packages_available_for_SAGE
http://wiki.sagemath.org/Sage_Spkg_Tracking
 
   I think both should be merged into one page while preserving the info
   from both pages. standard_packages_available_for_SAGE is slightly
   older than Sage_Spkg_Tracking, but I llike the format of
   Sage_Spkg_Tracking better. It also has all current components
   listed.
 
   * We would potentially have two wiki pages for each spkg. Take for
   example Givaro. We have a page at
 
http://wiki.sagemath.org/Givaro
 
   That page lists some examples and compares the performance of GF(2^8)
   to Magma. That information shouldn't be in SPKG.txt and the example
   section could potentially be expanded.
 
   The not yet existing page at
 
http://wiki.sagemath.org/spkg/Givaro
 
   on the other hand would then contain a much more technical changelog.
 
   I think that we also should merge both pages for each spkg into some
   part of the manual. It is possible to export wiki pages to latex which
   in turn then can be stuck into some part like the developer's manual.
   We should do that via some script so that prior to a release somebody
   can execute that script. If there is the need to do something manual
   it won't happen.
 
   Thought? Ideas?
 
   Cheers,
 
   Michael
 
  --
  John Cremona
 


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: Fwd: blog and rss

2007-12-09 Thread didier deshommes

2007/12/9, Bobby Moretti [EMAIL PROTECTED]:

 If I had a blog, and signed up its RSS feed to planetsage, would *all*
 my posts be visible, or could I filter posts based on a tag?

For that, your blog software would have to know how to generate an rss
feed for your tag only. For example, if you tag all posts concerning
sage under sage, you can let people subscribe to this feed for
sage-related stuff only: http://yourblog.com/tag/sage/rss/

didier


 For example, the second post on planet gnome right now is about Dennis
 Kucinitch...

 -Bobby

 On Dec 9, 2007 10:55 AM, Yi Qiang [EMAIL PROTECTED] wrote:
 
  Ok, there seems to be enough interest for this idea. I think the next
  step will be actually finding out HOW many of us blog, or would be
  willing to start blogging about SAGE.
 
  http://wiki.sagemath.org/planetsage
 
  Please go there and put a link to your blog if you have one, or make
  an entry saying you are interested in starting a blog.
 
  Cheers,
  Yi
 
  http://yiqiang.org
 
 
  On Dec 9, 2007 3:49 AM, Robert Bradshaw [EMAIL PROTECTED] wrote:
  
   +1 to the planet.sagemath.org idea, including official blog with
   release announcements, bug and Sage days info, etc.
  
   A semi-official, regular (weekly? authorship could rotate) tips and
   tricks blog could be good too, and another idea would be a regular
   How do I ___ in Sage which could take email submissions. From a
   marketing standpoint, I think regularity is an important thing, like
   newspaper columns and TV shows (you want people to keep coming back
   because they know there's going to be something new and then
   anticipate it.) It could grow into a large resource of examples too
   (and maybe even get doctested?)
  
   Of course, this could turn out to be a significant time investment
   (though the latter could be largely fleshed-out responses to sage-
   support).
  
   Robert
  
  
  
   On Dec 8, 2007, at 10:04 PM, Ondrej Certik wrote:
  
Yes, I was just going to say the same thing. planet.sagemath.org is
the way to go. Besides developers blogs, there can also be an official
blog (with several core sage developers having a write access to),
where official things will be announced.
   
Its true, that writing a blog requires time, but it's worthy and
necessary.
   
Ondrej
   
On 12/9/07, alex clemesha [EMAIL PROTECTED] wrote:
On Dec 8, 2007 8:09 PM, Yi Qiang [EMAIL PROTECTED] wrote:
   
   
Actually, depending on how many SAGE developers blog at all, we
should
consider a planet.sagemath.org style blog.  The idea is the planet.*
is an aggregator of blogs it subscribes to and publishes blogs with
specific tags.  For example, planet.sagemath.org would subscribe to
Mike Hanson, Martin Albrecht, and Ondrej Certik's blog. Each time
those people post something to their own blogs with the 'sage'
tag, it
will show up on planet.sagemath.org.  Many open source
communities use
this. See the urls below for examples.
   
The software that makes it happen is called PlanetPlanet
(http://www.planetplanet.org/)
   
Some projects that use this include:
   
   * Planet GNOME (planet.gnome.org)
   * Planet Debian (planet.debian.org)
   * Planet Twisted (planet.twistedmatrix.org)
   
etc..You can see a more complete list at planetplanet.org.
   
   
Hey Yi, that's a really good idea.
   
Even Python has their own planet:
   
planet.python.org
   
and on the side bar of that page there is a link to
a bunch more planets ... basically there's a lot of gravity to
this idea ;)
   
Alex
   
   
   
   
On Dec 8, 2007 7:05 PM, William Stein [EMAIL PROTECTED] wrote:
   
On Dec 8, 2007 7:03 PM, Bobby Moretti [EMAIL PROTECTED] wrote:
   
At the very least, I think it would be a good idea to use a
content
management system for the website.
   
That's a really good idea.  Mike Hansen has been getting really
into Django lately, so maybe he can help with that.  Using Django
would probably make a lot of sense.
   
The front page could be blog-like, containing mostly news,
updates,
info, and releases.
   
Yep.
   
Then if someone has a personal blog entry that says something
interesting about Sage, we can just link to it from the front
page as
a news story. This way everything would be archived, etc.
   
I like this idea.
   
William
   
   
   
On Dec 8, 2007 6:59 PM, didier deshommes [EMAIL PROTECTED]
wrote:
   
2007/12/8, William Stein [EMAIL PROTECTED]:
   
Hi,
   
My brother suggests that a Sage blog be somehow created (see
below).  It's
a good idea.  Any ideas about what this might entail?   Weekly
developer
summaries?  A cool trick?  Little articles?  Etc.   I have
never
blogged
   
+1
This could also be good to announce new versions, improvements,
papers
written in Sage, etc. Developers

[sage-devel] Re: Fwd: blog and rss

2007-12-08 Thread didier deshommes

2007/12/8, William Stein [EMAIL PROTECTED]:

 Hi,

 My brother suggests that a Sage blog be somehow created (see below).  It's
 a good idea.  Any ideas about what this might entail?   Weekly developer
 summaries?  A cool trick?  Little articles?  Etc.   I have never blogged

+1
This could also be good to announce new versions, improvements, papers
written in Sage, etc. Developers blogging about Sage could be fun: it
would expose how some other parts of the Sage code works (this would
also help Bus Days). For example, when I wrote QDRF, I blogged about
what one would need to do in order to implement (floating-point)
fields in Sage since I had learned a great deal about this part of the
code.

Of course, the thing with blogging is time :) . If you're blogging,
you're not writing code and sometimes you just can't afford that ;).

didier

 at all, but I know some of you (e.g., Martin Albrecht and Ondrej Certik)
 are old pros at blogging.  Thoughts?


 -- Forwarded message --
 From: Dennis Stein [EMAIL PROTECTED]
 Date: Dec 8, 2007 1:28 PM
 Subject: blog and rss
 To: William Stein [EMAIL PROTECTED]


 William,

 Non-developer users of Sage might enjoy learning more about what is
 going on in the Sage world.  A blog would be a great way to do this.
 You could post things like the AMS event, published articles, news of
 major changes in the software, upcoming cool new features, something
 funny that is Sage related, a profile of someone who has significantly
 contributed to the software, a user profile, and so on.  People could
 subscribe to it via email or RSS.  You could use a free blog service
 (webpress or blogspot or whatever) and use Google's free Feebburner
 for the email subscription service for people to subscribe.

 http://www.mathworks.com/company/rss/index.html

 Google has a blog that they post to about once every three weeks or so.

 Obviously making the software the best it can be is a bigger priority,
 but a blog could be useful at some point for keeping in touch with
 people (reporters, users, fans).

 --Dennis



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

 


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: plotQt.c with Qt 4.3.2 + GUI for pari/gp

2007-11-12 Thread didier deshommes

On 11/12/07, William Stein [EMAIL PROTECTED] wrote:
 I'm excited that there is so much enthusiasm and energy for open source
 projects / guis, etc., related to mathematical software right now.   I wonder
 if you've solved any problems I don't know how to solve (and conversely)
 related to such things?

I also stumbled accross Reinteract, which is similar to the Sage
notebook, only it's running on a GUI (Gtk in this case):
 http://blog.fishsoup.net/2007/11/10/reinteract-better-interactive-python/

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: random polynomial generation

2007-11-09 Thread didier deshommes

On 11/7/07, Martin Albrecht [EMAIL PROTECTED] wrote:

 Hi everybody,

 I've attached a 'random_monomial.py' to

http://trac.sagemath.org/sage_trac/ticket/980

 which implements Steffen's and my proposal.

Hey guys,
I've attached a patch for this at
http://trac.sagemath.org/sage_trac/ticket/980 . Let me know if it
works for you.

didier


 Thoughts?
 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-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: libPng.dylib

2007-11-02 Thread didier deshommes

On 11/2/07, William Stein [EMAIL PROTECTED] wrote:
 How did the meeting go?  (There aren't any slides posted on that site, just a 
 list
 of titles.)  Did Sage get mentioned at all otherwise, or did it basically seem
 irrelevant from the point of view of the CDI people, etc.?

SAGE got mentioned a lot and I was a little surprised by this given
that I did not hear much about it this summer at SNC/PASCO 2007
(http://www.orcca.on.ca/conferences/snc2007/site/programsncpasco/sncprogram.html).
I don't know about ISSAC, though  as I did not attend and would love
to hear other people's experiences if they attended.  Someone (I don't
remember who) said that it might be a blessing in disguise that you
couldn't make it since so many people are already mentioning it ;) .
My impression is that SAGE is relevant especially if it gets used by
more applied mathematicians, etc.

AXIOM also got mentioned, especially by Emil Volcheck and he seems to
think that open-source projects like AXIOM and SAGE have a place in
getting funding by the government, whether it's though CDI or not.

(Hi Fernando!)

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: Feature Request/Talk Feedback

2007-11-01 Thread didier deshommes

On 11/1/07, Martin Albrecht [EMAIL PROTECTED] wrote:
 Usually, if we choose an implementation for a particular functionality, we try
 to make sure to always pick the best implementation available. However, this
 choice only applies to those systems we ship (singular, gap, pari ...) and
 not to the systems installed on a user's computer.

 As for many computations e.g. Magma is the fastest one person in the audience
 suggested to use Magma by default for those computations if it is available
 on a user's computer.

 I turned this down, because this would violate the principle that everything
 should be laid open for checking,should be free and self contained.

I agree and I'm also wondering how many lines of codes that would add
(because you have to check each time you call a method if magma is
installed, right?).

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: Issue during upgrade

2007-11-01 Thread didier deshommes

On 10/28/07, Bobby Moretti [EMAIL PROTECTED] wrote:

 Sorry, accidentally hit send before I wrote anything :).

 When upgrading to 2.8.9, the upgrade halts with the output

 /bin/sed: can't read /home/bob/sage-2.8.7/local/lib/libgmp.la: No such
 file or directory

Having the same problem here. In this case, ~/custom/sage-2.8.8.1/
doesn't even exist, but ~/custom/sage does :
/bin/sed: can't read
/home/dfdeshom/custom/sage-2.8.8.1/local/lib/libgmp.la: No such file
or directory
libtool: link: `/home/dfdeshom/custom/sage-2.8.8.1/local/lib/libgmp.la'
is not a valid libtool archive

I don't remember having this problem before.
didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: random polynomial generation

2007-10-26 Thread didier deshommes

2007/10/26, Steffen [EMAIL PROTECTED]:
 1) Polynomial with max number of monomial. We dont need to worry about
 that case, since here all the monomial are chosen, that means actually
 there is nothing to choose. So this will be efficient anyway.
 2) A user wants an exact  totalmax number of monomials. In this case
 its difficult to reach real randomness in an efficient way. Martins
 and my proposal in this case was to except collisions during the
 implementation, that is choose a random monomial and throw it away if
 already chosen. This is not most efficient, the expectation
 calculation period has 2 * the optimal time as upper bound.
 3) A user wants a real random polynom with a certain number of
 monomials, but there is no need to fix a maximum number of monomials.
 An efficient implementation here would be:
 #m = maxNumberOfMonomials = calculate it
 #d = desiredNumberOfMonomials = choose it
 Iterate over the list of all monomials, with probability #d/#m choose
 this monomial.
 This would be faster than 2) and would return a polynomial with an
 expectation value of monomials of #d

Could you give an example for each of these cases? I'm having trouble
distinguishing the difference between 2) and 3)

Mike, your code had a subtle bug, where
random_monomials(n,degree,terms) failed each time for degree =1 (but
was fine for degree=0).

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: rich comparison

2007-10-26 Thread didier deshommes

2007/10/26, Robert Miller [EMAIL PROTECTED]:
 I have some questions about Python comparison. Suppose I have a Python
 class representing objects under some ordering, and I want to
 implement =, , =, , ==, != comparisons on those objects. I
 remember hearing somewhere that the __cmp__ method was deprecated, but
 now that I am thinking about it I can't find anything confirming that.
 Is there any reason to implement the functions __eq__, __neq__,
 __gt__, __ge__, __lt__, __le__, instead of just one __cmp__? Including
 forward compatibility, being more Python-ic or anything else?

I don't think __cmp__ is deprecated. From the docs
(http://docs.python.org/ref/customization.html), it looks like __le__,
__lt__, etc are called in preference to __cmp__ if they are defined.
Otherwise, __cmp__() is called. I think one main reason for using
these is to define more fine-grained relationships (partial ordering):

There are no implied relationships among the comparison operators. The
truth of x==y does not imply that x!=y is false. Accordingly, when
defining __eq__(), one should also define __ne__() so that the
operators will behave as expected.


So, just use __cmp__  and if you want to overload != for example, just
write your own __ne__

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: random polynomial generation

2007-10-25 Thread didier deshommes

2007/10/25, Martin Albrecht [EMAIL PROTECTED]:
 This construction is random if the random number generator (randint) is
 random. Btw. how random is randint?

The core generator for all random functions in Python uses the
mersenne twister which is pretty strong.

I have another suggestion for this problem, that looks somewhat like
yours. Maple has 2 functions in its combinatorics package that :
inttovec(number,nvars) which turns a number into vector of length
nvars, and vectotint(vec) that does the opposite. Here's the
documentation for them:

These two functions provide a one-to-one correspondence between the
non-negative integers and all vectors composed of n non-negative
integers.
The one-to-one correspondence is defined as follows. View all vectors
of n non-negative   integers as exponent vectors on n variables.
Therefore, for each vector, there is a   corresponding monomial.
Collect all such monomials and order them by increasing total
degree. Resolve ties by ordering monomials of the same degree in
lexicographic order. This gives a canonical ordering.

Ex:
 inttovec(9,2);
  [0, 3]

 vectoint([0,3]);
9

Now the idea is simple: for random_elements(deg,terms) , generate the
a number randomly in (0, nchoosek(n+d-1,d)) and compute the
corresponding monomial:

for t in terms:
   num = randint(0, nchoosek(n+d-1,d))
   term = inttovec(num,nvars)

Since integers are chosen uniformly, this would guarantee (?) that the
polynomial is generated uniformly. Only hitch is that I don't know if
there is such inttovec is in in SAGE yet. mhansen, any idea?

didier


 Now we need to choose a degree d at random. We cannot do this uniformly at
 random because the classes (associated to the degree) are not of the same
 size (e.g., 1, 10, 55 above) We don't want to choose classes uniformly but
 elements and again mhansen beat me to an implementation:

 def random_monomial_less_than_degree(n, degree):
  #Get the counts of the total number of monomials
  #of degree d
  counts = [1]  #degree 0
  for d in range(1, degree):
  counts.append(binomial(n+d-1, d))
  total = sum(counts)
  #Select a random one
  random_index = randint(0, total-1)
  #Figure out which degree it corresponds to
  d = 0
  while random_index = counts[d]:
  random_index -= counts[d]
  d += 1

  #Generate the corresponding monomial
  comb = choose_nk.from_rank(random_index, n+d-1, n-1)
  monomial = [ comb[0] ]
  monomial += map(lambda i: comb[i+1]-comb[i]-1, range(n-2))
  monomial.append( n+d-1-comb[-1]-1 )
  return monomial

 However, an implementation without the need to explicitly construct the counts
 array would be good.

 With this in place one can start thinking about constructing random
 polynomials from random monomials. For this we don't have an elegant solution
 yet. We (=Steffen and me) distinguish two cases:

 Let #T be the number of terms requested.

 If $MM is the number of all possible monomials of all allowed degree = d and
 #T  $MM/2 then we generate #T _distinct_ monomials as above and assign
 random coefficients (possibly zero). The overhead of requesting distinct
 monomials should be at most 2 because if we are looking for 1/2 of the search
 space, every second choice should be a double.

 If #T  $MM/2 we generate all possible monomials, pick #T and assign
 coefficients. This should be more effective for this case because we don't
 generate any doubles (but memory is more precious than cpu cycles, so we
 might have to move that barrier up a bit).

 Does this sound like a sensible approach?

 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-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: random polynomial generation

2007-10-25 Thread didier deshommes

2007/10/25, Mike Hansen [EMAIL PROTECTED]:

  Since integers are chosen uniformly, this would guarantee (?) that the
  polynomial is generated uniformly. Only hitch is that I don't know if
  there is such inttovec is in in SAGE yet. mhansen, any idea?

 Yes, this is pretty much what I'm doing.  While I don't have those
 exact functions, they would be easy to implement.

 How fast do these need to be?  Here's a rough function that uniformly
 selects monomials without replacement from all possible monomials with
 degree less than d.

Is this function in sage? Where is it located?

didier


 def random_monomials(n, degree, terms):
 #Get the counts of the total number of monomials
 #of degree d
 counts = [1]  #degree 0
 for d in range(1, degree):
 counts.append(binomial(n+d-1, d))
 total = sum(counts)
 #Select a random indices
 indices = sample(xrange(total), terms)
 monomials = []
 for random_index in indices:
 #Figure out which degree it corresponds to
 d = 0
 while random_index = counts[d]:
 random_index -= counts[d]
 d += 1
 #Generate the corresponding monomial
 comb = choose_nk.from_rank(random_index, n+d-1, n-1)
 monomial = [ comb[0] ]
 monomial += map(lambda i: comb[i+1]-comb[i]-1, range(n-2))
 monomial.append( n+d-1-comb[-1]-1 )
 monomials.append(monomial)
 return monomials

 Here's an example:

 sage: time  random_monomials(20, 40, 20)
 CPU times: user 0.09 s, sys: 0.00 s, total: 0.09 s
 Wall time: 0.09

 [[8, 1, 5, 0, 0, 1, 2, 0, 1, 1, 2, 0, 0, 2, 4, 2, 1, 4, 3, 1],
  [0, 0, 9, 2, 0, 7, 2, 0, 3, 2, 1, 0, 3, 1, 0, 1, 4, 0, 4, 0],
  [0, 0, 3, 0, 1, 4, 3, 1, 0, 2, 1, 3, 4, 1, 1, 0, 6, 7, 0, 0],
  [0, 2, 3, 0, 0, 2, 1, 2, 5, 3, 0, 0, 1, 5, 2, 0, 1, 1, 9, 0],
  [0, 1, 1, 7, 0, 1, 6, 0, 1, 0, 1, 0, 1, 6, 2, 0, 7, 0, 2, 1],
  [7, 0, 3, 1, 0, 6, 1, 4, 0, 8, 0, 0, 0, 0, 0, 1, 3, 3, 0, 0],
  [0, 0, 0, 4, 1, 5, 3, 1, 1, 0, 0, 2, 3, 3, 3, 1, 4, 0, 1, 6],
  [1, 2, 5, 0, 5, 1, 1, 0, 0, 7, 0, 1, 1, 1, 1, 2, 3, 4, 1, 0],
  [1, 7, 0, 0, 4, 3, 0, 2, 0, 0, 1, 8, 1, 1, 0, 0, 2, 5, 0, 0],
  [0, 4, 0, 3, 5, 0, 0, 0, 1, 0, 1, 3, 2, 1, 8, 4, 0, 0, 1, 0],
  [1, 0, 9, 0, 1, 7, 3, 1, 2, 0, 0, 1, 0, 0, 5, 1, 0, 6, 0, 0],
  [1, 3, 0, 3, 5, 0, 1, 2, 0, 2, 4, 1, 0, 4, 1, 2, 3, 1, 4, 0],
  [0, 2, 3, 8, 1, 0, 3, 1, 0, 1, 1, 1, 0, 1, 5, 5, 1, 5, 0, 0],
  [3, 0, 4, 0, 8, 0, 3, 1, 0, 2, 0, 1, 0, 3, 1, 6, 2, 2, 0, 1],
  [2, 5, 1, 0, 1, 0, 2, 5, 1, 2, 3, 3, 0, 0, 0, 4, 4, 0, 0, 0],
  [1, 0, 6, 2, 5, 0, 0, 0, 1, 4, 2, 0, 5, 0, 1, 1, 0, 0, 3, 4],
  [1, 1, 0, 2, 0, 1, 1, 1, 3, 3, 2, 2, 1, 0, 0, 1, 1, 1, 11, 7],
  [7, 0, 3, 0, 4, 1, 2, 1, 6, 0, 0, 1, 3, 1, 0, 0, 7, 3, 0, 0],
  [1, 2, 3, 1, 0, 1, 0, 0, 3, 3, 2, 0, 5, 0, 0, 0, 3, 1, 2, 7],
  [0, 5, 0, 3, 1, 1, 2, 0, 1, 1, 0, 1, 4, 2, 8, 2, 2, 1, 0, 2]]


 --Mike

 


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: random polynomial generation

2007-10-25 Thread didier deshommes

2007/10/25, Mike Hansen [EMAIL PROTECTED]:

  Is this function in sage? Where is it located?

 Which function?

Sorry, the random_monomials() function.


 --Mike

 


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: random polynomial generation

2007-10-24 Thread didier deshommes
I've attached a patch that takes care of 1) only and updated
http://sagetrac.org/sage_trac/ticket/980 . The individual degree
distribution is a little better:
{{{
sage: GF(10007)['x,y,q'].random_element(6,10)
 -2005*x^6 + 2400*x^4*y^2 - 3609*x^3*y^3 + 488*x*y^5 - 3093*x^4*y*q +
3482*x*y*q^3 - 989*x^2*y*q - 3529*x*q^3 - 3957*x
}}}

But note that most of the time for the example at the beginning of the
thread, we still get 6,7 out of 9 terms most of the time. I still
don't think this is a bug: we are not creating a polynomial with 9
terms in it, but picking one with at most 9 terms.
{{{
sage: GF(10007)['x,y'].random_element(4,9)
 797*x^4 - 439*x^2*y^2 - 1457*x*y^3 - 2348*y^4 - 1721*x^3 - 1885*x^2*y
- 1760*x*y^2 + 310*y
}}}


didier

2007/10/24, Steffen [EMAIL PROTECTED]:



 On Oct 24, 5:45 am, didier deshommes [EMAIL PROTECTED] wrote:
  2007/10/23, Steffen [EMAIL PROTECTED]:
 
   Exactly, thats one of two points. The maximum degree in every variable
   is (maximum total degree of resulting polynomial) / (number of
   varialbes of the polynomial). Thus for example GF(10007)
   ['x,y,z'].random_element(5,9) will be limited in every variable to
   degree 5/3 = 1 !!!. This is not what the upper definition says.
   The second point is about the number of coefficients that are set to
   0. This might a point to argue about, but if I create a random
   polynomial with a  (maximum number of terms to generate) then I expect
   that the 0 occurs with the same probability and thus as often as every
   other element. Thats why I am not happy if 20% or more of the
   parameters are 0.
 
  I filed out a bug report about those 2 issues:
  1) Degrees can severely restricted.
  2) The polynomials returned can be too sparse
 
  I plan to post a patch addressing your concerns (I can especially see
  how 1) can be annoying). Random poly generation will most likely be
  slower, so for now I'm planning to keep the current behavior around,
  even if it is not the default.
 
  didier

 Thanks, I will wait for didiers patch. If I then have any additional
 requirements I will implement them via an optional flag or smth
 similar.

 Steffen


 


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---

diff -r 1a19787af98d sage/rings/polynomial/multi_polynomial_ring_generic.pyx
--- a/sage/rings/polynomial/multi_polynomial_ring_generic.pyx   Sun Oct 21 
10:13:32 2007 -0700
+++ b/sage/rings/polynomial/multi_polynomial_ring_generic.pyx   Wed Oct 24 
18:23:14 2007 -0400
@@ -453,23 +453,31 @@ cdef class MPolynomialRing_generic(sage.
 
 sage: R.random_element(41) # random
 -4*x^6*y^4*z^4*a^6*b^3*c^6*d^5 + 1/2*x^4*y^3*z^5*a^4*c^5*d^6 - 
5*x^3*z^3*a^6*b^4*c*d^5 + 10*x^2*y*z^5*a^4*b^2*c^3*d^4 - 5*x^3*y^5*z*b^2*c^5*d
-
+sage: f=ZZ['q,w,e,r,t,y'].random_element(degree=200,terms=19)
+sage: f.degree() = 200
+True
+
 AUTHOR:
 -- didier deshommes
 
-# General strategy:
-# generate n-tuples of numbers with each element in the tuple
-# not greater than  (degree/n) so that the degree 
-# (ie, the sum of the elements in the tuple) does not exceed
-# their total degree
-
+
 n = self.__ngens # length of the n-tuple
-max_deg = int(degree/n)  # max degree for each term
 R = self.base_ring()
 
-# restrict exponents to positive integers only
-exponents = [ tuple([ZZ.random_element(0,max_deg+1) for _ in range(n)])
-   for _ in range(terms) ]
+exponents = []
+for i in range(terms):
+exps = []
+deg = degree
+for i in range(n):
+exp = ZZ.random_element(0,deg+1)
+if exp = deg:
+exps.append(exp)
+deg -= exp 
+else:
+exps.append(0)
+
+exponents.append(tuple(exps))
+
 coeffs = []
 for _ in range(terms):
 c = R.random_element(*args,**kwds)


[sage-devel] Re: random polynomial generation

2007-10-16 Thread didier deshommes

2007/10/16, Steffen [EMAIL PROTECTED]:
 Hi didier,

 the implementation does not return a polynomial of a total degree of
 at most 4, but a polynomial of total degree of at most 4/2 = 2 in x
 and in y. If I change the total degree to 5, nothing happens, since
 5/2 = 2. This might be a bug in the implementation. However I am happy
 with this behaviour and maybe there should be the option for choosing
 the total degree or the degree in every variable.

For total degree, I'm using the definition here:
http://planetmath.org/encyclopedia/OrderAndDegreeOfPolynomial.html

So I am not concerned about individual degrees at all.

 Furthermore I am not happy with this implementation in general. In
 step 1.) you do not care about repetitions. This sounds reasonible
 since repetitions are part of randomness. Later in step 3) you do care
 about repetetions and summarise them under the value 0. If the value 0

I don't explicitly discard repetitions in 3), the dictionary object
takes care of that by discarding repeated keys (in this case, the keys
are the degree tuples).

didier

 gains the same importance as all other values in the corresponding set
 of values, than the  multiple occurance of 0 is a repetition, too.

 I am quite new in SAGE and have no idea how sage code looks like, but
 I will have a look and see if I can do some changes :-)

 Cheers, Steffen




 


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: multivariate polynomial coefficients

2007-10-12 Thread didier deshommes

2007/10/12, Joel B. Mohler [EMAIL PROTECTED]:
 sage: P.x,y,z=ZZ[]
 sage: f=x*y^2*z^3+y^2*z
 sage: f.coefficient(y,2,z,3)  # I want the coefficient of y^2*z^3
 # Bang

 That doesn't seem very nice to me.

Good point: Dictionary it is then. (Incidentally, there downs seem a
non-obvious way to do this in Maple).

didier


 --
 Joel

 


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: multivariate polynomial coefficients

2007-10-12 Thread didier deshommes

2007/10/12, Joel B. Mohler [EMAIL PROTECTED]:

 This e-mail is too long.  Here's the bottom line:  I suggest that the
 coefficient method on a multivariate polynomial ring take a dictionary
 indicating the variables and degrees that you want to restrict your attention
 to.

 It seems that the multivariate polynomial coefficient function is a bit
 inflexible (and inconsistent).  I'm looking for some insight about how to
 think about the following things.

 sage: P.x,y=ZZ[]
 sage: f=x*y^2+x*y+y+x+1
 sage: f.coefficient(y^2)
 x
 sage: f.coefficient(y^1)
 x + 1
 sage: f.coefficient(y^0)
 1

 I realize that y^0 == 1 so that the last line is returning the constant
 coefficient (and the implication that y is special to me the user is totally
 unseen by the coefficient method).  But, the logic seems a bit inconsistent.
 I'd suggest that this next line work:

 sage: f.coefficient({y:0})
 x + 1

+1.

Interestingly enough, Maple has the same limitation when you pass the
exponent to it directly:
 coeff(f,y^0);
Error, invalid input: coeff received 1, which is not valid for its 2nd
argument, x

But:
 coeff(f,y,0);
  x + 1

returns the right answer

Actually I like Maple's notation better here over the dictionary
notation you proposed: it is as intuitive and I have to type less
curly braces to get the same result :)

didier

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To post to this group, send email to sage-devel@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-devel?hl=en
-~--~~~~--~~--~--~---



[sage-devel] Re: dsage

2007-10-10 Thread didier deshommes

2007/10/10, John Voight [EMAIL PROTECTED]:

 What is screen?  Unfortunately, it is not an easy thing to Google!

Here is a link to screen :
http://www.gnu.org/software/screen/

There's a quick tutorial here:
http://www.kuro5hin.org/story/2004/3/9/16838/14935

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: Sage 2.8.3 on Solaris - A New Hope

2007-09-28 Thread didier deshommes

2007/9/25, mabshoff [EMAIL PROTECTED]:



 On Sep 24, 10:42 pm, William Stein [EMAIL PROTECTED] wrote:
  On 9/24/07, didier deshommes [EMAIL PROTECTED] wrote:
 
   Some build notes:
   - Singular needs -lcurses whenever -lreadline is specified. Using
   it from the console still fails for me.

 It depends how readline is build. Many times -ltermcap should fix the
 problem, but I got Singular to build and run without problems on
 Solaris 9/10 Sparc and Solaris 10 Opteron. Another solution might be
 to build ncurses, but I would have to look at the beautiful and well
 structured Singular build system 8)


I'm able to start it from the console (with -ltermcap), but I had to
change the singular.py interface so that the executable would point to
$SAGE_LOCAL/bin/Singular-3-0-3 instead of SAGELOCAL/bin/Singular. I'm
guessing a link didn't get updated or something...


 I think the trick to building clisp on Solaris is to use a gcc 3.4 and
 pass -DNOGENERATIONALGC or something during the build. That is at
 least the workaround on NetBSD and when I build Sage's clisp on
 Solaris 9 the last time it crashes during the first invocation of the
 garbage collector. I reported the problem to the clisp development
 list but never got a reply.

Painful.


   - to  build matplotlib, python needs this fix:
  http://www.scipy.org/Cookbook/Matplotlib/CompilingMatPlotLibOnSolaris...

 Interesting, never had that problem.

Very interesting, I've had to build it on Solaris and nexenta and each
time compilation of matplotlib failed until I tried this.

 Easiest is to symbolically link gfortran or g95 to g77, otherwise

I did that, and I get this:

customize GnuFCompiler
Couldn't match compiler version for 'G95 (GCC 4.0.3 (g95 0.90!) Aug  1
2006)\nCopyright (C) 2002-2005 Free Software Foundation, Inc.\n\nG95
comes with NO WARRANTY, to the extent permitted by law.\nYou may
redistribute copies of G95\nunder the terms of the GNU General Public
License.\nFor more information about these matters, see the file named
COPYING'
customize Gnu95FCompiler
customize SunFCompiler
'linker_exe'
[...]

f90:f77: Lib/fftpack/dfftpack/dcosqb.f
sh: f90: not found
sh: f90: not found
error: Command f90 -ftrap=%none -fixed -xcode=pic32 -c -c
Lib/fftpack/dfftpack/dcosqb.f -o
build/temp.solaris-2.11-i86pc-2.5/Lib/fftpack/dfftpack/dcosqb.o
failed with exit status 1
Error building scipy.


Do you know how scipy picks its compiler? The build scripts look opaque to me...

Testing of interfaces is completely broken for me, I can't tell if I
miscompiled pexpect or if it's something much scarier/deeper.


didier

   Tests that failed:
 
  Yikes!
 
 
 
  sage -t  algebras/free_algebra_quotient.py
   sage -t  calculus/calculus.py
   sage -t  ext/interactive_constructors_c.pyx
   sage -t  functions/constants.py
   sage -t  functions/functions.py
   sage -t  functions/transcendental.py
   sage -t  geometry/lattice_polytope.py
   sage -t  interfaces/gap.py
   sage -t  interfaces/singular.py
   sage -t  lfunctions/lcalc.py

 I got a fix for lcalc. Need to send it in :)

   sage -t  lfunctions/sympow.py

 No fix for Sympow on Solaris with Intel/AMD chips so far, but I
 believe that the problem is that sympow detects an Intel/AMD cpu and
 uses special assembly flags to use the extended FPU precision, while
 the fallback mode should be used.

   sage -t  matrix/matrix2.pyx
   sage -t  matrix/matrix_integer_dense.pyx
   sage -t  matrix/matrix_mpolynomial_dense.pyx
   sage -t  matrix/matrix_space.py
   sage -t  modular/ssmod/ssmod.py
   sage -t  plot/plot.py
   sage -t  rings/number_field/number_field.py
   sage -t  rings/number_field/number_field_element.pyx
   sage -t  rings/number_field/number_field_ideal_rel.py
   sage -t  rings/polynomial/groebner_fan.py
   sage -t  rings/polynomial/multi_polynomial_element.py
   sage -t  rings/polynomial/multi_polynomial_ideal.py
   sage -t  rings/polynomial/multi_polynomial_ideal_libsingular.pyx
   sage -t  rings/polynomial/multi_polynomial_libsingular.pyx
   sage -t  rings/polynomial/multi_polynomial_ring.py
   sage -t  rings/polynomial/multi_polynomial_ring_generic.pyx
   sage -t  rings/polynomial/polynomial_element.pyx
   sage -t  rings/polynomial/polynomial_quotient_ring.py
   sage -t  rings/polynomial/polynomial_quotient_ring_element.py
   sage -t  rings/polynomial/polynomial_singular_interface.py
   sage -t  rings/polynomial/term_order.py
   sage -t  rings/polynomial/toy_buchberger.py
   sage -t  rings/complex_double.pyx
   sage -t  rings/homset.py
   sage -t  rings/morphism.py
   sage -t  rings/power_series_ring.py
   sage -t  rings/quotient_ring.py
   sage -t  rings/quotient_ring_element.py
   sage -t  rings

[sage-devel] Re: singular gcd slow-down

2007-09-25 Thread didier deshommes
2007/9/19, Joel B. Mohler [EMAIL PROTECTED]:

 On Wednesday 19 September 2007 16:22, William Stein wrote:
  I think those timings are way out of date, since Singular 3 seems
  to be *very* fast at mod p multivariate GCD computation, even
  though it sucks over QQ.   Check out this paper:
 
http://www.cecm.sfu.ca/CAG/papers/brown.ps
 
  It on exactly the problem of GCD over QQ (or equiv ZZ),
  and section 2 has a complete description of a gcd algorithm
  that reduces gcd over ZZ to doing gcd's mod p.

 I'll be looking into implementing that.  It makes me disgruntled to be at the
 mercy of mathematica (or pick your favorite big commercial m).  :D.

FYI,
I plan on implementing a multivariate gcd algorithm for Sage over RR
and CC some time next year. The algorithm is by Kaltofen et al. Here's
the abstract:

 Abstract. We consider the problem of computing minimal real or
complex deformations to
the coefficients in a list of relatively prime real or complex
multivariate polynomials such that the
deformed polynomials have a greatest common divisor (GCD) of at least
a given degree k. In addition,we restrict the deformed coefficients by a
given set of linear constraints, thus introducing the linearly
constrained approximate GCD problem. We present an algorithm based on
a version of the structured


There is already an implementation of the algorithm written in maple
available here if anyone is interested:
http://www4.ncsu.edu/~kaltofen/software/manystln/

didier


 --
 Joel

 


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: Sage 2.8.3 on Solaris - A New Hope

2007-09-24 Thread didier deshommes

2007/9/17, didier deshommes [EMAIL PROTECTED]:
 2007/9/16, mabshoff [EMAIL PROTECTED]:
  Didier, does sage -testall pass on your install?

 Actually, I stopped at lapack due to lack of time. I'm plan to
 continue where I left things off on thursday (a little before sbd 3
 officially starts).

Some build notes:
- Singular needs -lcurses whenever -lreadline is specified. Using
it from the console still fails for me.
- clisp won't build but I noticed that blastwave.org has a binary
version 2.39 so I installed that and maxima detected it.
- to  build matplotlib, python needs this fix:
http://www.scipy.org/Cookbook/Matplotlib/CompilingMatPlotLibOnSolaris10?highlight=%28solaris%29
I did have a spkg wich that tried to get around that...
- quaddouble: I re-enabled your rqdf_fix.h to get around isinf(), INFINITY, etc.
- I have not installed scipy because I don't know how to point
sage_fortran.bin to my fortran compiler. I'm sure the solution simple
though...

Tests that failed:
   sage -t  algebras/free_algebra_quotient.py
sage -t  calculus/calculus.py
sage -t  ext/interactive_constructors_c.pyx
sage -t  functions/constants.py
sage -t  functions/functions.py
sage -t  functions/transcendental.py
sage -t  geometry/lattice_polytope.py
sage -t  interfaces/gap.py
sage -t  interfaces/singular.py
sage -t  lfunctions/lcalc.py
sage -t  lfunctions/sympow.py
sage -t  matrix/matrix2.pyx
sage -t  matrix/matrix_integer_dense.pyx
sage -t  matrix/matrix_mpolynomial_dense.pyx
sage -t  matrix/matrix_space.py
sage -t  modular/ssmod/ssmod.py
sage -t  plot/plot.py
sage -t  rings/number_field/number_field.py
sage -t  rings/number_field/number_field_element.pyx
sage -t  rings/number_field/number_field_ideal_rel.py
sage -t  rings/polynomial/groebner_fan.py
sage -t  rings/polynomial/multi_polynomial_element.py
sage -t  rings/polynomial/multi_polynomial_ideal.py
sage -t  rings/polynomial/multi_polynomial_ideal_libsingular.pyx
sage -t  rings/polynomial/multi_polynomial_libsingular.pyx
sage -t  rings/polynomial/multi_polynomial_ring.py
sage -t  rings/polynomial/multi_polynomial_ring_generic.pyx
sage -t  rings/polynomial/polynomial_element.pyx
sage -t  rings/polynomial/polynomial_quotient_ring.py
sage -t  rings/polynomial/polynomial_quotient_ring_element.py
sage -t  rings/polynomial/polynomial_singular_interface.py
sage -t  rings/polynomial/term_order.py
sage -t  rings/polynomial/toy_buchberger.py
sage -t  rings/complex_double.pyx
sage -t  rings/homset.py
sage -t  rings/morphism.py
sage -t  rings/power_series_ring.py
sage -t  rings/quotient_ring.py
sage -t  rings/quotient_ring_element.py
sage -t  rings/real_double.pyx
sage -t  rings/real_rqdf.pyx
sage -t  rings/ring.pyx
sage -t  schemes/elliptic_curves/ell_padic_field.py
sage -t  schemes/elliptic_curves/ell_rational_field.py
sage -t  schemes/generic/affine_space.py
sage -t  schemes/generic/algebraic_scheme.py
sage -t  schemes/generic/divisor.py
sage -t  schemes/generic/morphism.py
sage -t  schemes/generic/projective_space.py
sage -t  schemes/hyperelliptic_curves/hyperelliptic_padic_field.py
sage -t  schemes/plane_curves/affine_curve.py
sage -t  schemes/plane_curves/constructor.py
sage -t  schemes/plane_curves/curve.py
sage -t  schemes/plane_curves/projective_curve.py
sage -t  structure/element.pyx



 didier

 
  Cheers,
 
  Michael
 
 
   
 


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: Fwd: Trac rules

2007-09-24 Thread didier deshommes

2007/9/24, Robert Bradshaw [EMAIL PROTECTED]:

 I like the idea of giving people edit access to a wiki when they
 become contributors, and think this should be periodically (and
 perhaps manually) copied over to a static page periodically.

+1


 - Robert




 


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: Fwd: Calculus

2007-09-18 Thread didier deshommes

BTW, matlab has 1-based indexing too. Maple has both: there is an
array object that can be 0,1,2,... based and a List object that is
1-based. I think it would be nice to have an iterator object similar
to (1:n) in matlab (but not a list object).

didier

2007/9/18, Joel B. Mohler [EMAIL PROTECTED]:

 On Tuesday 18 September 2007 14:34, Robert Bradshaw wrote:
   I still like the [a..b] notation that makes
  things totally obvious, and I am as surprised as Peter Doyle at the
  shift of topic of whether or not indices should be 0-based (which we
  don't have a choice about while sticking with Python).

 Well, I'll respond as to why I think they are exactly the same issue (in
 spirit) since I'm the one who brought up 0-based vs. 1-based.   To me, it is
 very very intuitive that range(10) has 10 elements.  The only serious point
 of contention is where those 10 elements start.  That's why I think that
 these are the same issues.

 I'll also say that I didn't mean to open this can of worms.  It was just on my
 mind at the time and I don't really expect us to preparse or change python to
 work around this.  However, I could fully understand why anyone would think
 it a royal pain in the neck.  When trying to compute something that you read
 on paper, it is a continual conversion and a very confusing conversion.
 After all, one of the classic source of programming errors is off-by-one.

 --
 Joel

 


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: Sage 2.8.3 on Solaris - A New Hope

2007-09-17 Thread didier deshommes

2007/9/16, mabshoff [EMAIL PROTECTED]:
 Didier, does sage -testall pass on your install?

Actually, I stopped at lapack due to lack of time. I'm plan to
continue where I left things off on thursday (a little before sbd 3
officially starts).

didier


 Cheers,

 Michael


 


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: Sage 2.8.3 on Solaris - A New Hope

2007-09-16 Thread didier deshommes

2007/9/16, mabshoff [EMAIL PROTECTED]:
 Solaris 10 on Opteron:

 toolchain:

 ../gcc-4.2.1/configure --with-ld=/usr/sfw/i386-sun-solaris2.10/bin/ld
 --with-as=/usr/sfw/bin/gas \
 --prefix=/usr/local/gcc-4.2.1 --enable-languages=c,c++,fortran --with-
 gmp=/usr/local/gmp-4.2.2-32/ \
 --with-mpfr=/usr/local/mpfr-2.2.1p2-32/
 ###
 Issues:
 ###

I am using solaris 10 also (granted, on a p4), but so far I'm not
running into as many issues are you are:
~/custom/sage-2.8.4.2 $ uname -a
SunOS unknown 5.11 snv_57 i86pc i386
~/custom/sage-2.8.4.2 $ gcc -v
Reading specs from /opt/csw/gcc4/lib/gcc/i386-pc-solaris2.8/4.0.2/specs
Target: i386-pc-solaris2.8
Configured with: ../sources/gcc-4.0.2/configure --prefix=/opt/csw/gcc4
--with-local-prefix=/opt/csw --with-gnu-as --with-as=/opt/csw/bin/gas
--without-gnu-ld --with-ld=/usr/ccs/bin/ld --enable-threads=posix
--enable-shared --enable-multilib --enable-nls --with-included-gettext
--with-libiconv-prefix=/opt/csw --with-x --enable-java-awt=xlib
--with-system-zlib --enable-languages=c,c++,f95,java,objc,ada
Thread model: posix
gcc version 4.0.2

I am using  pre-compiled packages from blastwave. The only showstopper
has been lapack:
sage_fortran -fPIC  -c lsame.f -o lsame.o
ld.so.1: f951: fatal: relocation error: file
/opt/csw/gcc4/libexec/gcc/i386-pc-solaris2.8/4.0.2/f951: symbol
__gmpn_clz_tab: referenced symbol not found

ntl, python, libgcrypt and even linbox are some of the packages that
build flawlessly.

didier


 * libgcrypt-1.2.4

 In src/tests/Makefile.in:

 LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS)
 \
 $(AM_LDFLAGS) $(LDFLAGS) -lnsl -lsocket -lmp -lscf -lgen -
 ldoor -lmd -lgcc_s -L/lib/ -luutil -o $@

 Bug in os installation: in /lib: missing link to libuutil.so from
 libuutil.so.1?

 * opencdk-0.5.9

 In src/tests/Makefile.in:

 LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS)
 \
 $(AM_LDFLAGS) $(LDFLAGS) \
 -lnsl -lsocket -lmp -lscf -lgen -ldoor -lmd -lgcc_s -L/lib/ -
 luutil -o $@


 * gnutls-1.6.3: unresolved problem:

 /bin/bash ../libtool --tag=CC   --mode=link gcc  -D_REENTRANT -
 D_THREAD_SAFE -Wno-pointer-sign -pipe -I/export/home/mabshoff/
 sage-2.8.4.2/local/include  -I/export/home/mabshoff/sage-2.8.4.2/local/
 include   -lnsl -lsocket -lmp -lscf -lgen -ldoor -lmd -lgcc_s -L/lib/ -
 luutil -o gnutls-serv serv-gaa.o serv.o common.o select.o ../lib/
 libgnutls.la ../libextra/libgnutls-extra.la -L/export/home/mabshoff/
 sage-2.8.4.2/local/lib -lgcrypt -L/export/home/mabshoff/sage-2.8.4.2/
 local/lib -lgpg-error
 gcc -D_REENTRANT -D_THREAD_SAFE -Wno-pointer-sign -pipe -I/export/home/
 mabshoff/sage-2.8.4.2/local/include -I/export/home/mabshoff/
 sage-2.8.4.2/local/include -o .libs/gnutls-serv serv-gaa.o serv.o
 common.o select.o  -lnsl -lsocket -lmp -lscf -lgen -ldoor -lmd -lgcc_s
 -L/lib/ -luutil ../lib/.libs/libgnutls.so -L/export/home/mabshoff/
 sage-2.8.4.2/local/lib ../libextra/.libs/libgnutls-extra.so /export/
 home/mabshoff/sage-2.8.4.2/spkg/build/gnutls-1.6.3/src/lib/.libs/
 libgnutls.so -lz -lxnet /export/home/mabshoff/sage-2.8.4.2/local/lib/
 libgcrypt.so /export/home/mabshoff/sage-2.8.4.2/local/lib/libgpg-
 error.so -Wl,--rpath -Wl,/export/home/mabshoff/sage-2.8.4.2/local/lib
 ../libextra/.libs/libgnutls-extra.so: undefined reference to
 [EMAIL PROTECTED]'
 ../libextra/.libs/libgnutls-extra.so: undefined reference to
 [EMAIL PROTECTED]'
 ../libextra/.libs/libgnutls-extra.so: undefined reference to
 [EMAIL PROTECTED]'
 ../libextra/.libs/libgnutls-extra.so: undefined reference to
 [EMAIL PROTECTED]'
 ../libextra/.libs/libgnutls-extra.so: undefined reference to
 [EMAIL PROTECTED]'
 ../libextra/.libs/libgnutls-extra.so: undefined reference to
 [EMAIL PROTECTED]'
 ../libextra/.libs/libgnutls-extra.so: undefined reference to
 [EMAIL PROTECTED]'
 ../libextra/.libs/libgnutls-extra.so: undefined reference to
 [EMAIL PROTECTED]'
 ../libextra/.libs/libgnutls-extra.so: undefined reference to
 [EMAIL PROTECTED]'

 Odd, because ntohs and so on are in -lsocket -lnls -lresovl - cc
 shooting across. Sun ld issue?

 * python: needs -lrt -laio -lmd for symbols sem_init() - bug in
 configure script.
   -lmd also fixes md5 import problem.

   problems with sockets - see below:

 * twisted: import socket fails

 running install_egg_info
 Writing /export/home/mabshoff/sage-2.8.4.2/local/lib/python2.5/site-
 packages/zope.interface-3.3.0-py2.5.egg-info
 Traceback (most recent call last):
   File setup.py, line 20, in module
 from twisted import copyright
   File ./twisted/__init__.py, line 26, in module
 from twisted.python import compat
   File ./twisted/python/compat.py, line 15, in module
 import sys, string, socket, struct
   File /export/home/mabshoff/sage-2.8.4.2/local/lib/python2.5/
 socket.py, line 45, in module
 import _socket
 ImportError: No module named _socket
 Error: Subprocess exited with result 1 for project core
 Error installing Twisted networking 

[sage-devel] Re: Sage 2.8.3 on Solaris - A New Hope

2007-09-16 Thread didier deshommes

2007/9/16, mabshoff [EMAIL PROTECTED]:
 it looks like you are running a fairly recent OpenSolaris build. But
 is it pure OpenSolaris or Nexenta? I know you used Nexenta in the
 past, but that is quite different because the userspace is close to
 100% GNU while Solaris is sufficiently different to cause issues. I
 run the latest official Solaris 10 U4:

It is pure Solaris. More specifically this is Solaris Express
Community Edition b57. The only modifications I made is that I  use
gnu build tools whenever I can (ie gmake, gcc, gas, ranlib, tar, etc).
I hope that answers your question.


 uname -a
 SunOS unknown 5.10 Generic_120012-14 i86pc i386 i86pc

  ~/custom/sage-2.8.4.2 $ gcc -v
  Reading specs from /opt/csw/gcc4/lib/gcc/i386-pc-solaris2.8/4.0.2/specs
  Target: i386-pc-solaris2.8
  Configured with: ../sources/gcc-4.0.2/configure --prefix=/opt/csw/gcc4
  --with-local-prefix=/opt/csw --with-gnu-as --with-as=/opt/csw/bin/gas
  --without-gnu-ld --with-ld=/usr/ccs/bin/ld --enable-threads=posix
  --enable-shared --enable-multilib --enable-nls --with-included-gettext
  --with-libiconv-prefix=/opt/csw --with-x --enable-java-awt=xlib
  --with-system-zlib --enable-languages=c,c++,f95,java,objc,ada
  Thread model: posix
  gcc version 4.0.2
 
  I am using  pre-compiled packages from blastwave.

  --enable-threads=posix might take care of some of the python issue.
 I have seen python 2.5.1 at blastwave.org, so I assume it is possible
 to build it without too much fiddling. William and  I wanted to build
 everything from source without the need to install external packages.
 And we are trying to also get it to work in Solaris 9.


 Haven't seen that one. But it is a GMP symbol and I have no idea why
 that would be linked against Lapack. The BlastWave binary also seems
 to have been compiled for Solaris 2.8, so that might be an issue.

Come to thinks about it, I think the gfortran lapack package installs
mpfr (or gmp I can't remember) with it. The solution might as simple
as grabbing the gfortran binary for x86-solaris and installing it
manually.

didier

 


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: next bug squash?

2007-08-20 Thread didier deshommes

2007/8/20, William Stein [EMAIL PROTECTED]:

 Hi,

 I propose that the next SAGE bug squash even be Saturday, September 1, which 
 is
 in two weeks.   Whose interested?

Looks like I'll miss that one too, as I'll be out of town for labor
day weekend.


 Those are just some ideas for what would make SAGE 3.0 material.
 Let me know what you think.

High on my wishlist is being able to run SAGE on solaris 10
(opensolaris). With all the work that has been done on porting SAGE on
solaris 9,  this should be easier... in theory.

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] What you need to build SAGE

2007-08-20 Thread didier deshommes

[I was going to post this on Trac as an enhancement, but Trac seems
to be down at the moment]

Hi,
Current;y, the only official dependencies for SAGE are: gcc, g++,
make, m4, perl, ranlib, and tar (in $SAGE_ROOT/README.txt). I'd like
to see these specified with a little more detail in the README file,
so that new users know exactly what they need to make SAGE run. These
are what I've used to build SAGE on my laptop on linux (ubuntu 7.04):
gcc/g++ 4.1 and above (version 3.4 OK)
autoconf 2.59 and above
automake 1.10
flex 2.5.33
bison 2.3
make 3.81
bunzip2 1.0.3
tar 1.6
perl 5.0
ranlib 2.17.50
m4 1.4.8

Anything I'm missing?

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: next bug squash?

2007-08-20 Thread didier deshommes

2007/8/20, mabshoff [EMAIL PROTECTED]:

 The overall situation: Most major packets build, I believe sympow and
 cvxopt are the remaining holdouts. cvxopt  complains about a missing
 complex.h. I know that there cvxopt binaries for Solaris - so any
 ideas? sympow might be slightly harder to crack due to the whole Sparc
 thing.

Hi,
I had no problem building sympow after making sure that CC='gcc'. Of
course, it gives me: You do not appear to have an x86 based system
--- not using fpu.c
 and I don't know whether that's important or not (is that what the
Sparc thing is about?). I should have more time to look at it in 4
hours.

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: next bug squash?

2007-08-20 Thread didier deshommes

2007/8/20, mabshoff [EMAIL PROTECTED]:
 Yeah, I think that sympow uses extended precision for doubles. I never
 ran properly on Cygwin on x86 cpus, so I am somewhat worried on
 getting this to run properly on Sparc without some freaky gcc flags or
 some sparc assembly. I don't think it is high on Willam's priority
 list because it seems to be rather specialized,


This is another linux-ism (x86-specific to boot). I would not worry
about it. I can't imagine that this would be so important that it
needs extended precision. Otherwise, sympow would be useless on
anything not linux and not x86.

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: next bug squash?

2007-08-20 Thread didier deshommes

2007/8/20, didier deshommes [EMAIL PROTECTED]:
Updated spkg for sympow here:
http://sage.math.washington.edu/home/dfdeshom/sympow-1.018.1.p2.spkg

didier

 2007/8/20, mabshoff [EMAIL PROTECTED]:
  Yeah, I think that sympow uses extended precision for doubles. I never
  ran properly on Cygwin on x86 cpus, so I am somewhat worried on
  getting this to run properly on Sparc without some freaky gcc flags or
  some sparc assembly. I don't think it is high on Willam's priority
  list because it seems to be rather specialized,
 

 This is another linux-ism (x86-specific to boot). I would not worry
 about it. I can't imagine that this would be so important that it
 needs extended precision. Otherwise, sympow would be useless on
 anything not linux and not x86.

 didier


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: quaddouble in sage, and other floating point issues

2007-08-13 Thread didier deshommes

2007/8/11, Jonathan Bober [EMAIL PROTECTED]:

 cdef class RealQuadDoubleField_class(Field):
 
 Real Quad Double Field
 

 def __init__(self):
 fpu_fix_start(self.cwf)

 def __dealloc__(self):
 fpu_fix_end(self.cwf)

 [etc]

 __dealloc__() is never called until sage exits, however, since a global
 instance of this class is created at startup. This means that all


I didn't realize this, but I don't think RealQuadDoubleField_class
needs to set the flags. If one looks at the  QuadDoubleElement class,
the fpu_fix_*() functions are called every time a quad double number
is created  and destroyed, which I think is more appropriate. This
might be the solution. I haven't actually checked this though (it's
late here...).


 (3a)What I think might be the best idea, at least on Linux, is to change
 the compilation settings for quad double so that the fpu fix is not
 needed. There are two ways to do this: If a processor supports sse2,
 then passing gcc -march=whatever -msse2 -mfpmath=sse (maybe the -march
 isn't needed) will cause gcc to use sse registers and instructions for

 doubles, and these have the proper precision. In fact, gcc already does
 this by default for x86-64 cpus, so the quad double package doesn't even

Yes, the fpu_fix_() functions are meant to only work around the
weird (depending on your perspective) behavior of  x86 cpus.

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: Fwd: sage_c_lib patch

2007-08-02 Thread didier deshommes

2007/8/2, William Stein [EMAIL PROTECTED]:
 should be a subdirectory of SAGE_ROOT/devel/sage/, and
 SAGE_ROOT/devel/sage/spkg-install should install both, and
 setup.py should be extended to build the c_lib if it changes.
 Moreover, spkg-dist in SAGE_ROOT/devel/sage should of course
 package up the c_lib directory.  This way when somebody wants to
 write code that involves both c_lib and the normal SAGE library (something
 that is very common), only a single hg repository is involved.

Could there be a case where someone would write code only for
sage_c_lib and not need the whole sage.spkg? I have no idea if this
actually happens, I'm just asking for completeness :)

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: computing the number of partitions of an integer

2007-07-30 Thread didier deshommes

2007/7/30, Bill Hart [EMAIL PROTECTED]:
 I have a similar problem in some code I am currently
 writing. I need precisely quad precision, so mpfr is out of the
 question.

Hi Bill,
You might want to consider Yozo Hida's quaddouble C/C++ package here:
http://www.cs.berkeley.edu/~yozo/

There is also a wrapper for it in SAGE.

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: 3 feature request for multivariate polynomials

2007-07-29 Thread didier deshommes
) for _ in 
range(n)])
+   for _ in range(terms) ]
+_coeffs = [R.random_element(*args,**kwds) for _ in range(terms)]
+
+d = dict( zip(tuple(_exponents),_coeffs) )
+return multi_polynomial_element.MPolynomial_polydict(self, PolyDict(d))
+
+
 
 # Leave *all* old versions!
 
diff -r 711283cd88d7 sage/rings/polynomial/polynomial_element.pyx
--- a/sage/rings/polynomial/polynomial_element.pyx  Tue Jul 24 16:24:24 
2007 -0700
+++ b/sage/rings/polynomial/polynomial_element.pyx  Mon Jul 30 00:49:44 
2007 -0400
@@ -2129,6 +2129,31 @@ cdef class Polynomial(CommutativeAlgebra
 
 return self // self.gcd(self.derivative())
 
+def norm(self, p):
+r 
+Return the \code{p^th} norm of this polynomial
+
+EXAMPLES:
+sage: R=RR['x'] ; x = R.0
+sage: f = x^6 + x^2 + -x^4 -x^3
+sage: f.norm(2) == 2.0
+
+sage: f.norm(1)
+4.00
+sage: f.norm(infinity)
+1.00
+
+AUTHOR:
+-- didier deshommes
+
+coeffs = self.coeffs()
+if 1 == p:
+return RR(sum([abs(i**p) for i in coeffs]))
+
+if p is infinity:
+return RR(max([abs(i) for i in coeffs]))
+
+return RR(sum([abs(i)**p for i in coeffs]))**(1/p)
 
 # - inner functions -
 # Sagex can't handle function definitions inside other function
@@ -2185,8 +2210,6 @@ cdef do_karatsuba(left, right):
 t0 = bd
 return _karatsuba_sum(t0,_karatsuba_sum(t1,t2))
 
-
-
 cdef class Polynomial_generic_dense(Polynomial):
 
 A generic dense polynomial.
@@ -2497,6 +2520,8 @@ cdef class Polynomial_generic_dense(Poly
 modulo $x^n$.
 
 return self._parent(self.__coeffs[:n], check=False)
+
+
 
 def make_generic_polynomial(parent, coeffs):
 return parent(coeffs)


[sage-devel] Re: predefined symbolic variable names

2007-07-08 Thread didier deshommes

2007/7/8, Hamptonio [EMAIL PROTECTED]:

 My biases are probably based on using mathematica for 17 years, but I
 like the way it handles numerical vs symbolic computations.  So at
 present, in sage, sin(1) is symbolic, and sin(1.0) is numerical, and

+1, I like this behavior as well. And I like that currently you can
mix both symbolic and numerical types  (e.g. in polynomial
expressions).

 this I think is good.  What I think is bad is that something like
 1.0*sin(1) is not numerical - in mathematica the sin(1) would be

Some people like symbolic expression, some like numerical expressions
for the above case :) .

This is off-topic: given a floating-point number, I think it would be
cool to have a way of telling users, BTW,34.0191213743 is quite close
to  7*(pi + e - 1) in the field you're working with. This is probably
very hard.

2007/7/7, William Stein [EMAIL PROTECTED]:
 So I propose that the only symbolic variables that are predefined
 are x (since it's so useful to have this predefined), I (=sqrt(-1)),
 and e (=2.7...).

What about pi? :) . It seems to me that pi is as special as e.

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: request for comments: ZZ(ZZ(FOO).binary(),2) == FOO

2007-06-28 Thread didier deshommes

On 6/29/07, David Harvey [EMAIL PROTECTED] wrote:


 On Jun 28, 2007, at 5:04 PM, Martin Albrecht wrote:

  Hi there,
 
  I often come across the situation where I have to construct an
  integer from
  its binary representation and vice versa. So far you do it in SAGE
  using
  strings. I have attached a preliminary patch which allows the
  following code
  to work, i.e. I _replaced_ the binary() method (which returned a
  string) with
  a method that returns a tuple of Python ints.
 
  sage: e = ZZ(10231252).binary(); e
  (1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1,
  0, 0)
  sage: ZZ(e,2)
  10231252
 
  I know that this patch has some issues:
  * it breaks doctests which rely on strings (fix by replace ZZ.binary
  () with
  ZZ.str(2))
  * it returns a tuple of Python ints should return tuple (?) of GF
  (2) elements
  but I didn't want to mess with imports yet
  * it can be done faster
  * you loose the minus sign: ZZ(-1).binary() is (1,), shall it raise an
  exception then?
 
  I am not out for micromanagement but I hesitate to just submit a
  polished
  patch as the Integers are such a central building block of SAGE.
  So, does
  anybody actually like the current behavior of ZZ.binary() which
  returns a
  (signed) string? Any other objections against making the above work?

 Hmmm I don't know if I like this. Well, I don't have any objections
 to such a method being available, but I prefer the name binary to
 have the current behaviour. It's more pythonic, like the hex function.

+1 for keeping the method and but changing the name.

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: spkg refactoring and development model

2007-06-27 Thread didier deshommes
On 6/22/07, William Stein [EMAIL PROTECTED] wrote:
 Could you say something about the fact that currently there is no way
 to uninstall
 a SAGE package, since we don't track what files are actually
 installed.  That said,
 we definitely *could* implement something simple that stores a list of
 all files installed
 in the install certificate in the spkg/installed directory.  I'm
 thinking of something like
 computing a list of all files before then after the install, hence
 getting a list of what
 was installed (plus a list of files overwritten).   Anyway, I'm just
 randomly throwing this
 out for comment.  Maybe people who do gentoo/rpm/deb's can make a more
 intelligent comment. For SAGE uninstall isn't a big deal, since 
 essentially
 nobody ever wants to uninstall a package.

It's mostly painless to remove a package if:
-- you know where all its files are. Most of them are in
SAGE_ROOT/local/include/ and SAGE_ROOT/local/lib/ . It's pretty to
figure out what goes where from the spkg-install script.
-- you know that SAGE won't be using the functionality provided by
this package itself. It would be really cool if by removing maxima for
example, the uninstall script also figured out that that
SAGE_ROOT/devel/sage-main/sage/calculus/*.py would also have to be
removed. Really cool, but probably a bit overkill
-- you remove the file with its name located in SAGE_ROOT/spkg/installed/

BTW, I have attached a small patch that makes installing an SPKG from
a hard drive possible.

On 6/19/07, Brian Granger [EMAIL PROTECTED] wrote:
 Isn't newest_version already on the users system if they already have
 sage installed - it is usd to build sage in the first place.

It's already there, along with all standard packages that are needed
to build SAGE. I'm not sure why it's still being downloaded.

 This is a great summary of all spkg things!  This should definitely be
 put into the SAGE docs somewhere.

There is a section on creating an SPKG
(http://modular.math.washington.edu/sage/doc/html/prog/node24.html), I
can update it to reflect the new changes.

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---

diff -r 1b20b47c02d7 sage-spkg
--- a/sage-spkg Sat Jun 02 22:31:55 2007 -0700
+++ b/sage-spkg Wed Jun 27 14:16:26 2007 -0400
@@ -83,6 +83,12 @@ PKG_NAME=`basename $PKG_NAME`
 PKG_NAME=`basename $PKG_NAME`
 PKG_SRC=$1
 PKG_BASE=`echo $PKG_NAME | sed -e s/-.*//`
+
+# This is a local package
+if [  -f $PKG_SRC ]; then
+echo Installing $1 from hard drive
+PKG_SRC=$1
+fi
 
 if [ ! -f $PKG_SRC ]; then
 if [ -f $SAGE_PACKAGES/standard/$PKG_NAME.spkg ]; then


[sage-devel] Re: spkg refactoring and development model

2007-06-22 Thread didier deshommes

On 6/18/07, Nick Alexander [EMAIL PROTECTED] wrote:

 didier deshommes [EMAIL PROTECTED] writes:

  On Jun 1, 10:59 am, William Stein [EMAIL PROTECTED] wrote:
  package_dir
  spkg-install-- (required) shell script run to install the package
  spkg-rebuild  -- (optional) download latest version of package from
   web page and recreate the src directory
  spkg-check-- (optional) runs the packages test suite after
spkg-install succeeds
  README.txt   -- (optional) what used to be SAGE.txt
  /patches-- (optional) any files needed by spkg-install for 
  patching
  /src-- (warning if not there) exact copy of what
  is available
at some website.
  /.hg-- (optional) mercurial repository that has
spkg-install, spkg-rebuild,
spkg-check, README.txt and all contents
  of patches.
 

 This is unbelievably cool.  I just had to hard reinstall IPython
 because I hacked it too hard and couldn't hg revert to the previous
 revision.  A little tutorial on how one hacks a SAGE package would
 really help developers such as Dave Saunders, who is working on
 linbox_wrap, too.

I'm not sure how to write this since it seems to be so easy to me.
I'll start from the begining, ie I won't worry about dumbing it down
too much and stating obvious things.

Q: what is a SAGE package?
A: A SAGE package (spkg) is a script that builds an install a piece of
software for your SAGE installation. Thus an spkg usually has 2 things
in it:
- The source code of the software
- The script that will build and install the software into SAGE.

Q: What does one look like?
A: Look in SAGE_ROOT/spkg/standard and you'll find a bunch of files
with .spkg extensions. For example box-1.0.spkg might be a package
living there. An spkg is just a tar ball. If you decompress
box-1.0.spkg, you'll see something that looks like this:
box-1.0/
spkg-install  -- (required) shell script run to install the package
spkg-check  -- (optional) runs the packages test suite after
 spkg-install succeeds
SAGE.txt  -- Any modification done to the src/ directory are
recorded here
   /patches-- (optional) any files needed by spkg-install for patching
   /src-- the software that has to be installed.
   /.hg-- A mercurial repository that has
spkg-install, spkg-rebuild,
spkg-check, SAGE.txt and all contents patches.

Q: What's new about this format? What's all the fuss about?
A: It was decided that:
--  Having the installation scripts under version control would be a
good idea for people that have to make and modify spkg's frequently.
-- Separating source code and installation scripts would  would keep
us from the temptation of forking other projects. I also think this
will force us

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: spkg refactoring and development model

2007-06-22 Thread didier deshommes

[Apologies, I hit Send too soon]

I'm not sure how to write this since it seems to be so easy to me.
I'll start from the beginning, ie I won't worry about dumbing it down
too much and stating obvious things.

Q: what is a SAGE package?
A: A SAGE package (spkg) is a script that builds an install a piece of
software for your SAGE installation. Thus an spkg usually has 2 things
in it:
- The source code of the software
- The script that will build and install the software into SAGE.

Q: What does one look like?
A: Look in SAGE_ROOT/spkg/standard and you'll find a bunch of files
with .spkg extensions. For example box-1.0.spkg might be a package
living there. An spkg is just a tar ball. If you decompress
box-1.0.spkg, you'll see something that looks like this:
box-1.0/
spkg-install  -- (required) shell script run to install the package
spkg-check  -- (optional) runs the packages test suite after
spkg-install succeeds
SAGE.txt  -- Any modification done to the src/ directory are
recorded here
  /patches-- (optional) any files needed by spkg-install for patching
  /src-- the software that has to be installed.
  /.hg-- A mercurial repository that has
spkg-install, spkg-rebuild,
   spkg-check, SAGE.txt and all contents patches.

Q: What's new about this format? What's all the fuss about?
A: It was decided that:
--  Having the installation scripts under version control would be a
good idea for people that have to make and modify spkg's frequently.
-- Separating source code and our patches would  would keep
us from the temptation of forking other projects. I also think this
will force us to send patches upstream when we're tired of managing
too much of them.

Q: OK, so how do I create one?
A: Suppose you have a piece of software called pa-1.0.tar.gz written
in C/C++ that you've downloaded from sourceforge. Here's how I would
do it:
-- make a fresh directory. I'll call mine new/
-- save pa-1.0.tar.gz in it
-- untar  pa-1.0.tar.gz
-- rename  pa-1.0/ to src/
-- create a spkg-install script. This is a shell script that will run
./configure, make, make install.  You want to install the library in
SAGE_ROOT/local/lib/, so might want to set
--prefix=SAGE_ROOT/local/lib/ for the configure script. Header files
go into SAGE_ROOT/local/include. Any additional libraries that you
want to compile  pa-1.0 against are in  SAGE_ROOT/local/lib/ , BTW.
-- if you have to modify pa-1.0 's source itself in any way, don't do
it directly. Instead, put the file you've modified in the patches/
directory, and in your spkg-install script, run something like
cp patches/file.c src/file.c
before configuring and building.
-- put spkg-install and patches/ under version control:
hg init ; hg add spkg-install patches; hg ci -m new spkg created for pa!
-- rename new/ to pa-1.0/
-- run: sage -spkg pa-1.0/ and it will create for you pa-1.0.spkg. You're done!

Special thanks to Brian, William and Joel for the discussion and feedback.

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: spkg for sage_c_lib

2007-06-20 Thread didier deshommes

On 6/20/07, Joel B. Mohler [EMAIL PROTECTED] wrote:
 Anyhow, the new package for sage_c_lib gets a bit confusing because we had a
 mercurial repository for the actual development of the sage_c_lib in the
 original sage_c_lib spkg.  The new spkg spec calls for a mercurial repository
 for the spkg-* scripts in the root of the spkg.  Do we want both of these
 mercurial repositories in the spkg?

 2)  Have a single mercurial repository for both the spkg-* scripts and the
 actual code in the src/ subdirectory.

+1. This is basically what the spkg looks like now: Header files, src/
subdir, configure, Makefile, spkg-install, etc are all in a single
repo.

 3)  Keep the actual code source control outside the spkg and release
 non-version controlled tarballs from this to be packaged in the spkg.

+0. This would be ideal but requires that someone has to worry about
making a separate package for sage_c_lib (by running hg archive
periodically, for example. Maybe this could be a cron job?)


didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: spkg refactoring and development model

2007-06-19 Thread didier deshommes

On 6/18/07, Brian Granger [EMAIL PROTECTED] wrote:
 I am talking about the both the directory structure that is needed for
 the script/makefiles to function properly:

 spkg/
 standard/
 base/

 As well as the actual scripts and makefiles (deps, install,
 newest-version, etc) that have to be in particular locations in that
 tree to work properly.  For instance, deps as to be in standard,
 install in spkg newest-version in standard, and a bunch of stuff has
 to be in base.

I agree with this: the scripts in spkg/, spkg/base/ and spkg/standard/
should be  under version control.

 SPKG.txt
 SPKG-README.txt

I vote for SPKG.txt too.

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: spkg refactoring and development model

2007-06-19 Thread didier deshommes

On 6/18/07, Brian Granger [EMAIL PROTECTED] wrote:
  Then SAGE wouldn't know that the package had been updated.
  Those version numbers are used to determine whether it is
  necessary to install a package.

 I didn't know SAGE was actually using them.  Is this when sage -update
 is run?  My understanding is that the decision to upgrade something
 was based on the timestamps if the files compared with the stub in the
 installed directory.  Am I mistaken.

The sage-update script gives an idea of how sage is upgraded from a SAGE_SERVER:
- download the new install script
- download the new list file. The list file contains all spkgs with
their version numbers. It is from it that sage knows which packages
have been updated and why specifying version numbers for now is
necessary.
- download the new deps file
- download the newest_version script. newest_version determines the
latest version of an spkg you have installed locally.
- check the contents of your list file against your `ls
spkg/standard/`. Anything that is in list and not in the output of ls
is downloaded.

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: sage_c_lib-2.6.p1.spkg

2007-06-18 Thread didier deshommes

On 6/18/07, David Harvey [EMAIL PROTECTED] wrote:

 Questions re: above package:

 * there are uncommitted changes in that directory i.e. hg diff
 gives nontrivial output. That's a bit weird. Are the changes supposed
 to be committed or rolled back?
 * there's also a lot of other crud, like object files etc, probably
 doesn't belong there.

I will clean that up. I didn't touch the sage* packages because I
assumed they were already in order

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: spkg refactoring and development model

2007-06-01 Thread didier deshommes

On 6/1/07, Joel B. Mohler [EMAIL PROTECTED] wrote:
 The main relation of this to the current discussion is that gentoo solves the
 patch/mainline problem by distributing patch files which are applied on the
 user's computer before the build of the package in question.  Sometimes there
 are a large number of patches applied (I don't have a specific example, but
 I'm pretty sure I've seen as many as 10-15 patches applied before a build.)
 This way it is very clear to any concerned individual exactly what is coming
 from upstream (the original package is downloaded as part of the install
 process), vs. what is coming from the gentoo packagers.

I'm sure I'm missing something here. Could you elaborate more on how
gentoo does it to solve the patching problem? If it's just a bunch of
bash scripts, couldn't we write them ourselves? It seems to me that
this is basically what spkg-install is doing now.

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: spkg refactoring and development model

2007-06-01 Thread didier deshommes

On 5/31/07, Brian Granger [EMAIL PROTECTED] wrote:

   For each spkg, there would be a corresponding directory containing the
   spkg-install script and the sage subdirectory (but _not_ the source
   code for the package itself).  I think it would be a good idea to
   create a format for the spkgs that is a little more standardized.
   Here is an example:
  
   ipython-0.8
   spkg-install # existing spkg-install script
   ./spkg-patches   # rename the sage directory to this for clarity
   spkg-fetch.py # a python script that could be called to
   get the source for ipython

Would spkg-fetch.py download package A from A's homepage or from sage.math?

  
   I think the spkg-fetch.py script is an important part of this.  It
   would allow us to not include the source code for each package in the
   repo, but it would make it very easy to write a script that begins
   with only the scripts in the repo and builds a full source
   distribution of everything.
 I think this penalty could be paid once - the source packages could be
 downloaded into the hg tree - but not commited to the repo.  Once that
 is done, the spkgs could be built in place.

 My thought is that the only people who would have to do this are those
 who are maintaining/creating spkgs.  Most people will simply use the
 created spkgs that include the source.

So if I download sage-version.tar, it would have the spkgs with their
sources. If I ran sage -upgrade,  it would do an hg checkout on the
spkg/standard directory, update any spkg that needs to be and download
(if necessary) the sources to build and compile them. Did I get that
right?

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: spkg refactoring and development model

2007-06-01 Thread didier deshommes

On 6/1/07, Brian Granger [EMAIL PROTECTED] wrote:
 *  HG queues help with the issues of maintaining patches against a
 changing upstream source, but it is still a pain and nontrivial.

Would the mq extension help? It's an hg extension for managing queues:
http://www.selenic.com/mercurial/wiki/index.cgi/MqExtension

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: Building SAGE on NexentaOS?

2007-05-29 Thread didier deshommes

The problem doesn't seem to be with libtermcap or curses. It's a flag
problem. When compiling libsingular, the --shared flag has to be
passed to gcc, instead of the default -export-dynamic. For that, the
Makefile in Singular/Makefile has to have a secial section for
nexentaos as follows:
{{{
ifeq ($(SINGUNAME),ix86-nexentaos)
SO_SUFFIX = so
LIBSINGULAR_FLAGS = --shared
LIBSINGULAR_LIBS = -lsingfac -lsingcf -lntl -lreadline -lgmp -lomalloc_ndebug
endif
}}}

And for singular to find ix86-nexentaos, singuname.sh has to have the following:
{{{
elif (echo $uname_a | $egrep SunOS $devnull)
then
# NexentaOS ###
if (echo $uname_a | $egrep NexentaOS  $devnull)
then
   #echo 
   echo ${prefix}-nexentaos
   #echo 
   #exit 0
else
echo ix86-SunOS
#exit 0
fi
exit 0
}}}

Problem is, I don't know how to tell the make file Singular/Makefile
that --shared has to be passed to gcc for nexentaos. I could just
stick the first fragment showed above, but Singular/Makefile is
generated dynamically. How do I stick this piece of code in
Singular/Makefile dynamically?

didier

On 5/29/07, mabshoff [EMAIL PROTECTED] wrote:


 
  Hello,
 
  as far as I can tell these are symbols from the termcap library.

 Sorry, I should have written curses/ncurses library - too early for
 me.

  Could
  you post the exact command of the compiler/linker before the failure?
 
  There have been several efforts to get SAGE to build and run on
  proper Solaris, so I might be worthwhile that you post some patches.
 
  Cheers,
 
  Michael

 Cheers,

 Michael


 


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: Building SAGE on NexentaOS?

2007-05-29 Thread didier deshommes

On 5/29/07, Martin Albrecht [EMAIL PROTECTED] wrote:
 Hi, just stick it into Makefile.in. This is the source for the Makefile.

That did it and Singular built succesfully!

On 5/29/07, William Stein [EMAIL PROTECTED] wrote:
 Wow, Didier, many thanks for helping with the Solaris port
 of SAGE!  I've been wanting to finish this forever, and got
 stuck -- for example on linbox -- your help is *greatly* appreciated.
 Some of my notes related to this are here:
http://sage.math.washington.edu/home/was/lj/todo.txt

 Again, thanks!

I consider most of it to be pure luck (e.g. the linbox problem). I'm
seeing how far I can push it :)


Other packages that built:
extcode-2.5.3
freetype-2.1.10
gap-4.4.9
gd-2.0.33.p4
quaddouble-2.2.p6 (with some modifications. Solaris has a known bug
with isinfinity(double))
sage-2.5.3 (with some modifications to real_rqdf.p*)
sage_c_lib-2.5.3
sage_scripts-2.5.3
sagex-20070504
sqlite-3.3.17.p1
zodb3-3.6.0.p1

I'm now having trouble building clisp.
The errrors I get all look like this
{{{
:/export/home/dfdeshom/custom/sage-2.5.3/spkg/standard/clisp-2.41.p2/src/syscalls/calls.c:2151:
undefined reference to `uint64_to_I'
:/export/home/dfdeshom/custom/sage-2.5.3/spkg/standard/clisp-2.41.p2/src/syscalls/calls.c:2161:
undefined reference to `uint64_to_I'
}}}

I googled around and found that Joe Weening had already run into this
problem and a solution
(http://osdir.com/ml/mathematics.sage.general/2006-07/msg00011.html):

2. clisp-2.38/src/makemake.in sets BINARY_DISTRIB=1 for Solaris.  This
   causes an incorrect definition of uint64_to_I (and perhaps other
   problems).  Commenting out BINARY_DISTRIB=1 in makemake.in gave me
   a working clisp on 32-bit x86 Solaris.  I'm still having problems
   with clisp on 32-bit and 64-bit SPARC Solaris.


His solution does not seem to work for me. Does anyone has an idea of
what to try? I wish I could just apt-get it but Nexenta doesn't seem
to have it (it's still an alpha release).

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] SD4 room-sharing wanted for the first 3 days

2007-05-09 Thread didier deshommes

Hi there,
I am looking for someone to room-share with from Monday 11/06 to
Thursday 14/06 for SAGE Days 4.  If you would like to split the cost
of a room, please email me. I plan to stay at the College Inn ($75/
night).

didier


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: sage-2.5.alpha3

2007-05-06 Thread didier deshommes

All tests pass on my machine, a Centrino running ubuntu feisty:

didier

On 5/6/07, William Stein [EMAIL PROTECTED] wrote:

 Hello,

 I've posted sage-2.5.alpha3 here:

http://sage.math.washington.edu/home/was/sage2.5/

 Feedback is welcome.   This still won't build on OS X PowerPC or
 Cygwin, but should build on Linux and Intel OS X and pass make test
 there.  Also, it should have most code that people have sent me for
 inclusion in SAGE.   The official sage-2.5 is getting close, so any
 testing feedback is greatly appreciated.  In particular, if people
 could try out some of the new features in sage-2.5, especially symbolic
 computation, this would be quite valuable.

 Here's a list of the main things that are new in sage-2.5.alpha3:

 2.5: * new packages:
  - flintqs
  - ipython-0.8.0 (w stein)
  - maxima-5.12.0 (w stein)
  - python-2.5.1 (y qiang) -- important bug fixes
  - tachyon3d-0.98beta (w stein)
  * m abshoff:  cputime bugfix for cygwin
  * m albrecht: major new singular library mode interface for SAGE 
 which
provides the world's fastest polynomial
 arithmetic to SAGE (not
yet enabled by default!)
  * r bradshaw: tons of polynomial and power series optimizations;
Coleman p-adic integration; Kedlaya for genus  1
  * t clemens:  source browser bugfix
  * p de napoli:fix some bugs in rationals and integers
  * d deshomme: (refereed by r bradshaw and w stein) very good support
for Hida's quad-double field RQDF.
  * w hart: quadratic sieve update (SAGE's qsieve command):
 It is MUCH faster,
especially for large factorizations, on account
 of having implemented the
large prime variant. it will factor an 81 digit
 number in  20 minutes.
On the Athlon it is the fastest generally
 available implementation of the
quadratic sieve in the world for certain sized
 factorizations, and
only slightly behind at other sizes.
Another example: n =
 next_prime(2^110)*next_prime(2^120) has these
times on 32-bit 2Ghz linux: qsieve (107s), PARI
 (223s), Magma 2.13 (336s).
  * d harvey:   improvements, bug fixes.
  * d kohel:quaternion algebra improvements
  * k minola:   tmp file clean bugfix; misc build fixes.
  * k minola, d joyner:  updated the conway polynomial table
  * w stein and b moretti: major new symbolic calculus functionality
  * w stein:rewrite of SAGE/maxima interface.
  * c witty:(refereed by n alexandar) a new algebraic reals field
(Qbar meet RR!).  mpfr improvements

 


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: Python Access Control module?

2007-04-27 Thread didier deshommes

On 4/26/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 Does anybody know of some sort of kitchen-sink type of authentication module 
 that's commonly used in python?  For the notebook, I've had to write my own, 
 and it stinks -- any time a new feature is added, we forget to lock it down, 
 and it isn't at all robust or configurable.  It would seem that Yi is having 
 to write his own, too (granted, it sounds like he's thought about it a lot 
 more than I have).

 Can anybody suggest a pre-existing package that just works?

Googling aroung, I found this:
http://www.chrisarndt.de/en/software/python/#auth


This Python module collection provides functions and classes for
authentication purposes and user database management. Also included
are some command line scripts, examples and pydoc generated API
documentation.


I don't know if it works though :) . More web frameworks for python
can be found here:
http://wiki.python.org/moin/WebFrameworks

Also, doesn't Twisted have an authentication module? I haven't used
it, but it's the first thing I thought about when you posted this.

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] 2 notebook bugs

2007-04-23 Thread didier deshommes

Hi there,
I've noticed 2 problems with tne notebook:
-- When running sage in notebook mode from a directory other than
SAGE_ROOT (btw, I'm glad I can finally do this), SAGE reads/writes my
worksheets in $CURR_DIR/sage_notebook.
For example, iI'm running SAGE from:
{{{
/home/dfdeshom/custom/sage/devel/sage-main
}}}

Running sage in notebook mode, I read this on top of the page:
{{{
SAGE Notebook running from /home/dfdeshom/custom/sage/devel/sage-main/
sage_notebook.
}}}
And in fact, a directory is created and my worksheet is there. Is
there any way to prevent this? Maybe there should be a NOTEBOOK_DIR
variable set so that every worksheet created is forced to live in
SAGE_ROOT/sage_notebook?

-- When running SAGE from $SAGE_ROOT, every time I create a new
worksheet, it is created in GAP mode (a new feature in 2.4.2, I
think). This does not happen when I run it from a non-standard
directory. How do I get out of this mode?

On a related note, how is GAP mode implemented in the notebook? I've
been dreaming of writing Maple programs via the notebook since Maple's
own worksheet mode gets in my way (es)

didier


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: hg commit mailing list

2007-04-15 Thread didier deshommes

No, but there is an RSS feed if you want to see when commits are done:
http://www.sagemath.org/hg/sage-main?style=rss

didier

On 4/15/07, mabshoff [EMAIL PROTECTED] wrote:

 Hello,

 I was wondering wherther there is a hg commit mailing list? I googled
 for it and couldn't find anything.

 Cheers,

 Michael


 


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Fwd: [sage-devel] log_html() crashes

2007-04-13 Thread didier deshommes

FYI, this is still present in 2.4.2

-- Forwarded message --
From: didier deshommes [EMAIL PROTECTED]
Date: Feb 19, 2007 6:45 PM
Subject: [sage-devel] log_html() crashes
To: [EMAIL PROTECTED]


Allo,
{{{log_html}}} crashes because of undefined variable:

{{{
sage: log_html ()
[..]
245 T = self._title()
246 inlog = os.path.split(self._input_log_name())[1]
-- 247 return 'html%stitle%s/title\nbodyh1
align=center%s/h1\nh2 align=centera
href=%s%s/a/h2pre'%(REFRESH,T,T, inlog, inlog)
248
249 def _footer(self):

type 'exceptions.NameError': global name 'REFRESH' is not defined

}}}

I'm not sure what teh variable REFRESH is referring to, but removing
it takes care of the problem.

didier

--~--~-~--~~~---~--~~
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: Cloning error? 2.4.1.2

2007-04-12 Thread didier deshommes

Aparently this will be fixed in 2.4.1.3

On 4/12/07, Timothy Clemans [EMAIL PROTECTED] wrote:

 Is this a problem for just me? I saw this before but I thought I had
 done it, but I downloaded the latest release and complied and
 apparently I'm getting the same error.

 Now cloning the current SAGE library branch...
 hg clone  sage sage-webdsage
 abort: No such file or directory:
 sage-webdsage/.hg/store/data/sage/schemes/elliptic__curves/ell__rational__field.py.d
 Error cloning

 


--~--~-~--~~~---~--~~
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] integer-shiting + mpfr reals

2007-03-25 Thread didier deshommes

This is strange: SAGE crashes on input that mixes shifting and mpfr
reals
{{{
sage: # mpz, mpfr
sage: 13 +1.2
Segmentation fault
}}}

But note that this is fine:
{{{
# mpfr, mpz
sage: 2.0 + 13
 24.0
}}}

Anyone knows what's happening?


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: Inconsistency in root finding

2007-03-16 Thread didier deshommes

On Mar 16, 2:23 pm, Nick Alexander [EMAIL PROTECTED] wrote:
 Do you agree that the current behaviour is brain-dead?  'cuz I'll
 patch it!

Agreed! roots() should always return multiplicity when asked to.

didier

 Nick


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: SageX and C++ and pass-by-reference

2007-03-15 Thread didier deshommes

On Mar 15, 11:33 am, Michael Abshoff
[EMAIL PROTECTED] wrote:
 Martin Albrecht wrote:

  Hi,

  I have appended my original source of information, maybe you find this
  helpful.

 Thanks for the info. Should this be added to general SAGE documentation? I
 am sure once I am though/working on the code I will have additional
 suggestions.

+1
I have suggested that this be added to SAGE's Pyrex guide:
http://sage.math.washington.edu:9002/sage_trac/ticket/88

didier


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: Inconsistency in root finding

2007-03-15 Thread didier deshommes

On Mar 16, 2:23 am, Nick Alexander [EMAIL PROTECTED] wrote:
 Is this because of precision issues?  In that case, I still think this
 should return [(1...., 1), (1., 1)] and be documented as
 such.

 sage: (CC(1)*(x-1)**2).roots()
  [1.00, 1.00]

 sage: ((x-1)**2).roots()
  [(1, 2)]

2 here refers to multiplicity. The result of roots() are fine, it's
the behavior accross fields that is inconsistent.

The docs for roots() over QQ say:
{{{
Return all roots of this polynomial.

INPUT:
multiplicities -- bool (default: True, except over RR
or CC)
  if True return list of pairs (r, n),
where r is
  the root and n is the multiplicity.
}}}

HTH,
didier


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: Inconsistency in root finding

2007-03-15 Thread didier deshommes



On Mar 16, 2:37 am, didier  deshommes [EMAIL PROTECTED] wrote:
 On Mar 16, 2:23 am, Nick Alexander [EMAIL PROTECTED] wrote:

  Is this because of precision issues?  In that case, I still think this
  should return [(1...., 1), (1., 1)] and be documented as
  such.

  sage: (CC(1)*(x-1)**2).roots()
   [1.00, 1.00]

  sage: ((x-1)**2).roots()
   [(1, 2)]

 2 here refers to multiplicity. The result of roots() are fine, it's
 the behavior accross fields that is inconsistent.

In other words, I am agreeing with you :)

didier


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: quad double timings and accuracy

2007-03-01 Thread didier deshommes

On 2/27/07, didier deshommes [EMAIL PROTECTED] wrote:
 I must have somehow miscompiled the library (again). I will look at it
 more closely later.

There was a subtle bug in the quad double constructor that caused some
loss of precision.

This is better:
{{{
cos
mpfr vs qd 9.9466072136833891880E-64
mpfr vs rd 2.28816965375e-13

sin
mpfr vs qd 1.0255213165420582647E-63
mpfr vs rd 4.47974990436e-13

tan
mpfr vs qd 9.4955677457597987475E-63
mpfr vs rd 7.72715225139e-13

acos
mpfr vs qd 9.5145588812513183450E-63
mpfr vs rd 1.59383617415e-12

asin
mpfr vs qd 9.5667845038529972381E-63
mpfr vs rd 1.59361412955e-12

atan
mpfr vs qd 1.0961446016511467679E-63
mpfr vs rd 4.22106793962e-13

cosh
mpfr vs qd 1.2002397630640385617E-62
mpfr vs rd 2.975397706e-13

sinh
mpfr vs qd 1.2287264663013179579E-62
mpfr vs rd 5.15643083787e-13

tanh
mpfr vs qd 6.2338402250913078777E-63
mpfr vs rd 4.19553281006e-13

cosh
mpfr vs qd 1.7554018010883820896E-316
mpfr vs rd nan

sinh
mpfr vs qd 4.3584655953037476251E-63
mpfr vs rd 4.50750547998e-13

tanh
mpfr vs qd 3.2474841690498511716E-63
mpfr vs rd 1.08952846745e-11
}}}

Quad double seems to be faster on all operations now (including all
special functions and +,-,*,/).  Here is an hg bundle that fixes that
and a few other bugs:
http://sage.math.washington.edu/home/dfdeshom/custom/patches/qd-20070301.hg

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: random number generation

2007-03-01 Thread didier deshommes

On 2/25/07, Craig Citro [EMAIL PROTECTED] wrote:
 Hey all,

 So I tried to generate a random polynomial today, and ran into some trouble.
 Here's what I did:

 sage: R.x = ZZ['x']
 sage: R.random_element(3)
 sage crashes

That is a nice edge case. I would say that or you just return 0
everytime. Other rings seem to do that:
{{{
sage: RR.random_element(0)
 0.000
sage: QQ.random_element(0)
 0
sage: RDF.random_element(0)
 0.143951483848
}}}

didier


 I traced back the problem, and it's not clear what the right fix is. So
 R.random_element makes a list of the appropriate length and calls
 ZZ.random_element(0) to fill it up. In the comments, it clearly explains why
 0: it assumes that this is the default argument to pass to get a choice that
 is as spread across the ring as possible. Now, the problem is that
 ZZ.random_element(0) calls GMP's mpz_urandomm() function, which throws a
 division by zero exception when you call it with 0; it only knows how to
 generate a random element between two bounds (at least, according to the
 comments in the source). So I'm not sure which of the following things is
 the right fix for this:

 1) Fix ZZ.random_element so that it calls off to mpz_urandomm with a large
 bound; if so, I'm not sure what bound to use.

 2) Change R.random_element so that it doesn't try to pass off a 0 to
 ZZ.random_element , which seems like the wrong solution -- this code is in
 PolynomialRing.random_element, which really shouldn't know in general how to
 ask for a random element in its base_ring. However, this means that we
 should document somewhere that in any ring, random_element(0) is the request
 for as general a random element as possible.

 3) Decide to think about it later, and throw an exception. This was
 apparently GMP's solution. ;)

 I think (1) is the right solution, but I'm not sure what bound to use. But
 maybe one of the other choices is better? What does everyone else think?

 -cc

  


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: quad double timings and accuracy

2007-02-27 Thread didier deshommes

On 2/26/07, Robert Bradshaw [EMAIL PROTECTED] wrote:

 Shouldn't the error on a quad double be way smaller than this? I'm
 not sure what specific numbers you're operating on, but if your
 answers are on the order of 10^0, then shouldn't you have around 63
 decimal digits of accuracy, rather than just 4 more orders of
 magnitude? Wouldn't an error of 1e-17 be like using mpfr with ~60+ bits?

I must have somehow miscompiled the library (again). I will look at it
more closely later.

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] quad double timings and accuracy

2007-02-26 Thread didier deshommes

Here are some timings of quaddouble vs mpfr. All test were ran on
sage.math. In short: quaddouble is faster than M=mpfr at 212 bits of
precision on all functions special, except  on atanh() and asinh().

The format is as follows:
{{{
function:
quaddouble time
mprf time
}}}
Here are the timings:
cos:
0.0015869140625
0.00158500671387
sin:
0.00154900550842
0.00201201438904
tan:
0.00160002708435
0.00221610069275
acos
0.0053539276123
0.00785398483276
asin
0.00526189804077
0.00740694999695
atan
0.00495600700378
0.00740694999695
cosh
0.00159883499146
0.00189304351807
sinh
0.00158905982971
0.00194907188416
tanh
0.00168299674988
0.00202894210815
acosh
0.000118970870972
0.00012993812561
asinh
0.00462889671326
0.00277781486511
atanh
0.0044469833374
0.00309801101685
#

How accurate are these results? The error is quite small and more
accurate than computing with ieee doubles (most of the time, about 4
orders of magnitude). Here:
-- mpfr vs qd  is the absolute error between a quad double and mpfr
real, and
-- mpfr vs rd  is the absolute error in between a real double and
mpfr real:

cos:
mpfr vs qd: 5.4180459105735642433E-17
mpfr vs rd: 3.57935903139e-13

sin:
mpfr vs qd : 4.9262450620608075647E-17
mpfr vs rd :4.22384349719e-13

tan:
mpfr vs qd : 1.0996009735470526760E-16
mpfr vs rd : 1.37401201528e-12

acos:
mpfr vs qd : 1.0587913940429450042E-16
mpfr vs rd : 1.95518601309e-12

asin:
mpfr vs qd : 8.8793698896573320837E-17
mpfr vs rd : 1.95532479097e-12

atan:
mpfr vs qd : 4.2348407244178416828E-17
mpfr vs rd : 4.09228206877e-13

cosh:
mpfr vs qd : 1.1001972366209892607E-16
mpfr vs rd : 4.91606755304e-13

sinh:
mpfr vs qd : 7.7307263905133232438E-17
mpfr vs rd : 6.54809539924e-13

tanh:
mpfr vs qd : 5.0901691104837936913E-17
mpfr vs rd : 4.08617584213e-13

cosh:
mpfr vs qd NAN
mpfr vs rd nan

sinh:
mpfr vs qd : 5.0731042379144584142E-17
mpfr vs rd : 4.23105994685e-13

tanh:
mpfr vs qd : 1.9007614867237325552E-16
mpfr vs rd : 8.84181616811e-12
##

In conclusion:
In most cases it is faster to compute with quad double reals instead
of using mpfr reals at 212 bits. In all cases quad doubles are more
accurate than simple ieee doubles.

didier


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: SageX Tutorial

2007-02-21 Thread didier deshommes

On 2/20/07, Robert Bradshaw [EMAIL PROTECTED] wrote:
 Although C implicitly
 coerces ints to floats in general, no (non-functional) arithmetic
 operations in C return a different data type then their arguments.

 I am leaning towards disabling the functionality altogether. If the
 user wants to do it one way or the other, it will be pretty easy to
 make it explicit. Some of the operations (e.g. bit operations) are

+1 for this. Issuing a message like explicit cas to int required for
pow() would also help.

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] nth_root() for mpfr reals

2007-02-21 Thread didier deshommes

Allo,
Here is a patch that returns the nth root of a mpfr real number:
http://sage.math.washington.edu/home/dfdeshom/custom/patches/mpfr-nthroot.txt

didier


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: SageX Tutorial

2007-02-20 Thread didier deshommes

On 2/20/07, Robert Bradshaw [EMAIL PROTECTED] wrote:

 Last night we discovered a really bad bug in SageX when doing a**b
 (with a, b cdef'ed).

Robert,
I've forwarded this to the pyrex mailing list

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: SageX Tutorial

2007-02-20 Thread didier deshommes

-- Forwarded message --
From: Greg Ewing [EMAIL PROTECTED]
Date: Feb 20, 2007 7:10 PM
Subject: Re: [Pyrex] Integer exponentiation returns a double
To: didier deshommes [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]


didier deshommes wrote:
 Robert
 Bradshaw found that when a and b are cdef'ed as integers, the result
 of a**b is a double.

Pyrex's philosophy is that when operating on two things
both defined as C data types, the operation that should
be done is the one that makes the most sense from a
C point of view. In the case of **, this means translating
it into a call to the C pow() function.

Since C doesn't provide any integer-only power operation,
the only alternative would be to convert them to Python
ints and return a Python int or long. Since that's an
expensive thing to do, I think it's better if the programmer
needs to be explicit about it.

To avoid misleading people into creating bugs, it might
be better to disallow ** on C ints altogether, although
that would be surprising in another way, since C ints are
normally promoted to floats automatically wherever
appropriate.

--
Greg



On Feb 20, 4:48 pm, didier deshommes [EMAIL PROTECTED] wrote:
 On 2/20/07, Robert Bradshaw [EMAIL PROTECTED] wrote:



  Last night we discovered a really bad bug in SageX when doing a**b
  (with a, b cdef'ed).

 Robert,
 I've forwarded this to the pyrex mailing list

 didier


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: need some beta-testers for a sage gmp patch

2007-02-19 Thread didier deshommes

On 2/19/07, Jason Martin [EMAIL PROTECTED] wrote:

 Hi All,

 I've been tweaking the gmp used in sage.  Right now this will only
 benefit Linux users who have a core2 processor.  However, I'd like to
 make sure that my changes don't break the sage build on other
 platforms.  So, I'd appreciate any and all feedback!  Instructions and
 the beta gmp spkg are at

 http://www.math.jmu.edu/~martin/sage-beta-gmp

 let me know what breaks.

Hi Jason,
I built it on my laptop (centrino) and on sage.math without any
problems. sage -testall did not fail on any doctests using integers or
rationals either.

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] log_html() crashes

2007-02-19 Thread didier deshommes

Allo,
{{{log_html}}} crashes because of undefined variable:

{{{
sage: log_html ()
[..]
245 T = self._title()
246 inlog = os.path.split(self._input_log_name())[1]
-- 247 return 'html%stitle%s/title\nbodyh1
align=center%s/h1\nh2 align=centera
href=%s%s/a/h2pre'%(REFRESH,T,T, inlog, inlog)
248
249 def _footer(self):

type 'exceptions.NameError': global name 'REFRESH' is not defined

}}}

I'm not sure what teh variable REFRESH is referring to, but removing
it takes care of the problem.

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: ianal but...

2007-02-18 Thread didier deshommes

On 2/18/07, William Stein [EMAIL PROTECTED] wrote:
 Hello,

 Certain kind researchers at Microsoft Rsearch have code they would like to
 contribute to SAGE.  They are only allowed release it under the Microsoft
 Permissive License, which is described here (and linked to):


 http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx

 (1) Is this license GPL compatible?  It seems like it might be.  It is very
 free (much more so than the GPL).  What do you think?  I couldn't find
 anything definitive online...  One thing -- this license is very clear about
 patent issues, which is comforting.


Simplest solution: MS employees should ask lawyers at their company
whether MS-PL is GPL2-compatible or not.

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: quad-double doctests

2007-02-15 Thread didier deshommes

On 2/16/07, William Stein [EMAIL PROTECTED] wrote:
 Actually, after applying your patch when I try to build I get:

 rank4:~/grants/2007-packard was$ sage -br

 --
 sage: Building and installing modified SAGE library files.

 sage/rings/real_qdrf.pyx -- 
 /Users/was/s/local//lib/python/site-packages//sage/rings/real_qdrf.pyx
 pyrexc --embed-positions -I/Users/was/s/devel/sage-main 
 sage/rings/real_qdrf.pyx
 running install
 running build
 running build_py
 running build_ext
 building 'sage.rings.real_qdrf' extension
 gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd 
 -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/Users/was/s/local//include 
 -I/Users/was/s/local//include/python -I/Users/was/s/devel//sage/sage/ext 
 -I/Users/was/s/local/include/python2.5 -c sage/rings/real_qdrf.cpp -o 
 build/temp.macosx-10.3-i386-2.5/sage/rings/real_qdrf.o -w
 cc1plus: warning: command line option -Wstrict-prototypes is valid for 
 C/ObjC but not for C++
 sage/rings/real_qdrf.cpp:1198: error: integer constant is too large for 
 'long' type
 error: command 'gcc' failed with exit status 1
 sage: There was an error installing modified sage library code.

 where 1198 has the big constant below...

/* /Users/was/s/devel/sage-main/sage/rings/real_qdrf.pyx:122
   *
   * def __hash__(self):
   * return -8953654399753187499 #==hash(self.name()) # 
 
   *
   * def pi(self):
   */

This is weird, but not too bad. You could just uncomment line  what's
after 122 so that it looks like this
{{{
def __hash__(self):
return hash(self.name())
}}}

didier

--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



  1   2   >