Changeset 75214e in git for Singular/ipassign.cc


Ignore:
Timestamp:
Jan 6, 2016, 3:26:39 PM (8 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b50cc4fc80fdf2a2005655a08d9229aa4b32d4a5')
Children:
93fcaad3210c79181af79c2a8f13b59cfb097ebd
Parents:
fc62955b6195fba8d9906e461584a2130448be7e
Message:
fix: normalizing in qrings + better error detecting in ring creation
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/ipassign.cc

    rfc62955 r75214e  
    635635  if (e==NULL)
    636636  {
     637    if ((p!=NULL) && TEST_V_QRING && (currRing->qideal!=NULL)
     638    && (!hasFlag(a,FLAG_QRING)))
     639    {
     640      jjNormalizeQRingP(p);
     641      setFlag(res,FLAG_QRING);
     642    }
    637643    if (res->data!=NULL) pDelete((poly*)&res->data);
    638644    res->data=(void*)p;
    639645    jiAssignAttr(res,a);
    640     if (TEST_V_QRING && (currRing->qideal!=NULL) && (!hasFlag(res,FLAG_QRING))) jjNormalizeQRingP(res);
    641646  }
    642647  else
     
    669674      j=e->next->start;
    670675    }
     676    if ((p!=NULL) && TEST_V_QRING && (currRing->qideal!=NULL))
     677    {
     678      jjNormalizeQRingP(p);
     679    }
    671680    pDelete(&MATELEM(m,i,j));
    672681    MATELEM(m,i,j)=p;
     
    676685      m->rank=si_max(m->rank,pMaxComp(p));
    677686    }
    678     if (TEST_V_QRING) jjNormalizeQRingP(res);
    679687  }
    680688  return FALSE;
     
    21522160  }
    21532161}
    2154 void jjNormalizeQRingP(leftv I)
    2155 {
    2156   if ((currRing->qideal!=NULL) && (!hasFlag(I,FLAG_QRING)))
    2157   {
    2158     poly p=(poly)I->Data();
    2159     if ((I->e==NULL) && (p!=NULL))
    2160     {
    2161       ideal F=idInit(1,1);
    2162       poly II=kNF(F,currRing->qideal,p);
    2163       idDelete(&F);
    2164       if ((I->rtyp==POLY_CMD)
    2165       || (I->rtyp==VECTOR_CMD))
    2166       {
    2167         pDelete(&p);
    2168         I->data=II;
    2169       }
    2170       else if (I->rtyp==IDHDL)
    2171       {
    2172         pDelete(&p);
    2173         idhdl h=(idhdl)I->data;
    2174         IDPOLY(h)=II;
    2175         setFlag(h,FLAG_QRING);
    2176       }
    2177       else
    2178       {
    2179         pDelete(&II);
    2180       }
    2181     }
    2182     setFlag(I,FLAG_QRING);
     2162void jjNormalizeQRingP(poly &p)
     2163{
     2164  if((p!=NULL) && (currRing->qideal!=NULL))
     2165  {
     2166    ideal F=idInit(1,1);
     2167    poly p2=kNF(F,currRing->qideal,p);
     2168    pNormalize(p2);
     2169    idDelete(&F);
     2170    pDelete(&p);
     2171    p=p2;
    21832172  }
    21842173}
Note: See TracChangeset for help on using the changeset viewer.