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

Function hInit

kernel/combinatorics/hutil.cc:31–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29STATIC_VAR scfmon hsecure= NULL;
30
31scfmon hInit(ideal S, ideal Q, int *Nexist)
32{
33 id_LmTest(S, currRing);
34 if (Q!=NULL) id_LmTest(Q, currRing);
35
36 hisModule = id_RankFreeModule(S, currRing);
37
38 if (hisModule < 0)
39 hisModule = 0;
40
41 int sl, ql, i, k = 0;
42 polyset si, qi, ss;
43 scfmon ex, ek;
44
45 if (S!=NULL)
46 {
47 si = S->m;
48 sl = IDELEMS(S);
49 }
50 else
51 {
52 si = NULL;
53 sl = 0;
54 }
55 if (Q!=NULL)
56 {
57 qi = Q->m;
58 ql = IDELEMS(Q);
59 }
60 else
61 {
62 qi = NULL;
63 ql = 0;
64 }
65 if ((sl + ql) == 0)
66 {
67 *Nexist = 0;
68 return NULL;
69 }
70 ss = si;
71 for (i = sl; i>0; i--)
72 {
73 if (*ss!=0)
74 k++;
75 ss++;
76 }
77 ss = qi;
78 for (i = ql; i>0; i--)
79 {
80 if (*ss!=0)
81 k++;
82 ss++;
83 }
84 *Nexist = k;
85 if (k==0)
86 return NULL;
87 ek = ex = (scfmon)omAlloc0(k * sizeof(scmon));
88 hsecure = (scfmon) omAlloc0(k * sizeof(scmon));

Callers 8

scIndIndsetFunction · 0.85
hSeriesFunction · 0.85
scDimIntFunction · 0.85
scIndIntvecFunction · 0.85
hDegreeFunction · 0.85
scMult0IntFunction · 0.85
scComputeHCFunction · 0.85
scKBaseFunction · 0.85

Calls 3

omAlloc0Function · 0.85
p_GetExpVFunction · 0.85
id_RankFreeModuleFunction · 0.50

Tested by

no test coverage detected