collect problem

Ben Sapp bsapp at lanl.gov
Sat Oct 14 01:24:35 CEST 2000


Hi,  

I have program that crashes when it uses the collect function of the ex
class.  The strange error I receive is:

Not a 32-bit integer: -9223372028264841216

I am able to print both the expression and the symbol I am going to use
for the collect call before hand and all seems fine.    I archived the
symbol and expression just before I knew it would crash and I can look
at the function with viewgar.  However if I make a program that uses
collect on the expression I get the same strange error and the program
exits.    Is this a bug in GiNaC?  Is it a bug in my software?   What
could be causing this?   How can I fix it?   

I have attached the archive file and the source to the program that
reads the archive file.   I did not give the source to the software that
originally produced it because it is a function that is dynamically
linked with another program.(GNU Octave)  

In case my system configuration is important:
[ben at pcben Linux]$ ginac-config --version 
0.6.4
[ben at pcben Linux]$ g++ -v       
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)
[ben at pcben Linux]$ uname -a 
Linux pcben 2.2.12-20 #1 Mon Sep 27 10:40:35 EDT 1999 i686 unknown

Thanks for any insight.     

-- 
Ben Sapp                         Los Alamos National Laboratory
email: <mailto:bsapp at lanl.gov>   Phone: (505)667-3277
Fax:   (505)665-7920             URL:   http://www.neutrino.lanl.gov/
--
-------------- next part --------------
GARC class symbol name x The symbol mul add rest numeric number 1 coeff R-1 11529215046068469760 -61 overall_coeff power basis R1 9223372036854775808 -62 exponent R1 13835058055282163712 -62 The expression  
J
J;[kJ{<J;[k;[;	[k
-------------- next part --------------
#include <ginac/ginac.h>
#include <iostream>
#include <fstream>
using namespace GiNaC;

int main()
{
  archive a;
  ifstream in("foobar.gar");
  in >> a;
  symbol x("x");
  lst syms(x);
  ex expr = a.unarchive_ex(syms,"The expression");
  cout << "expr = " << expr << endl;
  cout << expr.collect(x);
  return(0);
}



More information about the GiNaC-list mailing list