Changeset 79f80f in git


Ignore:
Timestamp:
Jan 13, 2000, 3:18:58 PM (23 years ago)
Author:
Thomas Siebert <siebert@…>
Branches:
(u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
Children:
3cc3f69eaf583a0a6e659462d814023a400c19ce
Parents:
c284cea94669c008bc37b4e349182a16b68b8e6e
Message:
Extension for lift


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

Legend:

Unmodified
Added
Removed
  • Singular/ideals.cc

    rc284ce r79f80f  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ideals.cc,v 1.81 2000-01-04 15:17:15 siebert Exp $ */
     4/* $Id: ideals.cc,v 1.82 2000-01-13 14:18:58 siebert Exp $ */
    55/*
    66* ABSTRACT - all basic methods to manipulate ideals
     
    16091609* of mod
    16101610*/
    1611 ideal idLiftNonStB(ideal  mod, ideal submod,BOOLEAN goodShape)
    1612 {
    1613   return idLift(mod, submod, goodShape, FALSE);
    1614 }
    1615 
    1616 
    1617 ideal idLift(ideal mod,ideal submod,BOOLEAN goodShape, BOOLEAN isSB)
     1611ideal   idLiftNonStB (ideal  mod, ideal submod,ideal * rest,
     1612             BOOLEAN goodShape,BOOLEAN divide)
     1613{
     1614  return idLift(mod, submod, rest, goodShape, FALSE);
     1615}
     1616
     1617
     1618ideal   idLift (ideal mod, ideal submod,ideal * rest,
     1619             BOOLEAN goodShape, BOOLEAN isSB,BOOLEAN divide)
    16181620{
    16191621  int   lsmod =idRankFreeModule(submod), i, j, k;
     1622  int ordSgn=currRing->OrdSgn;
     1623  int comps_to_add=0;
     1624  poly p;
    16201625
    16211626  if (idIs0(mod))
    16221627    return idInit(1,mod->rank);
    1623 
     1628//#define NEW_LIFT
     1629//#define TEST_LIFT
     1630#ifdef TEST_LIFT
     1631//divide=TRUE;
     1632Print("The module is:\n");
     1633idPrint(mod);
     1634Print("The submodule is:\n");
     1635idPrint(submod);
     1636#endif
     1637#ifdef NEW_LIFT
     1638  if (ordSgn==-1)
     1639  {
     1640    comps_to_add = IDELEMS(submod);
     1641    while ((comps_to_add>0) && (submod->m[comps_to_add-1]==NULL))
     1642      comps_to_add--;
     1643  }
     1644#endif
    16241645  k=idRankFreeModule(mod);
    16251646  if  ((k!=0) && (lsmod==0)) lsmod=1;
     
    16451666  {
    16461667    s_h3 = idCopy(s_mod);
    1647     idPrepareStd(s_h3, k);
     1668    idPrepareStd(s_h3, k+comps_to_add);
    16481669  }
    16491670  else
    16501671  {
    1651     s_h3 = idPrepare(s_mod,(tHomog)FALSE,k,NULL);
     1672    s_h3 = idPrepare(s_mod,(tHomog)FALSE,k+comps_to_add,NULL);
    16521673  }
    16531674  if (!goodShape)
     
    16681689    }
    16691690  }
     1691#ifdef NEW_LIFT
     1692  if (ordSgn==-1)
     1693  {
     1694    for(j = 0;j<comps_to_add;j++)
     1695    {
     1696      p = s_temp->m[j];
     1697      if (p!=NULL)
     1698      {
     1699        while (pNext(p)!=NULL) pIter(p);
     1700        pNext(p) = pOne();
     1701        pIter(p);
     1702        pSetComp(p,1+j+k);
     1703        pSetmComp(p);
     1704      }
     1705    }
     1706  }
     1707#endif
    16701708  ideal s_result = kNF(s_h3,currQuotient,s_temp,k);
    16711709  s_result->rank = s_h3->rank;
     1710  ideal s_rest = idInit(IDELEMS(s_result),k);
    16721711  idDelete(&s_h3);
    16731712  idDelete(&s_temp);
     
    16791718      if (pGetComp(s_result->m[j])<=k)
    16801719      {
    1681         if (isSB)
     1720        if (!divide)
    16821721        {
    1683           WarnS("first module not a standardbasis\n"
    1684             "// ** or second not a proper submodule");
     1722          if (isSB)
     1723          {
     1724            WarnS("first module not a standardbasis\n"
     1725              "// ** or second not a proper submodule");
     1726          }
     1727          else
     1728            WerrorS("2nd module lies not in the first");
     1729          idDelete(&s_result);
     1730          idDelete(&s_rest);
     1731          s_result=idInit(IDELEMS(submod),submod->rank);
     1732          break;
    16851733        }
    16861734        else
    1687           WerrorS("2nd module lies not in the first");
    1688         idDelete(&s_result);
    1689         s_result=idInit(IDELEMS(submod),submod->rank);
    1690         break;
    1691       }
    1692       else
    1693       {
    1694         pShift(&(s_result->m[j]),-k);
    1695         pNeg(s_result->m[j]);
    1696       }
    1697     }
    1698   }
    1699 
     1735        {
     1736          p = s_rest->m[j] = s_result->m[j];
     1737          while ((pNext(p)!=NULL) && (pGetComp(pNext(p))<=k)) pIter(p);
     1738          s_result->m[j] = pNext(p);
     1739          pNext(p) = NULL;
     1740        }
     1741      }
     1742      pShift(&(s_result->m[j]),-k);
     1743      pNeg(s_result->m[j]);
     1744    }
     1745  }
     1746  if ((lsmod==0) && (!idIs0(s_rest)))
     1747  {
     1748    for (j=IDELEMS(s_rest);j>0;j--)
     1749    {
     1750      if (s_rest->m[j-1]!=NULL)
     1751      {
     1752        pShift(&(s_rest->m[j-1]),-1);
     1753        s_rest->m[j-1] = pNeg(s_rest->m[j-1]);
     1754      }
     1755    }
     1756  }
     1757#ifdef TEST_LIFT
     1758Print("The lift is:\n");
     1759idPrint(s_result);
     1760Print("The rest is:\n");
     1761if (s_rest!=NULL) idPrint(s_rest);
     1762#endif
    17001763  if(syz_ring!=orig_ring)
    17011764  {
     
    17031766    rChangeCurrRing(orig_ring,TRUE);
    17041767    s_result = idrMoveR_NoSort(s_result, syz_ring);
     1768    s_rest = idrMoveR_NoSort(s_rest, syz_ring);
    17051769    rKill(syz_ring);
    17061770  }
     1771  if (rest!=NULL)
     1772    *rest = s_rest;
     1773  else
     1774    idDelete(&s_rest);
    17071775  return s_result;
    17081776}
  • Singular/ideals.h

    rc284ce r79f80f  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: ideals.h,v 1.17 2000-01-04 15:17:16 siebert Exp $ */
     6/* $Id: ideals.h,v 1.18 2000-01-13 14:18:57 siebert Exp $ */
    77/*
    88* ABSTRACT - all basic methods to manipulate ideals
     
    2121  /*- deletes an ideal -*/
    2222#endif
     23void idShow(ideal id);
    2324void idPrint(ideal id);
    2425  /*- initialise an ideal -*/
     
    8788ideal   idLiftStd  (ideal h1, matrix *m, tHomog h=testHomog);
    8889
    89 ideal   idLift (ideal mod, ideal sumod,BOOLEAN goodShape=FALSE,
    90                BOOLEAN isSB=TRUE);
    91 ideal   idLiftNonStB (ideal  mod, ideal submod,BOOLEAN goodShape=FALSE);
     90ideal   idLift (ideal mod, ideal sumod,ideal * rest=NULL,
     91             BOOLEAN goodShape=FALSE, BOOLEAN isSB=TRUE,BOOLEAN divide=FALSE);
     92ideal   idLiftNonStB (ideal  mod, ideal submod,ideal * rest=NULL,
     93             BOOLEAN goodShape=FALSE,BOOLEAN divide=FALSE);
    9294
    9395intvec * idMWLift(ideal mod,intvec * weights);
  • Singular/iparith.cc

    rc284ce r79f80f  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: iparith.cc,v 1.199 2000-01-13 10:33:19 Singular Exp $ */
     4/* $Id: iparith.cc,v 1.200 2000-01-13 14:18:58 siebert Exp $ */
    55
    66/*
     
    17251725  int ul= IDELEMS((ideal)u->Data());
    17261726  int vl= IDELEMS((ideal)v->Data());
     1727  //if (currRing->OrdSgn==-1) ul += vl;  //to add if NEW_LIFT defined
    17271728  if (hasFlag(u,FLAG_STD))
    17281729  {
Note: See TracChangeset for help on using the changeset viewer.