Changeset 45df3d0 in git


Ignore:
Timestamp:
Mar 28, 2011, 2:47:59 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '4a9821a93ffdc22a6696668bd4f6b8c9de3e6c5f')
Children:
2de414537b02c8a83e023a3ca0ed0ac73bf7164c
Parents:
f97705b0f28d859734876fd55a7115c409a8b5c8
Message:
idSectWithElim

git-svn-id: file:///usr/local/Singular/svn/trunk@14074 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/ideals.cc

    rf97705 r45df3d0  
    11561156}
    11571157
     1158ideal 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}
    11581224/*2
    11591225* h3 := h1 intersect h2
     
    11841250  if (length==0)
    11851251  {
    1186     length = 1;
     1252    if ((currQuotient==NULL)
     1253    && (currRing->OrdSgn==1)
     1254    && (!rIsPluralRing(currRing)))
     1255      return idSectWithElim(first,second);
     1256    else length = 1;
    11871257  }
    11881258  j = IDELEMS(first);
  • kernel/matpol.cc

    rf97705 r45df3d0  
    18601860        {
    18611861          if (div)
    1862             SM_DIV(q1, div);                               
     1862            SM_DIV(q1, div);
    18631863          q[j] = q1;
    18641864        }
     
    18731873          q1 = SM_MULT(a[j], piv, div);
    18741874          if (div)
    1875             SM_DIV(q1, div);                               
     1875            SM_DIV(q1, div);
    18761876          q[j] = q1;
    18771877        }
Note: See TracChangeset for help on using the changeset viewer.