Changeset 45df3d0 in git
- Timestamp:
- Mar 28, 2011, 2:47:59 PM (12 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 2de414537b02c8a83e023a3ca0ed0ac73bf7164c
- Parents:
- f97705b0f28d859734876fd55a7115c409a8b5c8
- Location:
- kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/ideals.cc
rf97705 r45df3d0 1156 1156 } 1157 1157 1158 ideal idSectWithElim (ideal h1,ideal h2) 1159 // does not destroy h1,h2 1160 { 1161 assume(!idIs0(h1)); 1162 assume(!idIs0(h2)); 1163 assume(IDELEMS(h1)<=IDELEMS(h2)); 1164 assume(idRankFreeModule(h1)==0); 1165 assume(idRankFreeModule(h2)==0); 1166 // add a new variable: 1167 int j; 1168 ring origRing=currRing; 1169 ring r=rCopy0(origRing); 1170 r->N++; 1171 r->block0[0]=1; 1172 r->block1[0]= r->N; 1173 omFree(r->order); 1174 r->order=(int*)omAlloc0(3*sizeof(int*)); 1175 r->order[0]=ringorder_dp; 1176 r->order[1]=ringorder_C; 1177 char **names=(char**)omAlloc0(rVar(r) * sizeof(char_ptr)); 1178 for (j=0;j<r->N-1;j++) names[j]=r->names[j]; 1179 names[r->N-1]=omStrDup("@"); 1180 omFree(r->names); 1181 r->names=names; 1182 rComplete(r,TRUE); 1183 // fetch h1, h2 1184 ideal h; 1185 h1=idrCopyR(h1,origRing,r); 1186 h2=idrCopyR(h2,origRing,r); 1187 // switch to temp. ring r 1188 rChangeCurrRing(r); 1189 // create 1-t, t 1190 poly omt=pOne(); 1191 pSetExp(omt,r->N,1); 1192 poly t=pCopy(omt); 1193 pSetm(omt); 1194 omt=pNeg(omt); 1195 omt=pAdd(omt,pOne()); 1196 // compute (1-t)*h1 1197 h1=(ideal)mpMultP((matrix)h1,omt); 1198 // compute t*h2 1199 h2=(ideal)mpMultP((matrix)h2,pCopy(t)); 1200 // (1-t)h1 + t*h2 1201 h=idInit(IDELEMS(h1)+IDELEMS(h2),1); 1202 int l; 1203 for (l=IDELEMS(h1)-1; l>=0; l--) 1204 { 1205 h->m[l] = h1->m[l]; h1->m[l]=NULL; 1206 } 1207 j=IDELEMS(h1); 1208 for (l=IDELEMS(h2)-1; l>=0; l--) 1209 { 1210 h->m[l+j] = h2->m[l]; h2->m[l]=NULL; 1211 } 1212 idDelete(&h1); 1213 idDelete(&h2); 1214 // eliminate t: 1215 1216 ideal res=idElimination(h,t); 1217 // cleanup 1218 idDelete(&h); 1219 res=idrMoveR(res,r,origRing); 1220 rChangeCurrRing(origRing); 1221 rKill(r); 1222 return res; 1223 } 1158 1224 /*2 1159 1225 * h3 := h1 intersect h2 … … 1184 1250 if (length==0) 1185 1251 { 1186 length = 1; 1252 if ((currQuotient==NULL) 1253 && (currRing->OrdSgn==1) 1254 && (!rIsPluralRing(currRing))) 1255 return idSectWithElim(first,second); 1256 else length = 1; 1187 1257 } 1188 1258 j = IDELEMS(first); -
kernel/matpol.cc
rf97705 r45df3d0 1860 1860 { 1861 1861 if (div) 1862 SM_DIV(q1, div); 1862 SM_DIV(q1, div); 1863 1863 q[j] = q1; 1864 1864 } … … 1873 1873 q1 = SM_MULT(a[j], piv, div); 1874 1874 if (div) 1875 SM_DIV(q1, div); 1875 SM_DIV(q1, div); 1876 1876 q[j] = q1; 1877 1877 }
Note: See TracChangeset
for help on using the changeset viewer.