Commit 226ebceb authored by Hynek Baran's avatar Hynek Baran

bugfix

all combining (linear+nonlinear) is done AFTER initial attempt of resolving input eqs
parent 2af15de3
......@@ -14,10 +14,10 @@ printf("Jets.newresolve v 0.3 as of Oct 2018 (%s)\n",
#`resolve/nonresrat` := 3;
`resolve/opts/combine` := {'nonlinear', 'linear'}:
`resolve/opts/postproc` := {'nonlinear', 'linear'}:
`resolve/1` := proc()
local as,bs,as1, as2, cs, ds, vl,i,ans, A, AL, AN, A1, A0, A0C, A0C0, A0C1, A1S, A1H, AE, APD, B, ff;
local as,bs,as1, as2, cs, ds, vl,i,ans, A, AL, AN, A1, A0, A1S, A1H, AE, APD, B, ff;
global `resolve/nonresrat`, `resolve/combine`;
Report(2, cat(`input `, nops([args])));
as := MaP(numer,{args}) minus {0};
......@@ -36,26 +36,11 @@ printf("Jets.newresolve v 0.3 as of Oct 2018 (%s)\n",
Report(2, cat(`reduceprod `, nops(as)));
A := MaP(`resolve/data/collect/detect`, convert(as,list), source=''procname'');
if not has(`resolve/opts/combine`, 'linear') then
A := sizesort(A, a->a:-price);
fi;
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
if has(`resolve/opts/combine`, 'linear') then
Reportf(2, ["Combining %a linear nonresolvable eqs...", nops(A0)]);
A0C := `resolve/nonlin/combine`(A0);
A0C1, A0C0 := selectremove(a->a:-solvable=true, A0C); # resolvable, nonresolvable
Reportf(0, ["Combined %a new linear eqs (%a resolvable) from %a linear nonresolvable eqs", nops(A0C), nops(A0C1), nops(A0)]);
# extend input sets by combined eqs (all are linear)
A := sizesort([op({op(A), op(A0C1), op(A0C0)})], a->a:-price); # all
AL := sizesort([op({op(AL), op(A0C1), op(A0C0)})], a->a:-price); # linear
A1 := sizesort([op({op(A1), op(A0C1)})], a->a:-price); # resolvable
A0 := sizesort([op({op(A0), op(A0C0)})], a->a:-price); # nonresolvable
fi;
A1S, A1H :=`resolve/simplehard`(A1);
Reportf(1, ["There are %a linear resolvable (%a simple and %a hard),"
......@@ -148,18 +133,13 @@ printf("Jets.newresolve v 0.3 as of Oct 2018 (%s)\n",
# sprintf("# prices=%q\n", map(a->a:-price, B)),
# sprintf("# sizes =%q\n", map(size, B)),
# 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 has(`resolve/opts/combine`, 'nonlinear') and ans = FAIL and nops(AN)>=2 then
if has(`resolve/opts/combine`, 'linear') then
Reportf(2, ["No solvable linear eqs found, trying to combine all eqs pairs into linear"]);
AE := `resolve/nonlin/combine`(A);
else
Reportf(2, ["No solvable linear eqs found, trying to combine nonlinear eqs pairs into linear"]);
AE := `resolve/nonlin/combine`(AN);
fi;
if has(`resolve/opts/postproc`, 'nonlinear') and ans = FAIL then
Reportf(2, ["No solvable eqs found, trying to combine all eqs pairs into linear"]);
AE := `resolve/nonlin/combine`(A);
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))]);
......
......@@ -2,7 +2,7 @@
<Worksheet>
<Version major="2015" minor="2"/>
<Label-Scheme value="2" prefix=""/>
<View-Properties presentation="false" autoexpanding_sections="true" UserProfileName="Maple Default Profile" NumericFormat-ApplyInteger="true" NumericFormat-ApplyRational="true" NumericFormat-ApplyExponent="false"><Zoom percentage="125"/>
<View-Properties presentation="false" autoexpanding_sections="true" UserProfileName="Maple Default Profile" NumericFormat-ApplyInteger="true" NumericFormat-ApplyRational="true" NumericFormat-ApplyExponent="false">
</View-Properties>
<MapleNet-Properties prettyprint="3" warnlevel="3" preplot="" helpbrowser="standard" contextmenusize="automatic" displayprecision="-1" echo="1" unitattributes="&quot;fontweight&quot; = &quot;bold&quot;" imaginaryunit="I" longdelim="true" elisiontermsthreshold="10000" elisiondigitsafter="100" elisiondigitsbefore="100" plotdevice="inline" errorbreak="1" plotoptions="" plotdriver="opengl" quiet="false" elisiontermsbefore="100" elisiontermsafter="100" screenwidth="120" indentamount="4" plotoutput="terminal" screenpixelheight="1200" rtablesize="10" useclientjvm="true" labelwidth="20" postplot="" typesetting="standard" ansi="false" elisiondigitsthreshold="10000" showassumed="1" errorcursor="false" labelling="true" screenheight="25" prompt="&gt; " verboseproc="1" latexwidth="8.0" ShowLabels="false"/>
<Styles>
......
This diff is collapsed.
This diff is collapsed.
......@@ -183,6 +183,14 @@ G := g2*pd(U,y)^2 + g1*pd(U,y) + g0*U ; H := h2*<Font opaque="true" background="
<Text-field style="2D Output" layout="Maple Output"><Equation executable="false" style="2D Output">STRDbGVhcmluZ35ub256ZXJvJ3MuRzYi</Equation></Text-field>
</Output>
</Group>
<Group labelreference="L227" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">Algebraic:-PseudoDivision(F,G,U);</Text-field>
</Input>
<Output>
<Text-field style="2D Output" layout="Maple Output"><Equation executable="false" style="2D Output" display="LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYrLUkjbW9HRiQ2LVEqJnVtaW51czA7RicvJSxtYXRodmFyaWFudEdRJ25vcm1hbEYnLyUmZmVuY2VHUSZmYWxzZUYnLyUqc2VwYXJhdG9yR0Y0LyUpc3RyZXRjaHlHRjQvJSpzeW1tZXRyaWNHRjQvJShsYXJnZW9wR0Y0LyUubW92YWJsZWxpbWl0c0dGNC8lJ2FjY2VudEdGNC8lJ2xzcGFjZUdRLDAuMjIyMjIyMmVtRicvJSdyc3BhY2VHRkMtRiM2KC1JJW1zdXBHRiQ2JS1JKG1mZW5jZWRHRiQ2JC1GIzYoLUkmbWZyYWN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</Output>
</Group>
<Group labelreference="L226" drawlabel="true" applyint="true" applyrational="true" applyexponent="false">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">resolve(F,G);</Text-field>
......
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