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

Function wInit

libpolys/polys/weight.cc:64–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62
63
64static void wInit(poly* s, int sl, int mons, int *A, const ring R)
65{
66 int n, a, i, j, *B, *C;
67 poly p, q;
68 int *pl;
69
70 B = A;
71 n = rVar(R);
72 a = (n + 1) * sizeof(int);
73 pl = (int *)omAlloc(a);
74 for (i = 0; i <= sl; i++)
75 {
76 p = s[i];
77 if (p!=NULL)
78 {
79 q = pNext(p);
80 if (q!=NULL)
81 {
82 C = B;
83 B++;
84 p_GetExpV(p, pl,R);
85 for (j = 0; j < n; j++)
86 {
87 *C = pl[j+1];
88 C += mons;
89 }
90 }
91 while (q!=NULL)
92 {
93 C = B;
94 B++;
95 p_GetExpV(q, pl,R);
96 for (j = 0; j < n; j++)
97 {
98 *C = pl[j+1];
99 C += mons;
100 }
101 pIter(q);
102 }
103 }
104 }
105 omFreeSize((ADDRESS)pl, a);
106}
107
108void wCall(poly* s, int sl, int *x, double wNsqr, const ring R)
109{

Callers 1

wCallFunction · 0.85

Calls 2

rVarFunction · 0.85
p_GetExpVFunction · 0.85

Tested by

no test coverage detected