insert h2 into h1 (if h2 is not the zero polynomial) return TRUE iff h2 was indeed inserted
| 829 | /// insert h2 into h1 (if h2 is not the zero polynomial) |
| 830 | /// return TRUE iff h2 was indeed inserted |
| 831 | BOOLEAN idInsertPoly (ideal h1, poly h2) |
| 832 | { |
| 833 | if (h2==NULL) return FALSE; |
| 834 | assume (h1 != NULL); |
| 835 | |
| 836 | int j = IDELEMS(h1) - 1; |
| 837 | |
| 838 | while ((j >= 0) && (h1->m[j] == NULL)) j--; |
| 839 | j++; |
| 840 | if (j==IDELEMS(h1)) |
| 841 | { |
| 842 | pEnlargeSet(&(h1->m),IDELEMS(h1),16); |
| 843 | IDELEMS(h1)+=16; |
| 844 | } |
| 845 | h1->m[j]=h2; |
| 846 | return TRUE; |
| 847 | } |
| 848 | |
| 849 | /// insert p into I on position pos |
| 850 | BOOLEAN idInsertPolyOnPos (ideal I, poly p,int pos) |
no test coverage detected