[sage-support] Re: pni and Sage 4.7

2011-09-05 Thread Anthony Wickstead
Thanks for the help. I was trying to avoid building Sage from source
as I am not all that Linux-literate, but I did try the current source
and it compiled and ran OK except for not creating .html files as

'makefile' v4.7 or later is needed to make HTML docs but missing on
your system

Apparently this is a known lack in Ubuntu which can easily be fixed
but maybe should be added to the list of assumptions for an
installation from source.

Tony

On Sep 2, 6:07 pm, William Stein  wrote:
> On Fri, Sep 2, 2011 at 10:00 AM, Maarten Derickx
>
>  wrote:
> > From the location of your sage install
> > ~/Documents/sage-4.7.1-linux-32bit-ubuntu_10.04_lts-
> > i686-Linux
>
> > I see you downloaded a prebuild binairy, I guess what's going wrong is that
> > this binary was compiled in such a way that it's not compatible with your
> > system. This
> > post https://groups.google.com/forum/#!topic/sage-support/XJS-3u5z7ws
> > might be of help.
> > I don't know if we have old prebuild binary's publically available
> > somewhere,
>
> That won't help.
>
> > but at least we have old source code
> > on http://www.sagemath.org/src-old/
>
> And current source code:
>
>    http://www.sagemath.org/download-source.html
>
>  -- William
>
>
>
> > --
> > To post to this group, send email to sage-support@googlegroups.com
> > To unsubscribe from this group, send email to
> > sage-support+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/sage-support
> > URL:http://www.sagemath.org
>
> --
> William Stein
> Professor of Mathematics
> University of Washingtonhttp://wstein.org

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


[sage-support] Re: setting default option values in show

2011-09-05 Thread kcrisman
Dear Ken,

One thing you could do is just to modify your Sage installation.  In
the code for Posets, there is

def plot(self, label_elements=True, element_labels=None,
label_font_size=12,label_font_color='black',
vertex_size=300, vertex_colors=None,**kwds):
"""
Returns a Graphic object corresponding the Hasse diagram of
the
poset. Optionally, it is labelled.

1) Change the None for vertex_colors to your preference ('orange' or
something else)
2) In the command line, run `./sage -b` from the directory Sage lives
in
3) Start Sage however you usually do

That should work.

For many plot things there are also dictionaries you can set with
options like this, but it doesn't look like this is the case for graph
plots.  There is a dictionary *listing* the options!  But it doesn't
seem to come with a global dictionary one could modify once and for
all of defaults.

If that's not the case, I hope someone will correct me!

Good luck.

- kcrisman

On Sep 4, 1:05 pm, Ken Levasseur  wrote:
> I'm displaying a bunch of posets and prefer the vertices to be orange as 
> opposed to the default blue.  The code below works fine, but I'd like to 
> avoid including the option specification by setting the option for vertex 
> colors to be 'orange' and I can't find exactly how to do this.     Any help?
>
> example=Poset({0:[2],1:[2],2:[3],3:[]})
> example.show(vertex_colors='orange')
>
> Ken Levasseur
> UMass Lowellhttp://faculty.uml.edu/klevasseur/ads2

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


[sage-support] Does Sage do quotas or other protections in case users's calculation takes too long?

2011-09-05 Thread Chris Seberino
Does Sage do quotas or other protections in case users's calculation
takes too long?

I'm having nightmares of students crashing Sage servers or tying them
up with simple little commands like so...

2^(2^(2^123456789))

and

def f(x):
while True:
 pass
f(x)

cs

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


[sage-support] How get last login time of a Sage notebook user?

2011-09-05 Thread Chris Seberino
How get last login time of a Sage notebook user?

cs

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


[sage-support] RSK algorithm

2011-09-05 Thread Pedro Sanchez
Could someone be kind enough to point me in the right direction to
polish and submit a new sage function?

SAGE already has an implementation of the Robinson-Schensted algorithm
for permutations (bijection between permutations and standard Young
tableaux),
which I used as a base to implement the Robinson-Schensted-Knuth
generalization (bijection between nonegative integer matrices and
pairs of semistandard Young tableaux).

Unfortunately, I don't know how to "add it" to the base Matrix class
(like RS is a method from Permutation class, and I don't know if it
should be desirable since it can't be applied to arbitrary matrices)
nor how or where submit it for consideration.

Anyway, here's the code if someone finds it useful


from itertools import izip
from bisect import bisect
def RSK(M):
   """ Implementation of the Robinson-Schensted-Knuth algorithm for
non negative integer matrices,
based on the Robinson-Schensted algorithm for Permutations
   """
   # M is the matrix corresponding to the pair of tableau (P,Q)

   # First we create the double-row array
   upperrow = []
   lowerrow = []
   for r in range(M.nrows()):
   fila = M[r]
   for c in range(len(fila)):
   for k in range(M[r][c]):
   upperrow.append(r+1)
   lowerrow.append(c+1)
   p = []   #the "insertion" tableau
   q = []   #the "recording" tableau

   # We proceed to do bumping algorithm on lower row
   # and recording places on upper row
   for a,b in izip(upperrow, lowerrow):
   for r,qr in izip(p,q):
   if r[-1] > b:
   y_pos = bisect(r,b)
   b, r[y_pos] = r[y_pos], b
   else:
   break
   else:
   r=[]; p.append(r)
   qr = []; q.append(qr)

   r.append(b)
   qr.append(a)
   return [Tableau(p), Tableau(q)]


Usage:

M = Matrix( [[1,0,2],[0,2,0],[1,1,0]] )
(P,Q)=RSK(Me)
(P,Q)
: ([[1, 1, 2, 2], [2, 3], [3]], [[1, 1, 1, 3], [2, 2], [3]])
P.pp()

 1  1  2  2
 2  3
 3

Q.pp()

 1  1  1  3
 2  2
 3


-- 
Pedro Sánchez
http://drini.mx
@combinatorica

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


[sage-support] Re: setting default option values in show

2011-09-05 Thread Ken Levasseur


On Sep 5, 9:00 am, kcrisman  wrote:
> For many plot things there are also dictionaries you can set with
> options like this, but it doesn't look like this is the case for graph
> plots.  There is a dictionary *listing* the options!  But it doesn't
> seem to come with a global dictionary one could modify once and for
> all of defaults.

Thanks, but something like a dictionary of options is what I was
looking for.  I have some material to distribute to students and
modifying the installation doesn't work in my case, although I'll
probably do it for my own use.

Ken

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


Re: [sage-support] Re: setting default option values in show

2011-09-05 Thread William Stein
On Mon, Sep 5, 2011 at 12:06 PM, Ken Levasseur  wrote:
>
>
> On Sep 5, 9:00 am, kcrisman  wrote:
>> For many plot things there are also dictionaries you can set with
>> options like this, but it doesn't look like this is the case for graph
>> plots.  There is a dictionary *listing* the options!  But it doesn't
>> seem to come with a global dictionary one could modify once and for
>> all of defaults.
>
> Thanks, but something like a dictionary of options is what I was
> looking for.  I have some material to distribute to students and
> modifying the installation doesn't work in my case, although I'll
> probably do it for my own use.

You could also just define your own wrapper for the show command,
i.e., your own function called "show" (or even "sh"), and set
additional options there.   Check out the *args and **kwds support in
Python.

 -- William

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


[sage-support] Re: setting default option values in show

2011-09-05 Thread Nils Bruin
On Sep 5, 2:03 pm, William Stein  wrote:
> You could also just define your own wrapper for the show command,
> i.e., your own function called "show" (or even "sh"), and set
> additional options there.   Check out the *args and **kwds support in
> Python.

Wrapping is probably the cleanest and most advisable options. However,
Python's extremely dynamic nature actually makes it possible to change
the defaults on the fly. Tricks like this should probably void any
warranty, if you had any to begin with:

sage: V=Poset({Integer(0):[Integer(2)],Integer(1):
[Integer(2)],Integer(2):[Integer(3)],Integer(3):[]})
sage: L=list(V.show.im_func.func_defaults)
sage: L[5]='orange'
sage: V.show.im_func.func_defaults=tuple(L)

After this you basically have accomplished the same thing that a
source change would do -- but only for the remainder of this session.
If you now do "V.show()" you'll have orange vertices (the 5 comes from
the fact that 'vertex_color' is the 6th keyword argument in the
definition of V.show).

Again, I don't think you'd want to advertise a technique like this to
students, so go with the wrapper.

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


Re: [sage-support] RSK algorithm

2011-09-05 Thread Dan Drake
On Mon, 05 Sep 2011 at 09:59AM -0500, Pedro Sanchez wrote:
> Could someone be kind enough to point me in the right direction to
> polish and submit a new sage function?
> 
> SAGE already has an implementation of the Robinson-Schensted algorithm
> for permutations (bijection between permutations and standard Young
> tableaux), which I used as a base to implement the
> Robinson-Schensted-Knuth generalization (bijection between nonegative
> integer matrices and pairs of semistandard Young tableaux).
> 
> Unfortunately, I don't know how to "add it" to the base Matrix class
> (like RS is a method from Permutation class, and I don't know if it
> should be desirable since it can't be applied to arbitrary matrices)
> nor how or where submit it for consideration.

You should definitely post this to the sage-combinat list:
https://groups.google.com/forum/#!forum/sage-combinat-devel

(I see someone has already forwarded your message there.) The folks
there are working on tableaux and would know where best to put your
code. Having the bijection for nonnegative integer matrices would surely
be nice to have in Sage.

Dan

--
---  Dan Drake
-  http://mathsci.kaist.ac.kr/~drake
---


signature.asc
Description: Digital signature