Commit 15be3d6f authored by Hynek Baran's avatar Hynek Baran

combining of already reduced polynoms is prohibited by "ReducedBy" property

parent a3fed76f
......@@ -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.3 as of Oct 2018 (2018-10-29 16:56:35)</Text-field>
<Text-field style="Line Printed Output" layout="Line Printed Output">Jets.newresolve v 0.3 as of Oct 2018 (2018-10-30 11:35:23)</Text-field>
</Output>
</Group>
<Group hide-output="false" labelreference="L936" drawlabel="true">
......
This diff is collapsed.
......@@ -17,8 +17,7 @@ printf("Jets.newresolve v 0.3 as of Oct 2018 (%s)\n",
`resolve/opts/postproc` := {'nonlinear', 'linear'}:
`resolve/1` := proc()
local as,bs,as1, as2, cs, ds, vl,i,ans, A, AL, AN, A1, A0, A1S, A1H, AE, APD, B, ff;
global old, new, new1; ############################!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
local as,bs,as1, as2, cs, ds, vl,i,ans, A, AL, AN, A1, A0, A1S, A1H, AE, APD, B, ff, old, old1, new, new1, cstep;
global `resolve/nonresrat`, `resolve/combine`;
Report(2, cat(`input `, nops([args])));
as := MaP(numer,{args}) minus {0};
......@@ -133,16 +132,17 @@ printf("Jets.newresolve v 0.3 as of Oct 2018 (%s)\n",
ans := `resolve/lin/r`(convert(B, set), vl, ForceFail=ff);
if ans<>FAIL then
Reportf(0, ["Resolving %a (of %a input) eqs given %a results.", nops(B), nops(A), nops(ans)]);
Reportf(1, ["Resolving %a (of %a input) eqs given %a results.", nops(B), nops(A), nops(ans)]);
else
Reportf(0, ["Resolving %a (of %a input) eqs failed.", nops(B), nops(A)]);
Reportf(1, ["Resolving %a (of %a input) eqs failed.", nops(B), nops(A)]);
fi;
# if no usable results, lets try to generate pseudoremainders of polynomial pairs
if has(`resolve/opts/postproc`, 'nonlinear') and ans = FAIL then
old := convert(A,set);
Reportf(2, ["No solvable eqs found, trying to combine input %a eqs into linear by pseudodivision...", nops(old)]);
# try to combine all input eqs
Reportf(0, ["No solvable eqs found, trying to combine input %a eqs...", nops(old)]);
new := `resolve/nonlin/combine/1`(old);
new := new minus old;
Reportf(1, ["Combining %a eqs given %a new results", nops(old), nops(new)]);
......@@ -152,29 +152,35 @@ printf("Jets.newresolve v 0.3 as of Oct 2018 (%s)\n",
ans := `resolve/lin/r`(new, ForceFail=ff);
if ans<>FAIL then
Reportf(0, ["Resolving %a combined eqs given %a results.", nops(new), nops(ans)]);
Reportf(1, ["Resolving %a combined eqs given %a results.", nops(new), nops(ans)]);
else
Reportf(0, ["Resolving %a combined eqs failed.", nops(new)]);
Reportf(1, ["Resolving %a combined eqs failed.", nops(new)]);
fi;
while ans = FAIL and nops(new) > 0 do
print(ANS, ans);
print(OLD, nops(old), map(a -> collect(a:-expr, a:-LV, length*Vars), old));
print(NEW, nops(new), map(a -> collect(a:-expr, a:-LV, length*Vars), new));
# print(OLD, nops(old), map(a -> a:-expr, old));
# print(NEW, nops(new), map(a -> a:-expr, new));
Reportf(2, ["No solvable eqs found, trying to combine %a against %a eqs into linear by pseudodivision...", nops(old), nops(new)]);
cstep := 1; # first step already done above
while ans = FAIL and nops(new) > 0 do # combine old against combined (new)
cstep := cstep+1 ;
Reportf(1, ["No solvable eqs found, trying to combine %a against %a eqs (step %a)...", nops(old), nops(new), cstep]);
old1 := select(a -> a:-ReducedBy=false, old); # do not reduce already reduced
new1 := `resolve/nonlin/combine/2`(old, new);
new1 := `resolve/nonlin/combine/2`(old1, new);
new1 := new1 minus (old union new);
Reportf(1, ["Combining %a eqs given %a new results", nops(old), nops(new)]);
Reportf(2, ["...whitch properties are [price, size, LM, Vars, size(LC)]:\n%s",
StringTools:-Join(map(a -> sprintf("%q\n",[a:-price,a:-size,a:-LM, a:-Vars, size(a:-LC)]), [op(new)]))]);
Reportf(0, ["Combining %a (of %a) against %a eqs (step %a) given %a new results.", nops(old1), nops(old), nops(new), cstep, nops(new1)]);
if nops(new1)>0 then
Reportf(2, ["...whitch properties are [price, size, LM, Vars, size(LC)]:\n%s",
StringTools:-Join(map(a -> sprintf("%q\n",[a:-price,a:-size,a:-LM, a:-Vars, size(a:-LC)]), [op(new1)]))]);
ans := `resolve/lin/r`(new1, ForceFail=ff);
ans := `resolve/lin/r`(new1, ForceFail=ff);
Reportf(0, ["Resolving %a again combined eqs (generated by pseudodivision) given %a results.", nops(new), nops(ans)]);
if ans<>FAIL then
Reportf(1, ["Resolving %a combined eqs (step %a) given %a results.", nops(new1), cstep, nops(ans)]);
else
Reportf(1, ["Resolving %a combined eqs (step %a) failed.", nops(new1), cstep]);
fi;
fi;
old := old union new;
new := new1;
......@@ -232,7 +238,8 @@ end:
"size"=size(a),
"source"=source,
"solvable"=FAIL,
"FailIndex"=NULL
"FailIndex"=NULL,
"ReducedBy" = false
)
fi;
LC, LM, deg := coeffL(collect(a, Vs, distributed),Vs);
......@@ -254,7 +261,8 @@ end:
"price"=infinity,
"size"=size(a),
"source"=source,
"FailIndex"=NULL
"FailIndex"=NULL,
"ReducedBy" = false
)
else
# linear case
......@@ -283,7 +291,8 @@ end:
#'leadLinCoeffVars'=LCV
"solvable"=evalb(type(LC,nonzero)),
"rest"=r,
"FailIndex"=NULL
"FailIndex"=NULL,
"ReducedBy" = false
)
fi
end:
......@@ -295,7 +304,8 @@ end:
"LV" = G:-LV,
"source"=source,
"FailIndex"=NULL,
"FailParents" = [F,G]
"FailParents" = [F,G],
"ReducedBy" = false
);
end:
......@@ -426,6 +436,7 @@ end:
res := `resolve/nonlin/combine/pair/tool`(F, G);
if res <> NULL then
res := op(map(divideout@numer, {res}));
if res <> 0 then F:-ReducedBy := true; fi;
fi;
if nops(Vars(res)) > 0 then return res else return NULL fi; # omit unknownless expressions, to be error?
end:
......
......@@ -107,7 +107,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.3 as of Oct 2018 (2018-10-29 16:43:21)</Text-field>
<Text-field style="Line Printed Output" layout="Line Printed Output">Jets.newresolve v 0.3 as of Oct 2018 (2018-10-30 11:35:23)</Text-field>
</Output>
</Group>
<Group labelreference="L222" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
......@@ -126,7 +126,7 @@
<Text-field style="Line Printed Output" layout="Line Printed Output">`Reporting to terminal`</Text-field>
</Output>
<Output>
<Text-field style="2D Output" layout="Maple Output"><Equation executable="false" style="2D Output">NyovSSRydW5HNiIiIiEvSSNwZEdGJUYmL0kobm9uemVyb0dGJUYmL0kodW5rbm93bkdGJUYmL0kkcHV0R0YlRiYvSSdkZXJpdmVHRiVGJi9JI2NjR0YlRiYvSShyZXNvbHZlR0YlIiIi</Equation></Text-field>
<Text-field style="2D Output" layout="Maple Output"><Equation executable="false" style="2D Output">NyovSSRydW5HNiIiIiEvSSNwZEdGJUYmL0kobm9uemVyb0dGJUYmL0kodW5rbm93bkdGJUYmL0kkcHV0R0YlRiYvSSdkZXJpdmVHRiVGJi9JKHJlc29sdmVHRiUiIiIvSSNjY0dGJUYm</Equation></Text-field>
</Output>
</Group>
<Group labelreference="L223" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
......@@ -180,9 +180,7 @@ g2(),g1(),g0());</Text-field>
<Output>
<Text-field style="Line Printed Output" layout="Line Printed Output">RESOLVE: &lt;0, 41344&gt; `resolve/1`[0]: There are 0 linear resolvable (0 simple and 0 hard), 2 linear NONresolvable and 0 NONlinear eqs.
RESOLVE: &lt;0, 41344&gt; `resolve/1`[0]: Resolving 2 of 2 input eqs given 1 results
RESOLVE: &lt;0, 41344&gt; `resolve/1`[0]: Resolving 1 combined eqs (generated by pseudodivision from 2 eqs) given 1 results
RESOLVE: &lt;0, 41344&gt; `resolve/1`[0]: No solvable eqs found, trying to combine input 2 eqs...
[0] &lt;0&gt; 1. linear resolving failed in U</Text-field>
</Output>
......@@ -214,9 +212,9 @@ RESOLVE: &lt;0, 41344&gt; `resolve/1`[0]: Resolving 1 combined eqs (generated by
<Output>
<Text-field style="Line Printed Output" layout="Line Printed Output">RESOLVE: &lt;0, 41344&gt; `resolve/1`[0]: There are 0 linear resolvable (0 simple and 0 hard), 2 linear NONresolvable and 0 NONlinear eqs.
RESOLVE: &lt;0, 41344&gt; `resolve/1`[0]: Resolving 2 of 2 input eqs given 1 results
RESOLVE: &lt;0, 41344&gt; `resolve/1`[0]: No solvable eqs found, trying to combine input 2 eqs...
RESOLVE: &lt;0, 41344&gt; `resolve/1`[0]: Resolving 1 combined eqs (generated by pseudodivision from 2 eqs) given 1 results
RESOLVE: &lt;0, 41344&gt; `resolve/1`[0]: Combining 1 (of 2) against 1 eqs (step 2) given 0 new results.
[0] &lt;0&gt; 1. linear resolving failed in V</Text-field>
</Output>
......@@ -233,7 +231,7 @@ RESOLVE: &lt;0, 41344&gt; `resolve/1`[0]: Resolving 1 combined eqs (generated by
<Text-field style="Line Printed Output" layout="Line Printed Output">[0] &lt;0&gt; 3. linear resolving failed in U</Text-field>
</Output>
<Output>
<Text-field style="2D Output" layout="Maple Output"><Equation executable="false" style="2D Output" display="LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYoLUYjNiYtSShtZmVuY2VkR0YkNiQtRiM2Ji1GIzYmLUkjbWlHRiQ2JVEjZnVGJy8lJ2l0YWxpY0dRJXRydWVGJy8lLG1hdGh2YXJpYW50R1EnaXRhbGljRictSSNtb0dGJDYtUTEmSW52aXNpYmxlVGltZXM7RicvRjxRJ25vcm1hbEYnLyUmZmVuY2VHUSZmYWxzZUYnLyUqc2VwYXJhdG9yR0ZGLyUpc3RyZXRjaHlHRkYvJSpzeW1tZXRyaWNHRkYvJShsYXJnZW9wR0ZGL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SdhY2NlbnRHRjsvJSdsc3BhY2VHUSwwLjIyMjIyMjJlbUYnLyUncnNwYWNlR0ZKLUYjNiYtSSNtaUdGJDYlUSNmdUYnLyUnaXRhbGljR1EldHJ1ZUYnL0Y3USdpdGFsaWNGJy1GMzYtUTEmSW52aXNpYmxlVGltZXM7RidGNkY5RjxGPkZARkJGREZGL0ZJUSYwLjBlbUYnL0ZMRmZuLUZQNiVRI2d2RidGU0ZWRjYtRjM2LVEiK0YnRjZGOUY8Rj5GQEZCRkRGRkZIRkstRiM2Ji1GUDYlUSNmdkYnRlNGVkZYLUZQNiVRI2d1RidGU0ZWRjZGNkY2RlgtRlA2JVEiVUYnRlNGVkY2LUYzNi1RIj1GJ0Y2RjlGPEY+RkBGQkZERkYvRklRLDAuMjc3Nzc3OGVtRicvRkxGXXAtRiM2Ji1GIzYmLUZQNiVRI2YwRidGU0ZWRlhGaG5GNi1GMzYtUSgmbWludXM7RidGNkY5RjxGPkZARkJGREZGRkhGSy1GIzYmRmBvRlgtRlA2JVEjZzBGJ0ZTRlZGNkY2LyUrZm9yZWdyb3VuZEdRKFswLDAsMF1GJy8lKXJlYWRvbmx5R0Y7RjY=">LyomLCYqJkkjZnVHNiIiIiJJI2d2R0YnRighIiIqJkkjZnZHRidGKEkjZ3VHRidGKEYoRihJIlVHRidGKCwmKiZJI2YwR0YnRihGKUYoRigqJkYsRihJI2cwR0YnRihGKg==</Equation></Text-field>
</Output>
<Output>
<Text-field style="2D Output" layout="Maple Output"><Equation executable="false" style="2D Output">SSVGQUlMRyUqcHJvdGVjdGVkRw==</Equation></Text-field>
......@@ -262,7 +260,8 @@ RESOLVE: &lt;0, 41344&gt; `resolve/1`[0]: Resolving 1 combined eqs (generated by
</Group>
<Group labelreference="L182" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">#F := (pd(f2,u_x)*u_x+u*sin(x)*pd(p,x))*U^2 + f1*U + f0; F := f2*U^2 + f1*U + f0;
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">#F := (pd(f2,u_x)*u_x+u*sin(x)*pd(p,x))*U^2 + f1*U + f0;
F := f2*U^2 + f1*U + f0;
G := g2*U^2 + g1*U + g0;</Text-field>
</Input>
<Output>
......@@ -279,9 +278,9 @@ G := g2*U^2 + g1*U + g0;</Text-field>
<Output>
<Text-field style="Line Printed Output" layout="Line Printed Output">RESOLVE: &lt;0, 41344&gt; `resolve/1`[0]: There are 0 linear resolvable (0 simple and 0 hard), 0 linear NONresolvable and 2 NONlinear eqs.
RESOLVE: &lt;0, 41344&gt; `resolve/1`[0]: Resolving 2 of 2 input eqs given 1 results
RESOLVE: &lt;0, 41344&gt; `resolve/1`[0]: No solvable eqs found, trying to combine input 2 eqs...
RESOLVE: &lt;0, 41344&gt; `resolve/1`[0]: Resolving 1 combined eqs (generated by pseudodivision from 2 eqs) given 1 results
RESOLVE: &lt;0, 43396&gt; `resolve/1`[0]: Combining 1 (of 2) against 1 eqs (step 2) given 0 new results.
[0] &lt;0&gt; 1. nonlinear resolving failed in U^2</Text-field>
</Output>
......@@ -346,11 +345,11 @@ RESOLVE: &lt;0, 41344&gt; `resolve/1`[0]: Resolving 1 combined eqs (generated by
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">resolve(F,G);</Text-field>
</Input>
<Output>
<Text-field style="Line Printed Output" layout="Line Printed Output">RESOLVE: &lt;0, 41344&gt; `resolve/1`[0]: There are 0 linear resolvable (0 simple and 0 hard), 0 linear NONresolvable and 2 NONlinear eqs.
<Text-field style="Line Printed Output" layout="Line Printed Output">RESOLVE: &lt;0, 43396&gt; `resolve/1`[0]: There are 0 linear resolvable (0 simple and 0 hard), 0 linear NONresolvable and 2 NONlinear eqs.
RESOLVE: &lt;0, 41344&gt; `resolve/1`[0]: Resolving 2 of 2 input eqs given 1 results
RESOLVE: &lt;0, 43396&gt; `resolve/1`[0]: No solvable eqs found, trying to combine input 2 eqs...
RESOLVE: &lt;0, 41344&gt; `resolve/1`[0]: Resolving 1 combined eqs (generated by pseudodivision from 2 eqs) given 1 results
RESOLVE: &lt;0, 43396&gt; `resolve/1`[0]: Combining 1 (of 2) against 1 eqs (step 2) given 0 new results.
[0] &lt;0&gt; 1. nonlinear resolving failed in U^2</Text-field>
</Output>
......@@ -415,11 +414,9 @@ RESOLVE: &lt;0, 41344&gt; `resolve/1`[0]: Resolving 1 combined eqs (generated by
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">resolve(F,G);</Text-field>
</Input>
<Output>
<Text-field style="Line Printed Output" layout="Line Printed Output">RESOLVE: &lt;0, 41344&gt; `resolve/1`[0]: There are 0 linear resolvable (0 simple and 0 hard), 1 linear NONresolvable and 1 NONlinear eqs.
RESOLVE: &lt;0, 41344&gt; `resolve/1`[0]: Resolving 2 of 2 input eqs given 1 results
<Text-field style="Line Printed Output" layout="Line Printed Output">RESOLVE: &lt;0, 43396&gt; `resolve/1`[0]: There are 0 linear resolvable (0 simple and 0 hard), 1 linear NONresolvable and 1 NONlinear eqs.
RESOLVE: &lt;0, 41344&gt; `resolve/1`[0]: Resolving 1 combined eqs (generated by pseudodivision from 2 eqs) given 1 results
RESOLVE: &lt;0, 43396&gt; `resolve/1`[0]: No solvable eqs found, trying to combine input 2 eqs...
[0] &lt;0&gt; 1. linear resolving failed in U</Text-field>
</Output>
......
This diff is collapsed.
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