insert p into I on position pos
| 848 | |
| 849 | /// insert p into I on position pos |
| 850 | BOOLEAN idInsertPolyOnPos (ideal I, poly p,int pos) |
| 851 | { |
| 852 | if (p==NULL) return FALSE; |
| 853 | assume (I != NULL); |
| 854 | |
| 855 | int j = IDELEMS(I) - 1; |
| 856 | |
| 857 | while ((j >= 0) && (I->m[j] == NULL)) j--; |
| 858 | j++; |
| 859 | if (j==IDELEMS(I)) |
| 860 | { |
| 861 | pEnlargeSet(&(I->m),IDELEMS(I),IDELEMS(I)+1); |
| 862 | IDELEMS(I)+=1; |
| 863 | } |
| 864 | for(j = IDELEMS(I)-1;j>pos;j--) |
| 865 | I->m[j] = I->m[j-1]; |
| 866 | I->m[pos]=p; |
| 867 | return TRUE; |
| 868 | } |
| 869 | |
| 870 | |
| 871 | /*! insert h2 into h1 depending on the two boolean parameters: |