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

Function p_String0

libpolys/polys/polys0.cc:223–318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221
222
223void p_String0(poly p, ring lmRing, ring tailRing)
224{
225 if (p == NULL)
226 {
227 StringAppendS("0");
228 return;
229 }
230 p_Normalize(p,lmRing);
231 if ((n_GetChar(lmRing->cf) == 0)
232 && (nCoeff_is_transExt(lmRing->cf)))
233 p_Normalize(p,lmRing); /* Manual/absfact.tst */
234#ifdef HAVE_SHIFTBBA
235 if(lmRing->isLPring)
236 {
237 if ((p_GetComp(p, lmRing) == 0) || (!lmRing->VectorOut))
238 {
239 writemonLP(p,0, lmRing);
240 p = pNext(p);
241 while (p!=NULL)
242 {
243 assume((p->coef==NULL)||(!n_IsZero(p->coef,tailRing->cf)));
244 if ((p->coef==NULL)||n_GreaterZero(p->coef,tailRing->cf))
245 StringAppendS("+");
246 writemonLP(p,0, tailRing);
247 p = pNext(p);
248 }
249 return;
250 }
251 }
252 else
253#endif
254 {
255 if ((p_GetComp(p, lmRing) == 0) || (!lmRing->VectorOut))
256 {
257 writemon(p,0, lmRing);
258 p = pNext(p);
259 while (p!=NULL)
260 {
261 assume((p->coef==NULL)||(!n_IsZero(p->coef,tailRing->cf)));
262 if ((p->coef==NULL)||n_GreaterZero(p->coef,tailRing->cf))
263 StringAppendS("+");
264 writemon(p,0, tailRing);
265 p = pNext(p);
266 }
267 return;
268 }
269 }
270
271 long k = 1;
272 StringAppendS("[");
273#ifdef HAVE_SHIFTBBA
274 if(lmRing->isLPring)
275 {
276 loop
277 {
278 while (k < p_GetComp(p,lmRing))
279 {
280 StringAppendS("0,");

Callers 5

p_String0ShortFunction · 0.70
p_String0LongFunction · 0.70
p_StringFunction · 0.70
iiStringMatrixFunction · 0.70
pString0Function · 0.50

Calls 8

StringAppendSFunction · 0.85
p_NormalizeFunction · 0.85
n_GetCharFunction · 0.85
nCoeff_is_transExtFunction · 0.85
writemonLPFunction · 0.85
n_IsZeroFunction · 0.85
n_GreaterZeroFunction · 0.85
writemonFunction · 0.85

Tested by

no test coverage detected