QQ multivariate factorization, new(?) errors

41 views
Skip to first unread message

Jori Mantysalo

unread,
Oct 7, 2013, 6:29:45 AM10/7/13
to sage-...@googlegroups.com
I just make a small test:

P.<a,b,c,d>=QQ[]
for i in range(1,100000):
p1=ZZ.random_element(1,5)*P.random_element()
p2=ZZ.random_element(1,5)*P.random_element()
p3=ZZ.random_element(1,5)*P.random_element()
p=p1*p2*p3
if p==0:
continue
print p
f=p.factor()
tulo=f.unit()*prod([f[i][0]^f[i][1] for i in range(0,len(f))])
if (p-tulo) <> 0:
print "Error!"

I got few floating point exceptions, but they seems to be already
reported: http://trac.sagemath.org/ticket/14658

However, I also found one new error:

16*a^3*b*c^2 - 144*a^2*b*c^3 + 112*a^2*b*c^2*d - 1008*a*b*c^3*d +
16*a^2*b*c*d^2 - 16*a^2*c^2*d^2 - 624*a*b*c^2*d^2 + 4320*b*c^3*d^2 -
48*a*b*c*d^3 - 112*a*c^2*d^3 + 432*b*c^2*d^3 - 16*a*c*d^4 + 480*c^2*d^4 +
48*c*d^5 + 16*a^3*b*c - 48*a^2*b^2*c + 16*a^3*c^2 - 144*a^2*b*c^2 +
432*a*b^2*c^2 + 16*a^2*c^3 + 160*a^2*b*c*d - 272*a*b^2*c*d + 112*a^2*c^2*d
- 1440*a*b*c^2*d + 2448*b^2*c^2*d + 112*a*c^3*d + 16*a^2*b*d^2 -
32*a*b^2*d^2 - 96*a*b*c*d^2 + 288*b^2*c*d^2 - 464*a*c^2*d^2 - 480*c^3*d^2
- 208*a*c*d^3 + 272*b*c*d^3 - 48*c^2*d^3 - 16*a*d^4 + 32*b*d^4 -
16*a^2*b^2 + 32*a*b^3 + 16*a^3*c - 48*a^2*b*c + 144*a*b^2*c - 288*b^3*c +
16*a^2*c^2 - 48*a*b*c^2 + 160*a^2*c*d - 272*a*b*c*d + 160*a*c^2*d -
272*b*c^2*d + 16*a^2*d^2 - 16*a*b*d^2 - 32*b^2*d^2 + 16*a*c*d^2 -
32*b*c*d^2 - 16*a^2*b + 32*a*b^2 - 16*a*b*c + 32*b^2*c

gives "RuntimeError: Segmentation fault". Should I report this as new bug
or as a comment to ticket 14658?

I tried to run this on loop and see how often errors happen. But then I
got

*** Error in `python': free(): invalid pointer: 0x0000000003b22330 ***
======= Backtrace: =========
/lib64/libc.so.6[0x332ba7d0e8]
/home/jm58660/sage-5.11/local/lib64/libstdc++.so.6(_ZdlPv+0x1f)[0x7f648d3aeebc]
/home/jm58660/sage-5.11/local/lib64/libstdc++.so.6(_ZdaPv+0x18)[0x7f648d3aeef4]
/home/jm58660/sage-5.11/local/lib/libsingular.so(_Z15sparseHeuristicRK13CanonicalFormRK4ListIS_ERPS3_S5_i+0x2d96)[0x7f64736d3096]
/home/jm58660/sage-5.11/local/lib/libsingular.so(_Z14multiFactorizeRK13CanonicalFormRK8Variable+0x2590)[0x7f647364f3e0]
/home/jm58660/sage-5.11/local/lib/libsingular.so(_Z12ratFactorizeRK13CanonicalFormRK8Variableb+0x256)[0x7f64735e6c06]
/home/jm58660/sage-5.11/local/lib/libsingular.so(_Z9factorizeRK13CanonicalFormb+0xf23)[0x7f64735e5373]
/home/jm58660/sage-5.11/local/lib/libsingular.so(_Z18singclap_factorizeP8spolyrecPP6intveci+0x643)[0x7f647345e413]
/home/jm58660/sage-5.11/local/lib/python2.7/site-packages/sage/rings/polynomial/multi_polynomial_libsingular.so(+0x24d9a)[0x7f6473c4cd9a]
/home/jm58660/sage-5.11/local/lib/python2.7/site-packages/sage/rings/polynomial/multi_polynomial_libsingular.so(+0x270e3)[0x7f6473c4f0e3]
. . .

Odds of getting errors are about 1 againsta 89.

--
Jori M�ntysalo

Burcin Erocal

unread,
Oct 7, 2013, 9:01:52 AM10/7/13
to sage-...@googlegroups.com
Hi Jori,
Can you check if these problems are still there with the Singular spkg
posted on #14333?

Cheers,
Burcin

Jori Mantysalo

unread,
Oct 7, 2013, 9:52:15 AM10/7/13
to sage-...@googlegroups.com
On Mon, 7 Oct 2013, Burcin Erocal wrote:

>> I got few floating point exceptions, but they seems to be already
>> reported: http://trac.sagemath.org/ticket/14658
>>
>> However, I also found one new error:

> Can you check if these problems are still there with the Singular spkg
> posted on #14333?

I compiled stand-alone Singular 3.1.6. It seems to work with at least 4
polynomial that didn't work with Singular 3.1.5.

As to #14333, I was not able to install singular-3-1-6.p0.spkg. What I got
was

### Singular spkg-install: build_libfac ###
. . .
g++ -O2 -g -fPIC -I./factor -I./charset -I. -I..
-I/home/jm58660/sage-5.11/local -I./factor
-I/home/jm58660/sage-5.11/local/include
-I/home/jm58660/sage-5.11/local/include -DHAVE_CONFIG_H -c
factor/tmpl_inst.cc -o OPTOBJ/tmpl_inst.o
factor/tmpl_inst.cc: In instantiation of 'std::ostream&
operator<<(std::ostream&, const Array<T>&) [with T = int; std::ostream =
std::basic_ostream<char>]':
factor/tmpl_inst.cc:75:64: required from here
factor/tmpl_inst.cc:75:64: error: explicit instantiation of 'std::ostream&
operator<<(std::ostream&, const Array<T>&) [with T = int; std::ostream =
std::basic_ostream<char>]' but no definition available [-fpermissive]
factor/tmpl_inst.cc: In instantiation of 'std::ostream&
operator<<(std::ostream&, const Array<T>&) [with T = int; std::ostream =
std::basic_ostream<char>]':
factor/tmpl_inst.cc:75:64: required from here
factor/tmpl_inst.cc:75:64: error: explicit instantiation of 'std::ostream&
operator<<(std::ostream&, const Array<T>&) [with T = int; std::ostream =
std::basic_ostream<char>]' but no definition available [-fpermissive]
factor/tmpl_inst.cc: In instantiation of 'std::ostream&
operator<<(std::ostream&, const Array<T>&) [with T = int; std::ostream =
std::basic_ostream<char>]':
factor/tmpl_inst.cc:75:64: required from here
factor/tmpl_inst.cc:75:64: error: explicit instantiation of 'std::ostream&
operator<<(std::ostream&, const Array<T>&) [with T = int; std::ostream =
std::basic_ostream<char>]' but no definition available [-fpermissive]
make: *** [OPTOBJ/tmpl_inst.o] Error 1
Error building libfac.

(Type Array<int> should have friend function to get cout<< working if I
read this correctly.)

--
Jori M�ntysalo
Reply all
Reply to author
Forward
0 new messages