Re: [sage-devel] Re: libpari segfault related to 64bit?

2010-10-18 Thread Jan Groenewald
Hi

On Sun, Oct 17, 2010 at 09:37:55AM +0200, Jan Groenewald wrote:
> Looking for libpari-gmp.so, I found these:
> r...@capepoint:/usr/local/src/sage-4.5.3/local/lib#ls -l libpari*
> -rwxr-xr-x 1 root root 3160120 Oct 11 17:06 libpari-gmp.so.2
> -rwxr-xr-x 1 root root 3160120 Oct 11 17:06 libpari-gmp.so.2.3.5
> -rw-r--r-- 1 root root 5011724 Oct 11 17:06 libpari.a
> -rwxr-xr-x 1 root root 3160120 Oct 11 17:06 libpari.so
> r...@capepoint:/usr/local/src/sage-4.5.3/local/lib#
> 
> How come they are not symlinks to one? Why three copies
> of the same thing?
> 

Also, why does this depend on the system libgmp and not the sage libgmp?

r...@capepoint:/usr/local/src/sage-4.5.3/local/lib#ldd libpari-gmp.so.2
linux-vdso.so.1 =>  (0x7fff3a5ff000)
libc.so.6 => /lib/libc.so.6 (0x7f1ecb41b000)
libdl.so.2 => /lib/libdl.so.2 (0x7f1ecb217000)
libm.so.6 => /lib/libm.so.6 (0x7f1ecaf93000)
libgmp.so.3 => /usr/lib/libgmp.so.3 (0x7f1ecad33000)  #<-- over here
/lib64/ld-linux-x86-64.so.2 (0x7f1ecbcca000)
r...@capepoint:/usr/local/src/sage-4.5.3/local/lib#ls -l libgmp.so.3
lrwxrwxrwx 1 root root 15 Sep 13 08:19 libgmp.so.3 -> libgmp.so.3.4.6
r...@capepoint:/usr/local/src/sage-4.5.3/local/lib#

regards,
Jan
-- 
   .~. 
   /V\ Jan Groenewald
  /( )\www.aims.ac.za
  ^^-^^ 

-- 
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] Re: libpari segfault related to 64bit?

2010-10-18 Thread Jeroen Demeyer
On 2010-10-18 13:43, Jan Groenewald wrote:
> Also, why does this depend on the system libgmp and not the sage libgmp?

This depends on the setting of LD_LIBRARY_FLAG.  If you do the same
within "sage -sh" you should get the correct library.

-- 
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] Re: libpari segfault related to 64bit?

2010-10-18 Thread François Bissey
> Hi
> 
> On Sun, Oct 17, 2010 at 09:37:55AM +0200, Jan Groenewald wrote:
> > Looking for libpari-gmp.so, I found these:
> > r...@capepoint:/usr/local/src/sage-4.5.3/local/lib#ls -l libpari*
> > -rwxr-xr-x 1 root root 3160120 Oct 11 17:06 libpari-gmp.so.2
> > -rwxr-xr-x 1 root root 3160120 Oct 11 17:06 libpari-gmp.so.2.3.5
> > -rw-r--r-- 1 root root 5011724 Oct 11 17:06 libpari.a
> > -rwxr-xr-x 1 root root 3160120 Oct 11 17:06 libpari.so
> > r...@capepoint:/usr/local/src/sage-4.5.3/local/lib#
> > 
> > How come they are not symlinks to one? Why three copies
> > of the same thing?
> 
> Also, why does this depend on the system libgmp and not the sage libgmp?
> 
> r...@capepoint:/usr/local/src/sage-4.5.3/local/lib#ldd libpari-gmp.so.2
> linux-vdso.so.1 =>  (0x7fff3a5ff000)
>   libc.so.6 => /lib/libc.so.6 (0x7f1ecb41b000)
>   libdl.so.2 => /lib/libdl.so.2 (0x7f1ecb217000)
>   libm.so.6 => /lib/libm.so.6 (0x7f1ecaf93000)
>   libgmp.so.3 => /usr/lib/libgmp.so.3 (0x7f1ecad33000)  #<-- over here
>   /lib64/ld-linux-x86-64.so.2 (0x7f1ecbcca000)
> r...@capepoint:/usr/local/src/sage-4.5.3/local/lib#ls -l libgmp.so.3
> lrwxrwxrwx 1 root root 15 Sep 13 08:19 libgmp.so.3 -> libgmp.so.3.4.6
> r...@capepoint:/usr/local/src/sage-4.5.3/local/lib#
> 
Did you do a "source local/bin/sage-env" before running ldd?

Francois

-- 
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] Re: libpari segfault related to 64bit?

2010-10-18 Thread Jan Groenewald
Hi

On Mon, Oct 18, 2010 at 01:46:48PM +0200, Jeroen Demeyer wrote:
> On 2010-10-18 13:43, Jan Groenewald wrote:
> > Also, why does this depend on the system libgmp and not the sage libgmp?
> 
> This depends on the setting of LD_LIBRARY_FLAG.  If you do the same
> within "sage -sh" you should get the correct library.

OK, right

SAGE_ROOT=/usr/local/src/sage-4.5.3
(sage subshell) capepoint:lib root$ ldd libpari-gmp.so.2
linux-vdso.so.1 =>  (0x7fff9dd55000)
libc.so.6 => /lib/libc.so.6 (0x7f2efbfb6000)
libdl.so.2 => /lib/libdl.so.2 (0x7f2efbdb2000)
libm.so.6 => /lib/libm.so.6 (0x7f2efbb2e000)
libgmp.so.3 => /usr/local/src/sage-4.5.3/local/lib/libgmp.so.3 
(0x7f2efb8bc000)
/lib64/ld-linux-x86-64.so.2 (0x7f2efc85e000)
SAGE_ROOT=/usr/local/src/sage-4.5.3
(sage subshell) capepoint:lib root$ 

Thanks
Jan

-- 
   .~. 
   /V\ Jan Groenewald
  /( )\www.aims.ac.za
  ^^-^^ 

-- 
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] Make Parma Polyhedra Library a standard spkg

2010-10-18 Thread Volker Braun
=== Introduction ===

I would like to have the Parma Polyhedra Library (PPL) included
as a standard spkg. My goal is to rewrite as much of the
sage.geometry.* modules on top of a Cython PPL wrapper as opposed
to piping ASCII to/from cddlib. Some of the reasons are:

* PPL is already faster by itself, and having a Cython wrapper reduces
  overhead. I'm seeing about 20x speedup on medium-sized problems.

* PPL is the only polyhedral computation toolkit that is from the
  ground up designed to be used as a shared library.(1)

* PPL is mature, well tested, has an active development including bug
  tracker and mailing list. It is used in a variety of other projects,
  including gcc's Graphite loop optimizer. It has been tested on
  Linux, FreeBSD, OpenBSD, Solaris, IRIX64, Mac OS X, Cygwin, DEC
  OSF/1.

cddlib was the first really useful software package back in the day
and it was hugely influential for many subsequent codes. But nowadays
there are alternatives that combine the same algorithms with better
implementations and software development practices.(2)

Note that I'm not proposing to remove cddlib entirely. It is still a
requirement for gfan and the only program to do polyhedral
computations over floating point numbers.(3)


=== Work Plan ===

I have written a PPL spkg and a Cython (C++) wrapper that should cover
all functions necessary for dealing with polyhedra in Sage. You can
find it here:

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

Using this wrapper, I patched sage.geometry.cone:

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

I think that the PPL spkg and the Cython wrapper is ready for
inclusion in the next Sage release (4.6.1?). In the subsequent release
we can then rebase sage.geometry modules on top of the wrapper.

Right now I would like to invite any comments on this plan!


=== Notes ===

(1) cddlib also comes with a shared library. But its poorly documented
and, according to valgrind, leaks memory. Other toolkits like lrs and
qhull don't build shared libraries but have minimal instructions for
statically linking with parts of their code.

(2) In particular, cddlib has no bug tracker, no new release in the
last 5 years, and segfaults on some of its own testsuite.

(3) Though in a numerically unstable way, see Trac #10046, #10037.

-- 
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: libpari segfault related to 64bit?

2010-10-18 Thread Jason Grout

On 10/18/10 6:43 AM, Jan Groenewald wrote:

Hi

On Sun, Oct 17, 2010 at 09:37:55AM +0200, Jan Groenewald wrote:

Looking for libpari-gmp.so, I found these:
r...@capepoint:/usr/local/src/sage-4.5.3/local/lib#ls -l libpari*
-rwxr-xr-x 1 root root 3160120 Oct 11 17:06 libpari-gmp.so.2
-rwxr-xr-x 1 root root 3160120 Oct 11 17:06 libpari-gmp.so.2.3.5
-rw-r--r-- 1 root root 5011724 Oct 11 17:06 libpari.a
-rwxr-xr-x 1 root root 3160120 Oct 11 17:06 libpari.so
r...@capepoint:/usr/local/src/sage-4.5.3/local/lib#

How come they are not symlinks to one? Why three copies
of the same thing?



Also, why does this depend on the system libgmp and not the sage libgmp?

r...@capepoint:/usr/local/src/sage-4.5.3/local/lib#ldd libpari-gmp.so.2
 linux-vdso.so.1 =>   (0x7fff3a5ff000)
libc.so.6 =>  /lib/libc.so.6 (0x7f1ecb41b000)
libdl.so.2 =>  /lib/libdl.so.2 (0x7f1ecb217000)
libm.so.6 =>  /lib/libm.so.6 (0x7f1ecaf93000)
libgmp.so.3 =>  /usr/lib/libgmp.so.3 (0x7f1ecad33000)  #<-- over 
here
/lib64/ld-linux-x86-64.so.2 (0x7f1ecbcca000)
r...@capepoint:/usr/local/src/sage-4.5.3/local/lib#ls -l libgmp.so.3
lrwxrwxrwx 1 root root 15 Sep 13 08:19 libgmp.so.3 ->  libgmp.so.3.4.6
r...@capepoint:/usr/local/src/sage-4.5.3/local/lib#

regards,
Jan



As an offhand idea, with the disclaimer that I haven't read this entire 
thread, but an idea that has caused such problems before.  Did you move 
the Sage directory?  There are still lots of loose ends that are left 
dangling when the build directory is used (or a binary distribution is 
used) (e.g., the pkgconfig files that #9210 takes care of).


Sorry if this is noise.  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


[sage-devel] Re: bug wranglers

2010-10-18 Thread Jason Grout

On 10/17/10 9:39 AM, Dr. David Kirkby wrote:

On 10/17/10 03:16 PM, Jan Groenewald wrote:

Hi


I believe any belief that having "bug hunt weeks" is a long term
solution is rather flawed. The issues should be tackled at an
earlier stage.


Despite not being a sufficient solution, are they not nonetheless
necessary? Or at least helpful?

regards,
Jan


Yes, I think they would be useful. Periods of concentrated effort at
fixing bugs is a standard practice in professional software engineering.

In a similar way I feel "bug fix only releases" would be useful, where
one concentrates on removing bugs, and not adding features. That idea
has however been very much disliked by many people.

Given the lack of enthusiasm by many (including William) for my
suggestions of "bug-fix-only" releases, it will be interesting to see
how many take William up on attending the "Bug Days".



(just answering the question about bug days, but I don't have time right 
now to comment on the other points) We have already had several bug days 
(week-long get-togethers; at least two that I've attended), plus 
numerous 1-day meet-on-IRC bug days, and they have been very successful.


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


Re: [sage-devel] Re: libpari segfault related to 64bit?

2010-10-18 Thread Jan Groenewald
Hi

On Mon, Oct 18, 2010 at 07:28:23AM -0500, Jason Grout wrote:
> As an offhand idea, with the disclaimer that I haven't read this
> entire thread, but an idea that has caused such problems before.
> Did you move the Sage directory?  There are still lots of loose ends
> that are left dangling when the build directory is used (or a binary
> distribution is used) (e.g., the pkgconfig files that #9210 takes
> care of).

Nope, sorry.

regards,
Jan

-- 
   .~. 
   /V\ Jan Groenewald
  /( )\www.aims.ac.za
  ^^-^^ 

-- 
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] text/xml version of Sage worksheets as workaround for bug during saving

2010-10-18 Thread Chris Seberino
There seems to be a long running bug in the saving of Sage worksheets
that chops off the ends and other parts.

Sage worksheets are saved in binary.  If they could be saved in some
text version like XML, wouldn't that allow people to hand hack the
text file when the saving step of notebooks chops off content?  That
would be an adequate temporary workaround I would think.

Can Sage worksheets be saved or converted to/from text and binary?

cs

-- 
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] Wolfram Alpha low bandwidth portal into Sage to attract new users?

2010-10-18 Thread Chris Seberino
Wolfram Alpha is a low bandwidth portal into Mathematica that doesn't
provide the full notebook interface.

Does something like this exist for Sage?  It seems it would be
valuable marketing wise because it is even easier to try that than the
freely available notebook interfaces.The free public notebook
servers are often bogged down with lots of users.

I'm guessing Wolfram Alpha interface would be able to support more
users?

cs

-- 
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] bug in show/latex?

2010-10-18 Thread Johannes
hi list
I have this simple code:

latex(matrix([[-(a + 1)/b]]))

and i get:

\left(\begin{array}{r}
\frac{-a + 1}{b}
\end{array}\right)

but it should be

\left(\begin{array}{r}
\frac{-a - 1}{b}
\end{array}\right)

or

\left(\begin{array}{r}
\frac{-(a + 1)}{b}
\end{array}\right)


greatz Johannes

-- 
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] How are free algebra quotients compared??

2010-10-18 Thread Simon King
Hi!

I almost finished to re-implement free algebras based on Gap, which
should provide much faster arithmetic and allows to study non-
associative and non-unital algebras.

It seems that FreeAlgebraQuotients require the associative case,
doesn't it?

Now I wonder how free algebra quotients are compared. First of all,
they are not unique parent structures (I guess that ought to change).
But surprisingly, although they do *not* have a __cmp__ method, non-
identical free algebra quotients can still be compared:

sage: n = 2
sage: A = FreeAlgebra(QQ,n,'x')
sage: F = A.monoid()
sage: i, j = F.gens()
sage: mons = [ F(1), i, j, i*j ]
sage: r = len(mons)
sage: M = MatrixSpace(QQ,r)
sage: mats = [M([0,1,0,0, -1,0,0,0, 0,0,0,-1, 0,0,1,0]), M([0,0,1,0,
0,0,0,1, -1,0,0,0, 0,-1,0,0]) ]
sage: sage: H2. = A.quotient(mons,mats)
sage: H2 is loads(dumps(H2))
False
sage: H2 == loads(dumps(H2))
True
sage: hasattr(H2,'__cmp__')
False
sage: hasattr(H2,'__richcmp__')
False

How can this be explained? How is comparison of H2 and
loads(dumps(H2)) achieved?

Cheers,
Simon

-- 
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: How are free algebra quotients compared??

2010-10-18 Thread Simon King
Sorry, forget my question: I just found that they have a __eq__
method.

But still, I think they should be unique parent structures.

Cheers,
Simon

-- 
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: text/xml version of Sage worksheets as workaround for bug during saving

2010-10-18 Thread Jason Grout

On 10/18/10 9:29 AM, Chris Seberino wrote:

There seems to be a long running bug in the saving of Sage worksheets
that chops off the ends and other parts.

Sage worksheets are saved in binary.  If they could be saved in some
text version like XML, wouldn't that allow people to hand hack the
text file when the saving step of notebooks chops off content?  That
would be an adequate temporary workaround I would think.

Can Sage worksheets be saved or converted to/from text and binary?



Like OpenOffice, Sage worksheets are saved in plain text, and then the 
worksheet and related files are all compressed using tar cjf (i.e., it's 
a tar bzip file) to form the .sws file.  Just untar the .sws file and 
you can edit it.


Alternatively, if you click the "Edit" tab in the worksheet, that is the 
text that is saved.  You can edit the plain text and save the worksheet 
to effect changes.


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


[sage-devel] Re: bug in show/latex?

2010-10-18 Thread John H Palmieri
On Oct 18, 8:06 am, Johannes  wrote:
> hi list
> I have this simple code:
>
> latex(matrix([[-(a + 1)/b]]))
>
> and i get:
>
> \left(\begin{array}{r}
> \frac{-a + 1}{b}
> \end{array}\right)
>
> but it should be
>
> \left(\begin{array}{r}
> \frac{-a - 1}{b}
> \end{array}\right)
>
> or
>
> \left(\begin{array}{r}
> \frac{-(a + 1)}{b}
> \end{array}\right)
>
> greatz Johannes

This seems to be broken in Sage 4.5.3, but it works in Sage
4.6.alpha3:

sage: latex(matrix([[-(a + 1)/b]]))
\left(\begin{array}{r}
-\frac{a + 1}{b}
\end{array}\right)

--
John

-- 
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] bug wranglers

2010-10-18 Thread Robert Bradshaw
On Sun, Oct 17, 2010 at 6:39 AM, Dr. David Kirkby
 wrote:
> On 10/16/10 01:21 PM, Burcin Erocal wrote:
>>
>> Hi,
>>
>> Motivated by the call for the bug days, here is an idea to manage the
>> rapidly increasing number of "new" tickets on trac.
>
> It is well known in industry that the cost to fix bugs increases rapidly as
> they time to fix them is delayed. See for example
>
>
> http://on-agile.blogspot.com/2006/12/hidden-cost-of-delaying-bug-fixes.html
>
> It depends very much on the industry, but set of quoted values are:
>
>
> $10 in Design phase
> $100 in working code
> $1,000 in released software
>
> Of course, in open-source software cost can not be considered too much in
> monetary terms (though clearly in this case a company are willing to pay to
> have bugs fixed).
>
> But if someone writes code with a bug, a second peson builds upon that buggy
> code with their own code, it should be obvious that there is a lot to be
> gained by fixing the bugs as soon as possible. But should not be allowed to
> linger on for a long time.
>
> I feel we should be putting higher priority on fixing the bugs sooner, and
> not adding more features.
>
> I recently wrote a very small shell script to automatically find bugs in
> Sage. It was slow, as each test invoked Sage once. I should be able to speed
> that up by a couple of orders of magnitude, by not starting a new instance
> of Sage before each test. (I'm in the process of re-writing it in C).
>
> I can't help but feel that some of these could be caught much earlier, with
> a bit more consideration given to testing. Simply by trying your code with
> invalid input will often show bugs.
>
> sage: seed(1,2)
> sage: seed(100,34)
> sage: seed(1,2,3,4,5,6,7)
>
> will all crash Sage with an "Unhandled SIGSEGV". Plenty more sets of invalid
> input to other commands will hang Sage, so the only answer is to kill the
> process.

Though in an ideal world, this kind of thing wouldn't crash Sage, I'm
more worried about the kinds of bugs where valid input causes a
segfault, or, much worse, an incorrect answer.

> I think the main problem is ignorance. Good software engineering techniques
> do not form part of mathematics degrees, so most Sage developers are totally
> ignorant of the issues. Then those motivated to find more information soon
> hit the fact that books on this topic are not cheap. I have an 18-year old
> copy of this book, which despite the complaints the 7th edition is out of
> date, I think much of the material would be useful to Sage developers.
>
> http://www.amazon.com/Software-Engineering-Practitioners-Approach-International/dp/0071267824/ref=sr_1_1?ie=UTF8&s=books&qid=1287322048&sr=1-1
>
> There's also plenty of books on software testing.
>
> http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Dstripbooks&field-keywords=software+testing&x=0&y=0
>
>
> Perhaps when William assembles the team in Seattle, he could find the money
> to buy each person a book on software testing. Buy each person a different
> book, then hopefully Sage developers will able to independently review the
> material. Perhaps they each write a Wiki page on what they though was the
> most important things they learned from the book.

I would submit that practicing good software engineering techniques is
more than a matter of finding the money (and especially time) to read
a good book on it--we all have different priorities on what we can
afford to spend "10,000 hours" on. (Note, I'm not saying it wouldn't
be useful for all of us to learn these things, just that I don't
expect working mathematicians to all find enough time on the side to
become expert software developers as well).

On a more practical note, I think it may help things if we actually
used the priority field. Certainly

Blocker: 14
Critical: 68
Major: 1609
Minor: 516
Trivial: 26

Is not the correct distribution. We have an extremely large number of
components of varying scope as well, this could probably use some
unification and cleanup as well.

In terms of bug-fix-only releases, I don't think anyone would object
to someone volunteering to do one (as long as the process didn't drag
out longer than a normal release).

- Robert

-- 
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] Python name mangling and Python classes inheriting from Cython classes

2010-10-18 Thread Simon King
Hi!

I have a Python class which inherits from ParentWithGens, and I want
to overload the method __temporarily_change_names that is inherited
from CategoryObject. But how can this be done?

First I tried the "obvious" way, along these lines:

sage: from sage.structure.parent_gens import ParentWithGens
sage: class C (ParentWithGens):
: def __temporarily_change_names(self,names,latexnames):
: print 'boo'
:
sage: P = C('a')
sage: P.__temporarily_change_names(1,1)
(None, None)

So, apparently the method inherited from CategoryObject is still in
use, the direct attempt to overload did fail.

Then, I remembered Python's name mangling and tried to rename the
method into _CategoryObject__temporarily_change_names, but it did not
work either.

Is there some way to get this thing overloaded?

Cheers,
Simon

-- 
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] radical ideal computation in Sage

2010-10-18 Thread deryk lv
Hi,everyone,
I am just wondering whether radical ideal computation in Sage is making use
of Singular on backend.

Thanks a lot.
Gepo

-- 
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] radical ideal computation in Sage

2010-10-18 Thread Martin Albrecht
On Tuesday 19 October 2010, deryk lv wrote:
> Hi,everyone,
> I am just wondering whether radical ideal computation in Sage is making use
> of Singular on backend.

Yes.

The note in the docstring might be a bit cryptic but it is there (type 
"I.radical?")

"""
Note: From the Singular manual: A combination of the algorithms of
 Krick/Logar and Kemper is used. Works also in positive
 characteristic (Kempers algorithm).
"""

Also see the source code (type "I.radical??")

import sage.libs.singular
radical = sage.libs.singular.ff.primdec__lib.radical
r = radical(self)


Martin

-- 
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
_otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF
_www: http://martinralbrecht.wordpress.com/
_jab: martinralbre...@jabber.ccc.de

-- 
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] Python name mangling and Python classes inheriting from Cython classes

2010-10-18 Thread David Roe
I don't know how to do it technically, but one way to do it is to submit a
patch changing the double underscore in
CategoryObject.__temporarily_change_names into a single underscore.  Name
mangling is annoying, and I would personally love it if every double
underscore became a single one.
David

On Mon, Oct 18, 2010 at 19:23, Simon King  wrote:

> Hi!
>
> I have a Python class which inherits from ParentWithGens, and I want
> to overload the method __temporarily_change_names that is inherited
> from CategoryObject. But how can this be done?
>
> First I tried the "obvious" way, along these lines:
>
> sage: from sage.structure.parent_gens import ParentWithGens
> sage: class C (ParentWithGens):
> : def __temporarily_change_names(self,names,latexnames):
> : print 'boo'
> :
> sage: P = C('a')
> sage: P.__temporarily_change_names(1,1)
> (None, None)
>
> So, apparently the method inherited from CategoryObject is still in
> use, the direct attempt to overload did fail.
>
> Then, I remembered Python's name mangling and tried to rename the
> method into _CategoryObject__temporarily_change_names, but it did not
> work either.
>
> Is there some way to get this thing overloaded?
>
> Cheers,
> Simon
>
> --
> 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: bug wranglers

2010-10-18 Thread kcrisman

> I would submit that practicing good software engineering techniques is
> more than a matter of finding the money (and especially time) to read
> a good book on it--we all have different priorities on what we can
> afford to spend "10,000 hours" on. (Note, I'm not saying it wouldn't
> be useful for all of us to learn these things, just that I don't
> expect working mathematicians to all find enough time on the side to
> become expert software developers as well).

+1

> On a more practical note, I think it may help things if we actually
> used the priority field. Certainly
>
> Blocker: 14
> Critical: 68
> Major: 1609
> Minor: 516
> Trivial: 26
>
> Is not the correct distribution. We have an extremely large number of
> components of varying scope as well, this could probably use some
> unification and cleanup as well.

I think I must be one of the only people to use the 'minor' field on a
regular basis.  And most of the 'critical' ones are not critical in
that sense.  But there hasn't been much discussion at all of what
counts as a critical or major thing - it's  mostly in the eye of the
beholder.

- kcrisman

-- 
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: radical ideal computation in Sage

2010-10-18 Thread kcrisman
Here's another way to see this:

sage: P. = QQ[]
sage: I = Ideal(x+y+z-3,x^2+y^2+z^2-5,x^3+y^3+z^3-7)
sage: from sage.misc.citation import get_systems
sage: get_systems("I.radical()")
['Singular']

- kcrisman
On Oct 18, 8:04 pm, Martin Albrecht 
wrote:
> On Tuesday 19 October 2010, deryk lv wrote:
>
> > Hi,everyone,
> > I am just wondering whether radical ideal computation in Sage is making use
> > of Singular on backend.
>
> Yes.
>
> The note in the docstring might be a bit cryptic but it is there (type
> "I.radical?")
>
> """
> Note: From the Singular manual: A combination of the algorithms of
>          Krick/Logar and Kemper is used. Works also in positive
>          characteristic (Kempers algorithm).
> """
>
> Also see the source code (type "I.radical??")
>
>     import sage.libs.singular
>     radical = sage.libs.singular.ff.primdec__lib.radical
>     r = radical(self)
>
> Martin
>
> --
> name: Martin Albrecht
> _pgp:http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
> _otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF
> _www:http://martinralbrecht.wordpress.com/
> _jab: martinralbre...@jabber.ccc.de

-- 
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: bug wranglers

2010-10-18 Thread Donald Alan Morrison


On Oct 16, 5:21 am, Burcin Erocal  wrote:
>[...]
> if they are filed in different components. The members of the
> bug-wrangler mailing list will be able to see the initial report for
> every ticket, so they might recall a similar problem reported a few
> days ago.
>
> Another advantage is that the members of this team don't need to be
> developers, or even know how to code. It is enough to be able to listen
> to user requests and use trac.
>
> This could also be a good starting point for people who want to get
> into Sage development, since it provides an opportunity to look through
> the library and become familiar with the internal structure of Sage.
>
> Comments?

What will be appropriate attire for Bug Days?  Will there be a wake
(and party) after the (bug) funeral?

-- 
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: Make Parma Polyhedra Library a standard spkg

2010-10-18 Thread Andrey Novoseltsev
I definitely vote YES.

I often have problems and have to create work-arounds due to Sage poor
performance on (a lot of) *very simple* polyhedra, since both current
options (cddlib and PALP) are used as standalone programs and
therefore add a system call overhead. I actually expect speed ups up
to 100x (and maybe even over!) in this case. Also, I have considered
switching to library calls for PALP, but its documentation is
insufficient and I was not able to dig trough the source code. Plus it
has hard-coded limitations on everything. As with cddlib, I want to
keep PALP in Sage for computing lattice points inside polytopes as
well as nef partitions, but using PPL as a library for computing
convex hulls and facets will make life much better.

Thank you,
Andrey

-- 
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: Make Parma Polyhedra Library a standard spkg

2010-10-18 Thread Dima Pasechnik
Yes, it's a good idea to have PPL.
You can start by making it an optional package.

Are you saying that PPL cannot work with floating point numbers?

Dima

On Oct 18, 8:13 pm, Volker Braun  wrote:
> === Introduction ===
>
> I would like to have the Parma Polyhedra Library (PPL) included
> as a standard spkg. My goal is to rewrite as much of the
> sage.geometry.* modules on top of a Cython PPL wrapper as opposed
> to piping ASCII to/from cddlib. Some of the reasons are:
>
> * PPL is already faster by itself, and having a Cython wrapper reduces
>   overhead. I'm seeing about 20x speedup on medium-sized problems.
>
> * PPL is the only polyhedral computation toolkit that is from the
>   ground up designed to be used as a shared library.(1)
>
> * PPL is mature, well tested, has an active development including bug
>   tracker and mailing list. It is used in a variety of other projects,
>   including gcc's Graphite loop optimizer. It has been tested on
>   Linux, FreeBSD, OpenBSD, Solaris, IRIX64, Mac OS X, Cygwin, DEC
>   OSF/1.
>
> cddlib was the first really useful software package back in the day
> and it was hugely influential for many subsequent codes. But nowadays
> there are alternatives that combine the same algorithms with better
> implementations and software development practices.(2)
>
> Note that I'm not proposing to remove cddlib entirely. It is still a
> requirement for gfan and the only program to do polyhedral
> computations over floating point numbers.(3)
>
> === Work Plan ===
>
> I have written a PPL spkg and a Cython (C++) wrapper that should cover
> all functions necessary for dealing with polyhedra in Sage. You can
> find it here:
>
> http://trac.sagemath.org/sage_trac/ticket/10039
>
> Using this wrapper, I patched sage.geometry.cone:
>
> http://trac.sagemath.org/sage_trac/ticket/10140
>
> I think that the PPL spkg and the Cython wrapper is ready for
> inclusion in the next Sage release (4.6.1?). In the subsequent release
> we can then rebase sage.geometry modules on top of the wrapper.
>
> Right now I would like to invite any comments on this plan!
>
> === Notes ===
>
> (1) cddlib also comes with a shared library. But its poorly documented
> and, according to valgrind, leaks memory. Other toolkits like lrs and
> qhull don't build shared libraries but have minimal instructions for
> statically linking with parts of their code.
>
> (2) In particular, cddlib has no bug tracker, no new release in the
> last 5 years, and segfaults on some of its own testsuite.
>
> (3) Though in a numerically unstable way, see Trac #10046, #10037.

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