2 *skips all zeroes and double elements, searches also for units */
| 1394 | *skips all zeroes and double elements, searches also for units |
| 1395 | */ |
| 1396 | void id_Compactify(ideal id, const ring r) |
| 1397 | { |
| 1398 | int i; |
| 1399 | BOOLEAN b=FALSE; |
| 1400 | |
| 1401 | i = IDELEMS(id)-1; |
| 1402 | while ((! b) && (i>=0)) |
| 1403 | { |
| 1404 | b=p_IsUnit(id->m[i],r); |
| 1405 | i--; |
| 1406 | } |
| 1407 | if (b) |
| 1408 | { |
| 1409 | for(i=IDELEMS(id)-1;i>=0;i--) p_Delete(&id->m[i],r); |
| 1410 | id->m[0]=p_One(r); |
| 1411 | } |
| 1412 | else |
| 1413 | { |
| 1414 | id_DelMultiples(id,r); |
| 1415 | } |
| 1416 | idSkipZeroes(id); |
| 1417 | } |
| 1418 | |
| 1419 | /// returns the ideals of initial terms |
| 1420 | ideal id_Head(ideal h,const ring r) |
no test coverage detected