possible regression in solve

Bugs

Modérateur : xcasadmin

lukamar
Messages : 331
Inscription : ven. juin 30, 2017 9:55 am
Localisation : Zagreb, Croatia

possible regression in solve

Message par lukamar » dim. oct. 31, 2021 9:38 am

Hi Bernard,

"solve" in the source from Oct 30 fails on this command:

Code : Tout sélectionner

solve([3*x^2-3*z^2,3*y^2-3*z^2,x*y+y*z+x*z-x*y*z],[x,y,z])
The solution is [3,3,3]. I get the error message "Unable to find a separation form for the RUR computation". Maybe it's a regression due to the new functionality?

parisse
Messages : 5739
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: possible regression in solve

Message par parisse » mer. nov. 03, 2021 9:48 pm

I think I have a fix (separation should not be called if the minimal polynomial for one coordinate is not square free), diff below.
BTW, in graphe.h line 562 a const should be added to bool operator()(const std::pair<gen,tree_node*> &a,const std::pair<gen,tree_node*> &b) const {

Code : Tout sélectionner

diff cocoa.cc cocoa.cc~
14535,14555d14534
<     bool tryseparate=radical!=-1;
<     environment env;
<     env.modulo=p;
<     env.moduloon=true;
<     if (radical==0){
<       // additional check for non sqrfree minp,
<       // for solve([3*x^2-3*z^2,3*y^2-3*z^2,x*y+y*z+x*z-x*y*z],[x,y,z]);
<       for (int i=0;i<d;++i){
< 	if (minp[i].type!=_VECT)
< 	  continue;
< 	m=*minp[i]._VECTptr;
< 	if (m.empty())
< 	  continue;
< 	vecteur m1=derivative(m,&env);
< 	m1=gcd(m,m1,&env);
< 	if (m1.size()>1){
< 	  tryseparate=false;
< 	  break;
< 	}
<       }
<     }
14557c14536
<     if (tryseparate){
---
>     if (radical!=-1){
14590a14570,14572
>     environment env;
>     env.modulo=p;
>     env.moduloon=true;

lukamar
Messages : 331
Inscription : ven. juin 30, 2017 9:55 am
Localisation : Zagreb, Croatia

Re: possible regression in solve

Message par lukamar » dim. nov. 07, 2021 1:47 pm

Thanks!
I corrected graphe.h, const was missing in more than one instance.

lukamar
Messages : 331
Inscription : ven. juin 30, 2017 9:55 am
Localisation : Zagreb, Croatia

Re: possible regression in solve

Message par lukamar » dim. nov. 07, 2021 2:16 pm

A maybe related problem: solve now crashes with the following command:

Code : Tout sélectionner

solve([-4*y*x^2*z-4*y*z+4*y+3*x^4-2*x^3+2*x^2+4*x*z-2*x-1,-y*x+y+z*x-z,-2*y^2-4*y*x*z+x^3-x^2-x-2*z^2+1],[x,y,z])

parisse
Messages : 5739
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: possible regression in solve

Message par parisse » dim. nov. 07, 2021 6:22 pm

Indeed, now fixed in source.


Répondre