MCPcopy Create free account
hub / github.com/Singular/Singular / myCompress

Function myCompress

factory/cfModResultant.cc:45–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43
44//TODO arrange by bound= deg (F,xlevel)*deg (G,i)+deg (G,xlevel)*deg (F, i)
45static inline
46void myCompress (const CanonicalForm& F, const CanonicalForm& G, CFMap & M,
47 CFMap & N, const Variable& x)
48{
49 int n= tmax (F.level(), G.level());
50 int * degsf= NEW_ARRAY(int,n + 1);
51 int * degsg= NEW_ARRAY(int,n + 1);
52
53 for (int i = 0; i <= n; i++)
54 degsf[i]= degsg[i]= 0;
55
56 degsf= degrees (F, degsf);
57 degsg= degrees (G, degsg);
58
59 int both_non_zero= 0;
60 int f_zero= 0;
61 int g_zero= 0;
62 int both_zero= 0;
63 int degsfx, degsgx;
64 int Flevel=F.level();
65 int Glevel=G.level();
66
67 if (x.level() != 1)
68 {
69 int xlevel= x.level();
70
71 for (int i= 1; i <= n; i++)
72 {
73 if (degsf[i] != 0 && degsg[i] != 0)
74 {
75 both_non_zero++;
76 continue;
77 }
78 if (degsf[i] == 0 && degsg[i] != 0 && i <= Glevel)
79 {
80 f_zero++;
81 continue;
82 }
83 if (degsg[i] == 0 && degsf[i] && i <= Flevel)
84 {
85 g_zero++;
86 continue;
87 }
88 }
89
90 M.newpair (Variable (xlevel), Variable (1));
91 N.newpair (Variable (1), Variable (xlevel));
92 degsfx= degsf [xlevel];
93 degsgx= degsg [xlevel];
94 degsf [xlevel]= 0;
95 degsg [xlevel]= 0;
96 if ((getNumVars (F) == 2 && getNumVars (G) == 1) ||
97 (getNumVars (G) == 2 && getNumVars (F) == 1) ||
98 (getNumVars (F) == 2 && getNumVars (F) == getNumVars (G)
99 && getVars (F) == getVars (G)))
100 {
101 int pos= 2;
102 for (int i= 1; i <= n; i++)

Callers 1

resultantFpFunction · 0.70

Calls 7

tmaxFunction · 0.85
degreesFunction · 0.85
VariableFunction · 0.85
getNumVarsFunction · 0.85
getVarsFunction · 0.85
newpairMethod · 0.80
levelMethod · 0.45

Tested by

no test coverage detected