1 bug report & poly. arithmetic with GiNaC

Parisse Bernard parisse at mozart.ujf-grenoble.fr
Mon Jul 31 09:39:49 CEST 2000


Hello,

  First I have a bug report:
inifcns.cpp, function Order_eval, l.382,
O(c)=O(1) is not true if c=0 hence the code slice should be

...
        if (is_ex_exactly_of_type(x, numeric)) {

                // O(c)=O(1) BUG! except if c=0, O(0)=0
          if (x==0)
            return(x);
          else
            return Order(_ex1()).hold();

        } else if (is_ex_exactly_of_type(x, mul)) {
...

  I am currently working on an implementation on polynomial arithmetic
using tensors to represent multivariate polynomials instead of ex, in
order to be more efficient. If people are interested, they can get
http://perso.wanadoo.fr/bernard.parisse/ginac.tgz
  The current version implements GCD (gcdheu and sub-resultant
algorithm)
as well as extended GCD. Simplification might be much faster using
test1.cc than the built-in normal function of GiNaC, for example if you
try
test1.cc on input like
1/x+1/(x-1)+1/(x-2)+...+1/(x-10)
  The archive should be untarred in the GiNaC-0.6.3 directory, it
contains 
3 modified GiNaC 0.6.3 files:
inifcns.cpp (bug above fixed)
power.h (members basis and exponent declared public to be used by
qnormal.cc)
expairseq.h (member epvector declared public).
  The other files are
index.h/index.cc: index class to represent the powers of the variables 
in a monomial
tensor.h: template class for multivariate polynomials of a given field
qnormal.h/qnormal.cc: instantiation of tensor.h with numeric coeff
test1.cc: test the simplification function
test2.cc: instantiation and test of the extended GCD algorithm.
  Each file can be compiled by the compile command inside emacs.

Best regards,
Bernard Parisse, 
Institut Fourier, 100 rue des maths, 
Universite de Grenoble I, F-38402 St Martin d'Hères



More information about the GiNaC-devel mailing list