Commit 904ccd27 authored by Hynek Baran's avatar Hynek Baran

`resolve/nonlin/combine/2` uses divideout@numer

parent 6e80529f
......@@ -117,7 +117,7 @@
</Input>
<Output>
<Text-field style="Line Printed Output" layout="Line Printed Output">Jets 5.92 test1 as of Oct 19, 2018 (2018-10-19 09:42:25)</Text-field>
<Text-field style="Line Printed Output" layout="Line Printed Output">Jets.newresolve v 0.2 as of Oct 2018 (2018-10-25 16:52:53)</Text-field>
<Text-field style="Line Printed Output" layout="Line Printed Output">Jets.newresolve v 0.2 as of Oct 2018 (2018-10-25 18:24:56)</Text-field>
</Output>
</Group>
<Group hide-output="false" labelreference="L936" drawlabel="true">
......
This diff is collapsed.
......@@ -26,14 +26,15 @@ printf("Jets.newresolve v 0.2 as of Oct 2018 (%s)\n",
if bs <> {} then print(op(map(proc(b) b = 0 end, bs)));
ERROR(`there are contradictory equations`)
fi;
#as := MaP(Simpl,as);
#if rt > 1 then report(lb,cat(`Simpl `, nops(as))) fi;
as := MaP(reduceprod,as) minus {0};
Report(2, cat(`reduceprod `, nops(as)));
A := MaP(`resolve/data/collect/detect`, convert(as,list), source=''procname'');
A := sizesort(A, a->a:-price);
AL, AN := selectremove(a->a:-kind <> 'nonlinear', A); # nonlin, lin
A1, A0 := selectremove(a->a:-solvable=true, AL); # resolvable, nonresolvable
A1S, A1H :=`resolve/simplehard`(A1);
......@@ -99,7 +100,7 @@ printf("Jets.newresolve v 0.2 as of Oct 2018 (%s)\n",
B := A1S;
fi
fi;
if assigned(`resolve/nonresrat`) and nops(A1)>0 and nops(A0)>0
and A1[1]:-price>A0[1]:-price*`resolve/nonresrat` then
ff := true;
......@@ -124,16 +125,16 @@ printf("Jets.newresolve v 0.2 as of Oct 2018 (%s)\n",
# sprintf("# LVars=%q\n", map(a->a:-Vars[1], B))));
ans := `resolve/lin/r`(convert(B, set), vl, ForceFail=ff);
# if no usable results, lets try to generate pseudoremainders of polynomial pairs
if ans = FAIL and nops(AN)>=2 then
Reportf(2, ["No solvable linear eqs found, trying to combine nonlinear eqs pairs into linear"]);
AE := `resolve/nonlin/combine`(AN);
Reportf(1, ["Combining %a nonlinear eqs given %a linear results", nops(AN), nops(AE)]);
Reportf(2, ["...witch properties are [price, size, VarL, LC]:\n%s",
StringTools:-Join(map(a -> sprintf("%q\n",[a:-price,a:-size,a:-Vars, a:-LC]), AE))]);
Reportf(0, ["Resolving %a combined eqs (generated by pseudodivision from %a nonlinear)...", nops(AE), nops(AN)]);
Reportf(1, ["Combining %a nonlinear eqs given %a results", nops(AN), nops(AE)]);
Reportf(2, ["...witch properties are [price, size, LM, Vars, LC]:\n%s",
StringTools:-Join(map(a -> sprintf("%q\n",[a:-price,a:-size,a:-LM, a:-Vars, a:-LC]), AE))]);
Reportf(0, ["Resolving %a combined eqs (generated by pseudodivision from %a nonlinear)...", nops(AE), nops(AN)]);
ans := `resolve/lin/r`(convert(AE, set), ForceFail=ff);
fi;
......@@ -191,14 +192,7 @@ end:
"FailIndex"=NULL
)
fi;
#a := `resolve/lin/reduce`(a, Vs);
#if not(frontend(ispoly, [a, linear, Vs[1], 'r', 'LC'])) then # nonlinear or non-polynomial case
#Cs, Ms, deg := coeffsV(a, Vs);
#LC := Cs[1]; LM := Ms[1]; ### bug, leading monimial can be at arbitrary position in the list
LC, LM, deg := coeffL(a,Vs);
LC, LM, deg := coeffL(collect(a, Vs, distributed),Vs);
if not(type(a, linear(Vs[1]))) then
# nonlinear or non-polynomial case
Report(4, ["NONLinear case", "LC"=LC, "LM"=LM, "deg"=deg, "Vs"=Vs]);
......@@ -357,7 +351,10 @@ end:
if F:-degree >= G:-degree then
Reportf(2, ["Combining polynomials in %a^%a*(%a), %a^%a*(%a)", (F:-LV), (F:-degree), (F:-LC), (G:-LV), (G:-degree), (G:-LC)]);
res := `resolve/nonlin/combine/2/tool`(F, G);
res := `resolve/nonlin/combine/2/tool`(F, G);
if res <> NULL then
res := divideout(numer(res));
fi;
else
res := NULL;
fi;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment