[sage-support] Re: fast slicing of matrix

2009-06-02 Thread davidp
Success! sage: G = graphs.GridGraph([100,100]) sage: L = G.laplacian_matrix() sage: L 1 x 1 sparse matrix over Integer Ring sage: sage: time M = L[1:] CPU times: user 21.98 s, sys: 0.01 s, total: 21.99 s Wall time: 22.93 s sage: sage: time N = L._delete_row_(0) CPU times: user 0.01 s,

[sage-support] Re: fast slicing of matrix

2009-06-02 Thread William Stein
On Tue, Jun 2, 2009 at 10:10 PM, davidp wrote: > > I might be going down the wrong path, but is seems like I would want > to add a > >         copy_mpz_vector_init > > function to  vector_integer_sparse_c.pxi that would make a copy of an > mpz_vector.  Is that overkill? That sounds like a good i

[sage-support] Re: fast slicing of matrix

2009-06-02 Thread davidp
I might be going down the wrong path, but is seems like I would want to add a copy_mpz_vector_init function to vector_integer_sparse_c.pxi that would make a copy of an mpz_vector. Is that overkill? My first idea was to use add_mpz_vector_init(sum, v, w, mul), which sets sum equal to

[sage-support] Re: fast slicing of matrix

2009-06-02 Thread William Stein
On Tue, Jun 2, 2009 at 8:45 PM, davidp wrote: > > I can't figure out how to create a new sparse matrix (see below). > > Sorry, > Dave You can make a new matrix with the analogous parent but a different shape using the new_matrix method. sage: a = random_matrix(ZZ,3,4,sparse=True) sage: a.new_ma

[sage-support] Re: fast slicing of matrix

2009-06-02 Thread davidp
I can't figure out how to create a new sparse matrix (see below). Sorry, Dave M = Matrix_integer_sparse.__new__(Matrix_integer_sparse, sage.matrix.matrix_space.MatrixSpace(ZZ, self._nrows-1, self._ncols, sparse=True), None, None, None) --- ... def _delete_row_(self, Py_ssiz

[sage-support] Re: fast slicing of matrix

2009-06-02 Thread Jason Grout
William Stein wrote: > On Tue, Jun 2, 2009 at 7:22 PM, davidp wrote: >> I tried adding a delete_row method to matrix_integer_sparse.pyx but >> stopped after getting the error message: > > Just def your method -- do not cpdef it. You can still use Cython > code in a cpdef's method and it will be

[sage-support] problem running sage -t

2009-06-02 Thread davidp
I would like to run the doctests in my file, "sandpile.sage", but get the following error message: ++=== xyzzy> sage -t sandpile.sage sage -t "sandpile.sage" /usr/local/sage-devel/local/bin/sage-preparse: File file_name is missing Traceback (most recent call last)

[sage-support] Re: fast slicing of matrix

2009-06-02 Thread William Stein
On Tue, Jun 2, 2009 at 7:22 PM, davidp wrote: > > I tried adding a delete_row method to matrix_integer_sparse.pyx but > stopped after getting the error message: Just def your method -- do not cpdef it. You can still use Cython code in a cpdef's method and it will be just as fast. Make sure tha

[sage-support] Re: fast slicing of matrix

2009-06-02 Thread davidp
I tried adding a delete_row method to matrix_integer_sparse.pyx but stopped after getting the error message: + Error converting Pyrex file to C: ... add_mpz_vec

[sage-support] Re: fast slicing of matrix

2009-06-02 Thread Jason Grout
William Stein wrote: > On Mon, Jun 1, 2009 at 5:16 PM, davidp wrote: >> Is there a fast way to create a submatrix? >> >> - >> >> >> sage: version() >> 'Sage Version 4.0.alpha0, Release Date: 2009-05-15' >> sage: G = graphs.GridGraph([100,100]) >> sa

[sage-support] Re: Limiting the function value range in 3dplots

2009-06-02 Thread Jason Grout
littlemathteacher wrote: > Dear supporters, > > again thanks for the great support. > > One thing I am missing (or simply not understanding) is 3dplotting > without automatically scaled up range of the function value. > > (This is just my first example at hand and surely not a good one: > y, x

[sage-support] Re: Typesetting issue

2009-06-02 Thread richi
I made a mistake in the example. The correct example is: f=function("f",x) a=integrate(f,x,0,1) show(a) I have been doing some other tests, and all math symbols seem to be gone, square roots for example. Regards Ricardo On 2 jun, 16:55, richi wrote: > I had installed sage 3.4.1 in my Ubuntu m

[sage-support] Typesetting issue

2009-06-02 Thread richi
I had installed sage 3.4.1 in my Ubuntu machine, and every time I did something like: f=function("f",x) integrate(f,x,0,1) in a notebook, sage showed me the equation using an integral symbol. I just installed sage 4.0, and when I do the same, I get: integrate(f(x), x, 0, 1) no matter if I che

[sage-support] Re: Just to tell you I could make a wx render to work for matplotlib within ETS spkg

2009-06-02 Thread Jorge E . ´Sanchez Sanchez
After installing ETS spkg, once someone knows what to do it seems very easily, 1) download from: agni.phys.iit.edu/~kmcivor/wxmpl/, Wxmpl version 1.3.1 which is completely compatible with the matplotlib library comming with the ETS-3.1.1 spkg, in your $SAGE_ROOT/local/lib/python2.5/site-pack

[sage-support] Re: Just to tell you I could make a wx render to work for matplotlib within ETS spkg

2009-06-02 Thread Jaap Spies
Jorge E. ´Sanchez Sanchez wrote: > Hi all, > I was a little dissappointed when I discover after accomplished to install > the ETS spkg to work, in my Ubuntu 9.04 athlon x86_64 computer, that although > it has mayavi2 and chaco working in all is beautifullness, it has not the > render for pylab

[sage-support] Just to tell you I could make a wx render to work for matplotlib within ETS spkg

2009-06-02 Thread Jorge E . ´Sanchez Sanchez
Hi all, I was a little dissappointed when I discover after accomplished to install the ETS spkg to work, in my Ubuntu 9.04 athlon x86_64 computer, that although it has mayavi2 and chaco working in all is beautifullness, it has not the render for pylab (matplotlib). Because all my 2-D graphs ar

[sage-support] Re: Notebook server sluggish in 3.4

2009-06-02 Thread Marshall Hampton
Thanks Kiran, I think snapshots were indeed part of the problem. I have been running that server since early 2007, with multiple grad students, and it had a ridiculous number of snapshot files. I think I've deleted about 1 GB so far. -Marshall On May 30, 3:24 pm, Kiran Kedlaya wrote: > Follow

[sage-support] Re: sage and numpy interactions

2009-06-02 Thread Ondrej Certik
On Tue, Jun 2, 2009 at 11:26 AM, William Stein wrote: > > On Tue, Jun 2, 2009 at 10:15 AM, VictorMiller wrote: >> >> In converting some of my old python programs to run on SAGE I >> expressions like: >> >> 0.5**numpy.arange(10,1,-1) >> >> which works fine in python, but gives a type error in SAG

[sage-support] Re: sage and numpy interactions

2009-06-02 Thread William Stein
On Tue, Jun 2, 2009 at 10:15 AM, VictorMiller wrote: > > In converting some of my old python programs to run on SAGE I > expressions like: > > 0.5**numpy.arange(10,1,-1) > > which works fine in python, but gives a type error in SAGE.  I > eventually figured out that I could > get this to work by

[sage-support] sage and numpy interactions

2009-06-02 Thread VictorMiller
In converting some of my old python programs to run on SAGE I expressions like: 0.5**numpy.arange(10,1,-1) which works fine in python, but gives a type error in SAGE. I eventually figured out that I could get this to work by doing float(0.5)**numpy.arange(10,1,-1) but that's a pain. Any chan

[sage-support] Re: Limiting the function value range in 3dplots

2009-06-02 Thread kcrisman
Actually, Sage's 2d plotting has a similar problem, though for different reasons; see http://trac.sagemath.org/sage_trac/ticket/3985 . I believe that in both cases, though, there could be improvement of "automatic" detecting of the "right" values. That said, you may want to try something using t

[sage-support] Re: Limiting the function value range in 3dplots

2009-06-02 Thread littlemathteacher
Sorry, me again. Maybe I was wrong to say Sage scales "up". Maybe Sage scales "down". Howto aviod this? Thanks On 2 Jun., 08:44, littlemathteacher wrote: > Dear supporters, > > again thanks for the great support. > > One thing I am missing (or simply not understanding) is 3dplotting > without