From rguzman at iconstructs.com Thu Sep 7 16:35:13 2000 From: rguzman at iconstructs.com (Ricardo Guzman) Date: Thu, 7 Sep 2000 10:35:13 -0400 Subject: download Message-ID: <002101c018d8$d56fa440$a3d5ef8c@iconstructs.com> I'm having problems extracting the source code from the tar file: GiNaC-0.6.4.tar.bz2. I believe it may be corrupt. Could you verify this? Thanks Ricardo Guzman From kreckel at ThEP.Physik.Uni-Mainz.DE Thu Sep 7 16:51:27 2000 From: kreckel at ThEP.Physik.Uni-Mainz.DE (Richard B. Kreckel) Date: Thu, 7 Sep 2000 16:51:27 +0200 (CEST) Subject: download In-Reply-To: <002101c018d8$d56fa440$a3d5ef8c@iconstructs.com> Message-ID: On Thu, 7 Sep 2000, Ricardo Guzman wrote: > I'm having problems extracting the source code from the tar file: > GiNaC-0.6.4.tar.bz2. I believe it may be corrupt. Could you verify this? No, the file is not corrupted. My first guess is you are using the wrong command to unpack it: it is not in gz format, it is bzip2. (Use tar xIf GiNaC-0.6.4.tar.bz2 or such.) Regards -richy. -- Richard Kreckel From kreckel at thep.physik.uni-mainz.de Mon Sep 18 14:44:29 2000 From: kreckel at thep.physik.uni-mainz.de (Richard B. Kreckel) Date: Mon, 18 Sep 2000 14:44:29 +0200 (CEST) Subject: the expand() thing. Message-ID: Hi there, Recently I have been talking with Alex about a weird inefficency of GiNaC's expand() that showed up in some series expansion. It reappeared, this time in a clearer form, when I tried to implement an asymptotically optimal algorithm for computing characteristic polynomials (by transforming the matrix to an upper block-Frobenius form, but that's uninteresting here). That algorithm gives the characteristic polynomial in a partly factorized form and when I expand it I see horrible execution times or even worse, memory exhaustions. Consider this: > expand((-1+5*x-5*x^4-10*x^2+x^5+10*x^3)*(1-4*x+x^4+6*x^2-4*x^3)* (-1+7*x-35*x^4-21*x^2+21*x^5-7*x^6+35*x^3+x^7)* (1-8*x+70*x^4+28*x^2+x^8-56*x^5+28*x^6-56*x^3-8*x^7)* (1-6*x+15*x^4+15*x^2-6*x^5+x^6-20*x^3)*(-1+x)^36* (-1+9*x+x^9-126*x^4-36*x^2-9*x^8+126*x^5-84*x^6+84*x^3+36*x^7)^2* (1-2*x+x^2)); Out of virtual memory. > expand((-1+5*x-5*x^4-10*x^2+x^5+10*x^3)*(1-4*x+x^4+6*x^2-4*x^3)* (-1+7*x-35*x^4-21*x^2+21*x^5-7*x^6+35*x^3+x^7)* (1-8*x+70*x^4+28*x^2+x^8-56*x^5+28*x^6-56*x^3-8*x^7)* (1-6*x+15*x^4+15*x^2-6*x^5+x^6-20*x^3)*(-1+x)^36* (-1+9*x+x^9-126*x^4-36*x^2-9*x^8+126*x^5-84*x^6+84*x^3+36*x^7)^2* (1-2*x+x^2)*(-75810815066186520+75810815066186521*x+165*x^9-165*x^4-11*x^2-330* x^8+11*x^11+330*x^5-55*x^10-462*x^6+55*x^3-x^12+462*x^7)*(-1+3*x-3*x^2+x^3)); bad_alloc Virtual memory was 1GB. (BTW: The second polynomial is identical to the one computed in expanded form in check/time_lw_P.cpp.) Alex, would you be able to have a look into this? Cheers -richy. -- Richard Kreckel From kreckel at thep.physik.uni-mainz.de Tue Sep 19 16:12:44 2000 From: kreckel at thep.physik.uni-mainz.de (Richard B. Kreckel) Date: Tue, 19 Sep 2000 16:12:44 +0200 (CEST) Subject: the expand() thing. In-Reply-To: Message-ID: On Mon, 18 Sep 2000, I wrote: > Consider this: > > expand((-1+5*x-5*x^4-10*x^2+x^5+10*x^3)*(1-4*x+x^4+6*x^2-4*x^3)* > (-1+7*x-35*x^4-21*x^2+21*x^5-7*x^6+35*x^3+x^7)* > (1-8*x+70*x^4+28*x^2+x^8-56*x^5+28*x^6-56*x^3-8*x^7)* > (1-6*x+15*x^4+15*x^2-6*x^5+x^6-20*x^3)*(-1+x)^36* > (-1+9*x+x^9-126*x^4-36*x^2-9*x^8+126*x^5-84*x^6+84*x^3+36*x^7)^2* > (1-2*x+x^2)); > Out of virtual memory. Hint: expanding the mul object successively step by step makes it fly. Is it really a good idea to expand all children first and then do some gymnastics with them? Or am I missing some point? (It just comes into my mind that the issue is also of interest for some algorithms in class matrix. It throws some new light on a number of empirically inserted additional .expand()s which turned out to be absolutely necessary to be efficient. I guess I can remove all these once this is resolved.) Cheers -richy. -- Richard Kreckel From dhson at thep.physik.uni-mainz.de Fri Sep 22 19:55:44 2000 From: dhson at thep.physik.uni-mainz.de (Do Hoang Son) Date: Fri, 22 Sep 2000 19:55:44 +0200 (CEST) Subject: what's this In-Reply-To: Message-ID: Hi all, I'm now back with Xloops project and this is my "hello" to you :-): in ginsh type > a=1/(1-x-x^2); (1-x-x^2)^(-1) > b=series(a,x==0,3); 1+1*x+2*x^2+Order(x^3) > b/2; 1/2*1+1*x+2*x^2+Order(x^3) ^^^^^^ I checked and find out it's not the print() problem so maybe it comes from the expand()? Hope not to have to say "hello" every day :-) Cheers, Son. From kreckel at thep.physik.uni-mainz.de Fri Sep 22 21:29:12 2000 From: kreckel at thep.physik.uni-mainz.de (Richard B. Kreckel) Date: Fri, 22 Sep 2000 21:29:12 +0200 (CEST) Subject: what's this In-Reply-To: Message-ID: On Fri, 22 Sep 2000, Do Hoang Son wrote: > > a=1/(1-x-x^2); > (1-x-x^2)^(-1) > > b=series(a,x==0,3); > 1+1*x+2*x^2+Order(x^3) > > b/2; > 1/2*1+1*x+2*x^2+Order(x^3) > ^^^^^^ > I checked and find out it's not the print() problem so maybe it comes from > the expand()? Of course it is a pseries::print() problem! There were two mistakes: 1) It didn't check precedence against upper_precedence (blame me) and 2) pseries was inheriting it's precedence from basic (blame christian). I have committed the patches to CVS. Cheers -richy. -- Richard Kreckel From Bernard.Parisse at ujf-grenoble.fr Fri Sep 22 14:36:40 2000 From: Bernard.Parisse at ujf-grenoble.fr (Parisse Bernard) Date: Fri, 22 Sep 2000 14:36:40 +0200 Subject: factorization with GiNaC (update) Message-ID: <39CB5258.AAC95362@fourier.ujf-grenoble.fr> Hello, I have updated the polynomial package over GiNaC, especially factorization: ftp://fourier.ujf-grenoble.fr/pub/hp48/giac.tgz Main changes: * 2 version are available: you can either use giac with the NTL univariate factorization library or standalone * the code is faster. Installation requires gmp, cln and GiNaC, optionnaly NTL. Some timimgs of the standalone version on a Celeron 533 Mhz (# Time 0 means <=0.01 sec) (c+x+b)*(b^2-c*x+x^2-c*b+c^2-x*b) # Time0 (x+y+z)*(x-y+z)*(x-y-z) # Time0.01 (-5+3*x+y-y^2)*(-1+3*x+x*y-y^2) # Time0.01 (x-3*y+y*z)*(2*x-z+x*y)*(1+x*z+x*y+6*x^3) # Time0.02 (x*y+y^2+x^2)*(-x*y+y^2+x^2)*(x-y)*(-x-y) # Time0.01 (2+x^3+13*x*y*z^2-21*x*y^3*z)*(1+x*z+x*y+6*x^3) # Time0.01 2+x^3+13*x*y*z^2-21*x*y^3*z # Time0.01 x^2*y^2*(-x+y)*z^5*(-x-y-z) # Time0.01 -x^3*y^2*z*(x-y-z)*(-x+y-z)*(-x-y-z) # Time0.01 (8+15*x)*(1+8*x)*(11+5*x)*(-31+30*x)*(-13+12*x)*(-209+120*x) # Time0.01 (1+x^5+x^20+x^10+x^15)*(1-x^5+x^20+x^10-x^15) # Time0.02 (1+x^35+x^5-x^20+x^40-x^25-x^15)*(1-x^35-x^5-x^20+x^40+x^25+x^15)*(1+x-x^4+x^8-x^5-x^3+x^7)*(1-x-x^4+x^8+x^5+x^3-x^7)*(1+x+x^2)*(1-x+x^2) # Time0.13 If you are factoring big polynomials, the NTL version should be used instead of the standalone version (since it does not include e.g. FFT polynomial multiplication ...) Bernard Parisse From kreckel at thep.physik.uni-mainz.de Wed Sep 27 15:56:02 2000 From: kreckel at thep.physik.uni-mainz.de (Richard B. Kreckel) Date: Wed, 27 Sep 2000 15:56:02 +0200 (CEST) Subject: factorization with GiNaC (update) In-Reply-To: <39CB5258.AAC95362@fourier.ujf-grenoble.fr> Message-ID: Hi Bernard, That looks promising, though it usually needs tons of small manual fixes to get it compiled. Before diving deeper into this: Could the replication of GiNaC header files not be avoided? That makes maintening your code a nightmare. You seem to be accessing class power's basis and exponent, hence declaring them public. (I hope you don't write them in reference counted objects anywhere.) For accessing, you could simply use the .op(0) and .op(1) method. I haven't understood yet what you do with expairseq but I am under the impression that this can be dealt with in the same way? Regards -richy. -- Richard Kreckel From Bernard.Parisse at ujf-grenoble.fr Wed Sep 27 16:33:58 2000 From: Bernard.Parisse at ujf-grenoble.fr (Bernard Parisse) Date: Wed, 27 Sep 2000 16:33:58 +0200 (MET DST) Subject: factorization with GiNaC (update) In-Reply-To: from "Richard B. Kreckel" at "Sep 27, 2000 03:56:02 pm" Message-ID: <200009271433.QAA07605@mozart.ujf-grenoble.fr> > Hi Bernard, > > That looks promising, though it usually needs tons of small manual fixes > to get it compiled. Currently I did only tests on GNU/Linux, where it requires editing the Makefile to get the right path to GiNaC source. > Before diving deeper into this: Could the replication > of GiNaC header files not be avoided? That makes maintening your code a > nightmare. You seem to be accessing class power's basis and exponent, > hence declaring them public. (I hope you don't write them in reference > counted objects anywhere.) For accessing, you could simply use the > .op(0) and .op(1) method. I haven't understood yet what you do with > expairseq but I am under the impression that this can be dealt with in the > same way? Most certainly. I was not aware that I could use op(). Anyway, I believe that source code using the members names is much more readable than with op(). Why did you decide not to declare these members public? Well, maybe the main problem is that it seems impossible to declare a member accessible read-only in C++.