Commit ae550865 authored by Hynek Baran's avatar Hynek Baran

`resolve/fails/collect` argument is record

`resolve/nonlin/combine` works properly using `resolve/nonlin/combine/2/tool` := `resolve/nonlin/combine/2/rem`: on quadratic polynomials (?)
parent 1ce0461c
......@@ -380,7 +380,7 @@ end:
return res;
end:
`resolve/nonlin/combine/2/tool` := `resolve/nonlin/combine/2/pseudorem`:
`resolve/nonlin/combine/2/tool` := `resolve/nonlin/combine/2/rem`:
`resolve/nonlin/combine/2/pseudorem` := proc (f, g, LCf, LCg, df::integer, dg::integer, LV, Vs::list, $)
description "Remainder of (appropriate multiple of f) and (g) to avoid div by 0";
......@@ -410,7 +410,8 @@ end:
#`resolve/fails/collect`('remainder', 'procname', res, LV, Vs, LCg, [df, dg]);
#BUG: musíme použít
resdata := `resolve/data/collect` (res, source='procname');
resdata:-divcoeff := LCg;
#resdata:-divcoeff := LCg;
lprint(resdata);
`resolve/fails/collect`('remainder', resdata); ############# !!!!!!!!!!!
return NULL;
fi;
......@@ -494,9 +495,7 @@ end:
if ans = {} then
map(proc(a)
local LC := lcoeff(a, LVar(a)); ### je to ok??????
`resolve/fails/collect`( `if`(type(a, linear(LVar(a))) or Vars(a)={}, 'linear', 'nonlinear'),
'procname', a, LVar(a), VarL(a), LC, degree(a, LVar(a)), 'solvable'=type(LC, 'nonzero'))
`resolve/fails/collect`('linear', `resolve/data/collect`(a, source='`resolve/lin/r`'));
end,
map2(op, 1, rs) union aux);
###`resolve/fails/print`();
......@@ -664,7 +663,7 @@ end:
### resolve failure table
`resolve/fails/table` := `resolve/fails/clear`(): # global
`resolve/fails/clear`(): # global
`resolve/fails/table/counter` := NewIntSeq(): # NewIntSeq must be defined BEFORE this line
......@@ -674,38 +673,23 @@ end:
`resolve/fails/table/counter`('set'=0);
end:
`resolve/fails/collect` := ### TODO: předělat ať žere record (using r ... end; ?)
overload([
proc(kind::symbol, r::record) option overload(callseq_only);
`resolve/fails/collect`(kind, r:-source, r:-expr, r:-LV, r:-Vars, r:-LC, r:-degree, 'solvable'=r:-solvable);
end,
proc(kind::symbol, source::uneval, expr, LV, Vs::list, LC, deg, {solvable::truefalse:=NULL}, $)
`resolve/fails/collect` := proc(kind::symbol, r::record, $)
global RESOLVE, `resolve/fails/table`, `resolve/fails/table/counter`;
local i ;
i := `resolve/fails/table/counter`();
Report(5, ["collecting", i, [args]]);
# backward compatibility
if kind='linear' or kind ='remainder' then
RESOLVE := [op(RESOLVE), [LC, LV, -(expr-LC*LV)]]
elif kind='nonlinear' then
RESOLVE := [op(RESOLVE), [expr, LV]]
if r:-kind='linear' or r:-kind ='remainder' then
RESOLVE := [op(RESOLVE), [r:-LC, r:-LV, r:-rest]]
elif r:-kind='nonlinear' then
RESOLVE := [op(RESOLVE), [r:-expr, r:-LV]]
else
error "unknown kind %1", kind;
error "unknown kind %1", r:-kind;
fi;
# central fail storage
`resolve/fails/table`[i] := table([
':-kind' = kind,
':-source' = 'source',
':-expr' = expr,
':-LV' = LV,
':-LM' = LV^deg,
':-deg' = deg,
':-LC' = LC,
':-Vs' = Vs,
':-solvable' = solvable]);
end
]):
`resolve/fails/table`[i] := r;
end:
`resolve/fails/print/1` := proc(i)
global `resolve/fails/table`;
local T, kind, tail, slv;
......
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