Changeset ab453da in git


Ignore:
Timestamp:
Oct 1, 2010, 4:54:27 PM (14 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b21a664aa22dc6e196223af8a74ad4885e83547c')
Children:
f20cf709bf3a6482f047b88775316527b71c8fdb
Parents:
e6651bbb0a61329057145fd896929682117e9455
Message:
smChangeRing via rCopy0

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

Legend:

Unmodified
Added
Removed
  • kernel/ideals.cc

    re6651bb rab453da  
    28472847  ideal result,h;
    28482848  ring origR;
    2849   sip_sring tmpR;
     2849  ring tmpR;
    28502850  long bound;
    28512851
     
    28582858  bound = smExpBound(h,c,r,ar);
    28592859  idDelete(&h);
    2860   smRingChange(&origR,tmpR,bound);
     2860  tmpR=smRingChange(&origR,bound);
    28612861  b = mpNew(r,c);
    28622862  for (i=r*c-1;i>=0;i--)
     
    28822882  idSkipZeroes(result);
    28832883  rChangeCurrRing(origR);
    2884   result = idrMoveR(result,&tmpR);
    2885   smRingClean(origR,tmpR);
     2884  result = idrMoveR(result,tmpR);
     2885  smKillModifiedRing(tmpR);
    28862886  idTest(result);
    28872887  return result;
  • kernel/sparsmat.cc

    re6651bb rab453da  
    245245
    246246/* ----------------- ops with rings ------------------ */
    247 void smRingChange(ring *origR, sip_sring &tmpR, long bound)
     247ring smRingChange(ring *origR, long bound)
    248248{
    249249  *origR =currRing;
    250   ring tt=rCopy0(currRing,FALSE,FALSE);
    251   tmpR=*tt;
     250  ring tmpR=rCopy0(currRing,FALSE,FALSE);
    252251  int *ord=(int*)omAlloc0(3*sizeof(int));
    253252  int *block0=(int*)omAlloc(3*sizeof(int));
     
    255254  ord[0]=ringorder_c;
    256255  ord[1]=ringorder_dp;
    257   tmpR.order=ord;
    258   tmpR.OrdSgn=1;
     256  tmpR->order=ord;
     257  tmpR->OrdSgn=1;
    259258  block0[1]=1;
    260   tmpR.block0=block0;
    261   block1[1]=tmpR.N;
    262   tmpR.block1=block1;
    263   tmpR.bitmask = 2*bound;
     259  tmpR->block0=block0;
     260  block1[1]=tmpR->N;
     261  tmpR->block1=block1;
     262  tmpR->bitmask = 2*bound;
     263  tmpR->wvhdl = (int **)omAlloc0((3) * sizeof(int_ptr));
    264264
    265265// ???
    266 //  if (tmpR.bitmask > currRing->bitmask) tmpR.bitmask = currRing->bitmask;
    267 
    268   rComplete(&tmpR,1);
     266//  if (tmpR->bitmask > currRing->bitmask) tmpR->bitmask = currRing->bitmask;
     267
     268  rComplete(tmpR,1);
    269269  if ((*origR)->qideal!=NULL)
    270270  {
    271     tmpR.qideal= idrCopyR_NoSort((*origR)->qideal, (*origR), &tmpR);
    272   }
    273   rChangeCurrRing(&tmpR);
     271    tmpR->qideal= idrCopyR_NoSort((*origR)->qideal, (*origR), tmpR);
     272  }
     273  rChangeCurrRing(tmpR);
    274274  if (TEST_OPT_PROT)
    275     Print("[%ld:%d]", (long) tmpR.bitmask, tmpR.ExpL_Size);
    276 }
    277 
    278 void smRingClean(ring origR, ip_sring &tmpR)
    279 {
    280   if (tmpR.qideal!=NULL) id_Delete(&(tmpR.qideal),&tmpR);
    281   rUnComplete(&tmpR);
    282   omFreeSize((ADDRESS)tmpR.order,3*sizeof(int));
    283   omFreeSize((ADDRESS)tmpR.block0,3*sizeof(int));
    284   omFreeSize((ADDRESS)tmpR.block1,3*sizeof(int));
     275    Print("[%ld:%d]", (long) tmpR->bitmask, tmpR->ExpL_Size);
     276  return tmpR;
     277}
     278
     279void smKillModifiedRing(ring r)
     280{
     281  if (r->qideal!=NULL) id_Delete(&(r->qideal),r);
     282  rKillModifiedRing(r);
    285283}
    286284
     
    360358  poly res;
    361359  ring origR;
    362   sip_sring tmpR;
     360  ring tmpR;
    363361  sparse_mat *det;
    364362  ideal II;
    365363
    366   smRingChange(&origR,tmpR,bound);
     364  tmpR=smRingChange(&origR,bound);
    367365  II = idrCopyR(I, origR);
    368366  diag = smCleardenom(II);
     
    373371    delete det;
    374372    rChangeCurrRing(origR);
    375     smRingClean(origR,tmpR);
     373    smKillModifiedRing(tmpR);
    376374    return NULL;
    377375  }
     
    380378  delete det;
    381379  rChangeCurrRing(origR);
    382   res = prMoveR(res, &tmpR);
    383   smRingClean(origR,tmpR);
     380  res = prMoveR(res, tmpR);
     381  smKillModifiedRing(tmpR);
    384382  if (nEqual(diag,h) == FALSE)
    385383  {
     
    398396  long bound;
    399397  ring origR;
    400   sip_sring tmpR;
     398  ring tmpR;
    401399  sparse_mat *bareiss;
    402400
     
    407405  if (t>s) t=s;
    408406  bound=2*smExpBound(I,c,r,t);
    409   smRingChange(&origR,tmpR,bound);
     407  tmpR=smRingChange(&origR,bound);
    410408  ideal II = idrCopyR(I, origR);
    411409  bareiss = new sparse_mat(II);
     
    425423    delete bareiss;
    426424    rChangeCurrRing(origR);
    427     II = idrMoveR(II,&tmpR);
    428   }
    429   smRingClean(origR,tmpR);
     425    II = idrMoveR(II,tmpR);
     426  }
     427  smKillModifiedRing(tmpR);
    430428  M=II;
    431429}
     
    437435  long bound;
    438436  ring origR;
    439   sip_sring tmpR;
     437  ring tmpR;
    440438  sparse_mat *bareiss;
    441439
     
    446444  if (t>s) t=s;
    447445  bound=smExpBound(I,c,r,t);
    448   smRingChange(&origR,tmpR,bound);
     446  tmpR=smRingChange(&origR,bound);
    449447  ideal II = idrCopyR(I, origR);
    450448  bareiss = new sparse_mat(II);
     
    464462    delete bareiss;
    465463    rChangeCurrRing(origR);
    466     II = idrMoveR(II,&tmpR);
    467   }
    468   smRingClean(origR,tmpR);
     464    II = idrMoveR(II,tmpR);
     465  }
     466  smKillModifiedRing(tmpR);
    469467  M=II;
    470468}
     
    25892587  sparse_number_mat *linsolv;
    25902588  ring origR;
    2591   sip_sring tmpR;
     2589  ring tmpR;
    25922590  ideal rr;
    25932591
     
    25992597  I->rank = idRankFreeModule(I);
    26002598  if (smCheckSolv(I)) return NULL;
    2601   smRingChange(&origR,tmpR,1);
     2599  tmpR=smRingChange(&origR,1);
    26022600  rr=idrCopyR(I,origR);
    26032601  linsolv = new sparse_number_mat(rr);
     
    26142612  rChangeCurrRing(origR);
    26152613  if (rr!=NULL)
    2616     rr = idrMoveR(rr,&tmpR);
    2617   smRingClean(origR,tmpR);
     2614    rr = idrMoveR(rr,tmpR);
     2615  smKillModifiedRing(tmpR);
    26182616  return rr;
    26192617}
  • kernel/sparsmat.h

    re6651bb rab453da  
    3131ideal smCallSolv(ideal I);
    3232
    33 void smRingChange(ring *, sip_sring &, long);
    34 void smRingClean(ring, ip_sring &);
     33ring smRingChange(ring *, long);
     34void smKillModifiedRing(ring r);
    3535long smExpBound(ideal, int, int, int);
    3636BOOLEAN smCheckDet(ideal, int, BOOLEAN);
Note: See TracChangeset for help on using the changeset viewer.