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

Function idInsertPolyOnPos

libpolys/polys/simpleideals.cc:850–868  ·  view source on GitHub ↗

insert p into I on position pos

Source from the content-addressed store, hash-verified

848
849/// insert p into I on position pos
850BOOLEAN 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:

Callers 1

sbaFunction · 0.85

Calls 1

pEnlargeSetFunction · 0.85

Tested by

no test coverage detected