Re: [sage-devel] Re: Questions about Solve

2011-09-13 Thread William Stein
On Tue, Sep 13, 2011 at 10:48 AM, kcrisman wrote: >> Personally, I'm in favor of deprecating the solve(eq, x,y) or solve(list >> of equations, x,y,z) syntax, and would prefer that the variables be >> specified as a list: > > Backwards-incompatible, hence fodder for the mythical Sage 5.0 ... (Asid

[sage-devel] Re: embedding sage in c or c++

2011-09-13 Thread Michael Rubinstein
Thanks! That worked for me too, though I'm not sure how you decided on the specific choices of libraries to link to. Mike On Sep 13, 6:39 pm, Willem Jan Palenstijn wrote: > On Tue, Sep 13, 2011 at 08:46:05AM -0700, Michael Rubinstein wrote: > > > I tried adding PySys_SetArgv(argc, argv); after P

[sage-devel] Re: Questions about Solve

2011-09-13 Thread kcrisman
Okay, it turns out that this is the explanation for all the weirdness at #10750, which I hadn't bothered to figure out before. I'm updating that ticket now. -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubsc

[sage-devel] Re: [sage-support] Re: [sage-notebook] public single cell server

2011-09-13 Thread Alexander Juarez
I ran some simple code in my iphone's browser and the result was an error. When I toggled plaintext input the code ran as expected. It would seem that the code view does not play well with the particular device. I am not sure if this is a problem experianced by other devices but, perhaps browser ch

[sage-devel] Re: Questions about Solve

2011-09-13 Thread Jason Grout
On 9/13/11 1:30 PM, John H Palmieri wrote: On Tuesday, September 13, 2011 11:09:41 AM UTC-7, jason wrote: On 9/13/11 12:48 PM, kcrisman wrote: >> Personally, I'm in favor of deprecating the solve(eq, x,y) or solve(list >> of equations, x,y,z) syntax, and would prefer that the

[sage-devel] Re: Questions about Solve

2011-09-13 Thread John H Palmieri
On Tuesday, September 13, 2011 11:09:41 AM UTC-7, jason wrote: > > On 9/13/11 12:48 PM, kcrisman wrote: > >> Personally, I'm in favor of deprecating the solve(eq, x,y) or solve(list > >> of equations, x,y,z) syntax, and would prefer that the variables be > >> specified as a list: > > > > Backward

[sage-devel] Re: Questions about Solve

2011-09-13 Thread Jason Grout
On 9/13/11 12:48 PM, kcrisman wrote: Personally, I'm in favor of deprecating the solve(eq, x,y) or solve(list of equations, x,y,z) syntax, and would prefer that the variables be specified as a list: Backwards-incompatible, hence fodder for the mythical Sage 5.0 ... the deprecation could go in

[sage-devel] Re: Questions about Solve

2011-09-13 Thread kcrisman
> Personally, I'm in favor of deprecating the solve(eq, x,y) or solve(list > of equations, x,y,z) syntax, and would prefer that the variables be > specified as a list: Backwards-incompatible, hence fodder for the mythical Sage 5.0 ... > solve(eq, [x,y]) or > solve(list of equations, [x,y,z]) Tho

[sage-devel] Re: [sage-support] Re: [sage-notebook] public single cell server

2011-09-13 Thread Jason Grout
On 9/13/11 1:53 AM, Alexander Juarez wrote: I ran some simple code in my iphone's browser and the result was an error. When I toggled plaintext input the code ran as expected. It would seem that the code view does not play well with the particular device. I am not sure if this is a problem experi

Re: [sage-devel] Re: embedding sage in c or c++

2011-09-13 Thread Willem Jan Palenstijn
On Tue, Sep 13, 2011 at 08:46:05AM -0700, Michael Rubinstein wrote: > > I tried adding PySys_SetArgv(argc, argv); after Py_Initialize(); > It gets me further but then gives a strange error message: > > Loading the Sage library... > > > ---

[sage-devel] Re: Questions about Solve

2011-09-13 Thread Jason Grout
On 9/13/11 12:00 PM, Pong wrote: Thanks for the reply. However, I'm not so sure about the intention part of the comment I got the solve(x+y==3, x,y), i.e. asking solve for more than one variables strict from the current documentation (solve? ) except I dropped the redundant equation 2x+2y==6. W

Re: [sage-devel] solve_right RDF weirdness

2011-09-13 Thread Dima Pasechnik
Matlab uses QR for rectangular matrices, and LU for (general) square matrices. -- 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.goog

[sage-devel] Re: Questions about Solve

2011-09-13 Thread Pong
Thanks for the reply. However, I'm not so sure about the intention part of the comment I got the solve(x+y==3, x,y), i.e. asking solve for more than one variables strict from the current documentation (solve? ) except I dropped the redundant equation 2x+2y==6. Why don't solve just call the main s

[sage-devel] Re: Questions about Solve

2011-09-13 Thread John H Palmieri
On Tuesday, September 13, 2011 9:34:13 AM UTC-7, kcrisman wrote: > > > > On Sep 13, 12:08 pm, Pong wrote: > > y,z=var('y,z'); solve(6*x + 10*y + 15*z ==1,x,y,z) gives > > ([{x: -5/3*y - 5/2*z + 1/6}], [1]) > > So wacky. Definitely a bug, needless to say. > Yes, a bug. > > > ([x == -y + 3]

[sage-devel] Re: Questions about Solve

2011-09-13 Thread kcrisman
On Sep 13, 12:08 pm, Pong wrote: > y,z=var('y,z'); solve(6*x + 10*y + 15*z ==1,x,y,z) gives > ([{x: -5/3*y - 5/2*z + 1/6}], [1]) So wacky. Definitely a bug, needless to say. > ([x == -y + 3], [1]) > > My questions are: > 1) Why the notation are different in the 2 and 3-variable case? One > gi

[sage-devel] Questions about Solve

2011-09-13 Thread Pong
y,z=var('y,z'); solve(6*x + 10*y + 15*z ==1,x,y,z) gives ([{x: -5/3*y - 5/2*z + 1/6}], [1]) while solve(x+y==3,x,y) gives ([x == -y + 3], [1]) My questions are: 1) Why the notation are different in the 2 and 3-variable case? One gives x: and the other x== 2) What the [1] in both cases stand for

[sage-devel] Re: embedding sage in c or c++

2011-09-13 Thread Michael Rubinstein
I tried adding PySys_SetArgv(argc, argv); after Py_Initialize(); It gets me further but then gives a strange error message: Loading the Sage library... Unhandled SIGSEGV: A segmentation fault occurred in Sage. This probably occurred b

Re: [sage-devel] solve_right RDF weirdness

2011-09-13 Thread Volker Braun
It seems like the rank() method does not implement a fuzzy zero, so it does not make too much sense for floating-point numbers. But for any cutoff for the eigenvalues there is going to be some matrix with m.rank() != m.transpose().rank(), though hopefully not a 3x3 one ;-) As Jason already ment

[sage-devel] Re: solve_right RDF weirdness

2011-09-13 Thread Jason Grout
On 9/13/11 9:04 AM, Dima Pasechnik wrote: I was just shown even better example of how bad this can get: sage: m=matrix(RDF,[[1.24,0.2,2],[2.48,0.4,4],[3.72,0.6,1]]) sage: print m.rank() 3 sage: print m.transpose().rank() 2 it seems that a more robust way here would be to call the LU-decompositio

[sage-devel] Re: GiNaC and Python disagree on arithmetic

2011-09-13 Thread rjf
Since python is merely a programming language and not an authority on all of mathematics, I don't see why its choice should be given special consideration. I suppose Ginac has a broader view, but not especially as broad as Sage is supposed to have. It is possible to come to some conclusions of wh

Re: [sage-devel] solve_right RDF weirdness

2011-09-13 Thread Dima Pasechnik
I was just shown even better example of how bad this can get: sage: m=matrix(RDF,[[1.24,0.2,2],[2.48,0.4,4],[3.72,0.6,1]]) sage: print m.rank() 3 sage: print m.transpose().rank() 2 it seems that a more robust way here would be to call the LU-decomposition, which calls scipy (or/and numpy?), so th

Re: [sage-devel] embedding sage in c or c++

2011-09-13 Thread Willem Jan Palenstijn
On Tue, Sep 13, 2011 at 06:10:45AM -0700, Michael Rubinstein wrote: > Example 2 > > > Next thing I tried to do was to embed sage in a c program, by > following > http://docs.python.org/extending/embedding.html > but that gave me errors at runtime. > > For example, the following e

[sage-devel] embedding sage in c or c++

2011-09-13 Thread Michael Rubinstein
I'd like to call some sage commands from within a c++ program and use the output. My plan is to call very simple 1-4 line sequences of sage commands, in order to make use of some of the number theoretic functions built into sage (for example, dealing with elliptic curves, number fields, modular for

[sage-devel] Metaclass for a fast cached hash

2011-09-13 Thread Simon King
Hi Nicolas, Florent and Maarten, On 13 Sep., 10:07, Simon King wrote: > The new metaclass provides a fast hash, and thus can be useful in > applications that frequently work with, say, dictionary keys. However, > there is no free lunch. The fast hash currently comes with a > regression in accessi

[sage-devel] Re: Quotient ring of integer ring?

2011-09-13 Thread Simon King
Hi Nicolar, On 13 Sep., 10:00, "Nicolas M. Thiery" wrote: > On Wed, Sep 07, 2011 at 02:27:47PM -0700, William Stein wrote: > > > Moreover, one must not forget that we want to create quotient rings > > > not only for ideals in polynomial rings. > > > True, but it is an important case, since the id

[sage-devel] Re: Pickling of classes with metaclasses

2011-09-13 Thread Simon King
Hi Nicolas, Florent and Maarten, On 13 Sep., 09:36, "Nicolas M. Thiery" wrote: > On Tue, Sep 13, 2011 at 09:21:45AM +0200, Nicolas M. Thiery wrote: > > What does your FastHashMetaclass do precisely? > > Oops, I had not read the other thread yet ... I just created a ticket for it: #11794. The ne

Re: [sage-devel] Re: Quotient ring of integer ring?

2011-09-13 Thread Nicolas M. Thiery
On Wed, Sep 07, 2011 at 02:27:47PM -0700, William Stein wrote: > > Moreover, one must not forget that we want to create quotient rings > > not only for ideals in polynomial rings. > > True, but it is an important case, since the ideas covers all finitely > generated quotient rings, and there are a

[sage-devel] Re: GiNaC and Python disagree on arithmetic

2011-09-13 Thread Marco Streng
I'd say we should stick with Python's convention 0^0 = 1. Some additional information: on sage-nt http://groups.google.com/group/sage-nt/browse_thread/thread/67e53f8e5d5061d2/ we chose to follow Python's convention 0^0 = 1 through a bit further. As for Maarten's examples, there are some more in E

Re: [sage-devel] Re: Pickling of classes with metaclasses

2011-09-13 Thread Florent Hivert
Hi Nicolas, > What does your FastHashMetaclass do precisely? Could we just throw the > feature in ClasscallMetaclass? This could be a good occasion to find a > more appropriate name for this metaclass. Speaking of which: > ClasscallMetaclass and UniqueRepresentation would deserve to be > cyt

Re: [sage-devel] Re: Pickling of classes with metaclasses

2011-09-13 Thread Nicolas M. Thiery
On Tue, Sep 13, 2011 at 09:21:45AM +0200, Nicolas M. Thiery wrote: > What does your FastHashMetaclass do precisely? Oops, I had not read the other thread yet ... Nicolas -- Nicolas M. Thiéry "Isil" http://Nicolas.Thiery.name/ -- To post to this group, send an em

Re: [sage-devel] Re: What happens when the hash value of an element is computed?

2011-09-13 Thread Nicolas M. Thiery
On Sat, Sep 10, 2011 at 02:45:20AM -0700, Maarten Derickx wrote: >By the way, if we really start using multiple inheritance a lot, With categories, we already are :-) >we should also make a list in the documentation somewhere about >the order in wich you should inherit. Just always p

Re: [sage-devel] Re: Pickling of classes with metaclasses

2011-09-13 Thread Nicolas M. Thiery
On Sun, Sep 11, 2011 at 04:07:39PM -0700, Simon King wrote: > I found some comments stating that the current use of metaclasses in > Sage is not very scalable. That probably was from me. > I guess that shall be understood as "things get messy if one puts a > new metaclass on top of existing (and

[sage-devel] Re: GiNaC and Python disagree on arithmetic

2011-09-13 Thread Nils Bruin
On Sep 12, 2:50 pm, Maarten Derickx wrote: > sage: a=GF(7)(0) > sage: a^a > ... > ArithmeticError: 0^0 is undefined. > > sage: a=Integers(7)(0) > sage: a^a > ... > ArithmeticError: 0^0 is undefined. I think something else is going wrong here. It's not so much that the exponent is 0, it's that the