Changeset 52e2f6 in git for kernel/ideals.cc


Ignore:
Timestamp:
Jun 10, 2008, 12:17:33 PM (15 years ago)
Author:
Motsak Oleksandr <motsak@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a657104b677b4c461d018cbf3204d72d34ad66a9')
Children:
28325ab307b0d45f178c4ce869547de7d3f3faa7
Parents:
f2b58394b7c0b28984794adfcef85f56f72e35bf
Message:
*motsak: major redesign of NC Subsystem, maybe something more...


git-svn-id: file:///usr/local/Singular/svn/trunk@10739 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/ideals.cc

    rf2b5839 r52e2f6  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ideals.cc,v 1.55 2008-04-04 09:51:37 Singular Exp $ */
     4/* $Id: ideals.cc,v 1.56 2008-06-10 10:17:31 motsak Exp $ */
    55/*
    66* ABSTRACT - all basic methods to manipulate ideals
     
    2626
    2727
     28#define MYTEST 0
     29
     30
    2831/* #define WITH_OLD_MINOR */
    2932#define pCopy_noCheck(p) pCopy(p)
     
    6568void idShow(ideal id)
    6669{
    67   Print("Module of rank %d,real rank %d and %d generators.\n",
    68          id->rank,idRankFreeModule(id),IDELEMS(id));
    69   for (int i=0;i<id->ncols*id->nrows;i++)
    70   {
    71     if (id->m[i]!=NULL)
    72     {
    73       Print("generator %d: ",i);pWrite(id->m[i]);
     70  if( id == NULL )
     71    Print("(NULL)");
     72  else
     73  {
     74    Print("Module of rank %d,real rank %d and %d generators.\n",
     75           id->rank,idRankFreeModule(id),IDELEMS(id));
     76    for (int i=0;i<id->ncols*id->nrows;i++)
     77    {
     78      if (id->m[i]!=NULL)
     79      {
     80        Print("generator %d: ",i);pWrite(id->m[i]);
     81      }
    7482    }
    7583  }
     
    12991307  }
    13001308  h2->rank = syzcomp+i+1;
     1309
     1310#if MYTEST
     1311#ifdef RDEBUG
     1312  Print("Prepare::h2: ");
     1313  idPrint(h2);
     1314#endif 
     1315#endif
     1316 
    13011317  for (j=0; j<=i; j++)
    13021318  {
     
    13161332#ifdef PDEBUG
    13171333  for(j=0;j<IDELEMS(h2);j++) pTest(h2->m[j]);
     1334
     1335#if MYTEST
     1336#ifdef RDEBUG
     1337  Print("Prepare::Input: ");
     1338  idPrint(h2);
     1339
     1340  Print("Prepare::currQuotient: ");
     1341  idPrint(currQuotient);
     1342#endif 
    13181343#endif
    1319   h3=kStd(h2,currQuotient,h,w,NULL,syzcomp);
     1344 
     1345#endif
     1346
     1347 
     1348  h3 = kStd(h2,currQuotient,h,w,NULL,syzcomp);
    13201349  idDelete(&h2);
    13211350  return h3;
     
    15281557  if (k==1) verbose |=Sy_bit(V_IDLIFT);
    15291558
    1530   ring orig_ring=currRing;
    1531   ring syz_ring=rCurrRingAssure_SyzComp();
     1559  ring orig_ring = currRing;
     1560  ring syz_ring = rCurrRingAssure_SyzComp();
    15321561  rSetSyzComp(k);
    15331562
     1563 
     1564#if MYTEST
     1565#ifdef RDEBUG
     1566  rWrite(syz_ring);
     1567  rDebugPrint(syz_ring);
     1568#endif 
     1569#endif
     1570 
    15341571  ideal s_h1=h1;
    15351572
     
    15391576    s_h1 = h1;
    15401577
     1578#if MYTEST
     1579#ifdef RDEBUG
     1580  Print("Input: ");
     1581  idPrint(s_h1);
     1582#endif 
     1583#endif
     1584 
     1585
    15411586  ideal s_h3=idPrepare(s_h1,h,k,&w);
     1587
     1588#if MYTEST
     1589#ifdef RDEBUG
     1590  Print("Prepare: ");
     1591  idPrint(s_h3);
     1592#endif 
     1593#endif
     1594
    15421595  ideal s_h2 = idInit(IDELEMS(s_h3), s_h3->rank);
    15431596
     1597#if MYTEST
     1598#ifdef RDEBUG
     1599  Print("Temp: ");
     1600  idPrint(s_h2);
     1601#endif 
     1602#endif
     1603 
    15441604  if (w!=NULL) delete w;
    15451605  i = 0;
     1606
    15461607  for (j=0; j<IDELEMS(s_h3); j++)
    15471608  {
     
    15711632
    15721633  idSkipZeroes(s_h3);
     1634
     1635#if MYTEST
     1636#ifdef RDEBUG
     1637  Print("Input'': ");
     1638  idPrint(s_h3);
     1639#endif 
     1640#endif
     1641
    15731642  j = IDELEMS(s_h1);
    15741643
     1644
     1645#if MYTEST
     1646#ifdef RDEBUG
     1647  Print("Temp Result: ");
     1648  idPrint(s_h2);
     1649#endif 
     1650#endif
     1651
     1652 
    15751653  if (syz_ring!=orig_ring)
    15761654  {
     
    16091687    s_h3->m[i] = prMoveR_NoSort(s_h3->m[i], syz_ring);
    16101688  }
     1689
     1690#if MYTEST
     1691#ifdef RDEBUG
     1692  Print("Output STD Ideal: ");
     1693  idPrint(s_h3);
     1694
     1695  Print("Output Matrix: ");
     1696  iiWriteMatrix(*ma, "ma", 2, 4);
     1697#endif 
     1698#endif
     1699 
    16111700
    16121701  if (syz_ring!=orig_ring) rKill(syz_ring);
     
    23282417  if (idIs0(h1)) return idInit(1,h1->rank);
    23292418#ifdef HAVE_PLURAL
    2330   if (rIsPluralRing(currRing))
     2419  if (rIsPluralRing(origR))
    23312420    /* in the NC case, we have to check the admissibility of */
    23322421    /* the subalgebra to be intersected with */
    23332422  {
    2334     if (ncRingType(currRing)!=nc_skew) /* in (quasi)-commutative algebras every subalgebra is admissible */
    2335     {
    2336       if (nc_CheckSubalgebra(delVar,currRing))
     2423    if ((ncRingType(origR) != nc_skew) && (ncRingType(origR) != nc_exterior)) /* in (quasi)-commutative algebras every subalgebra is admissible */
     2424    {
     2425      if (nc_CheckSubalgebra(delVar,origR))
    23372426      {
    23382427        WerrorS("no elimination is possible: subalgebra is not admissible");
     
    23622451  block0[0] = 1;
    23632452  block1[0] = rVar(origR);
    2364   wv[0]=(int*)omAlloc((pVariables+1)*sizeof(int));
    2365   memset(wv[0],0,(pVariables+1)*sizeof(int));
     2453  wv[0]=(int*)omAlloc((rVar(origR) + 1)*sizeof(int));
     2454  memset(wv[0],0,(rVar(origR) + 1)*sizeof(int));
    23662455  for (j=0;j<rVar(origR);j++)
    23672456    if (pGetExp(delVar,j+1)!=0) wv[0][j]=1;
     
    23762465  tmpR->block1 = block1;
    23772466  tmpR->wvhdl = wv;
     2467
    23782468  rComplete(tmpR, 1);
    23792469
    23802470#ifdef HAVE_PLURAL
    23812471  /* update nc structure on tmpR */
    2382   if (rIsPluralRing(currRing))
    2383   {
    2384     BOOLEAN bBAD = FALSE;
    2385     if ( nc_rComplete(origR, tmpR) )
     2472  if (rIsPluralRing(origR))
     2473  {
     2474    if ( nc_rComplete(origR, tmpR, false) ) // no quotient ideal!
    23862475    {
    23872476      Werror("error in nc_rComplete");
    2388       bBAD = TRUE;
    2389     }
    2390     if (!bBAD)
    2391     {
    2392       /* tests the admissibility of the new elim. ordering */
    2393       if ( nc_CheckOrdCondition( tmpR->nc->D, tmpR) )
    2394       {
    2395         Werror("no elimination is possible: ordering condition is violated");
    2396         bBAD = TRUE;
    2397       }
    2398     }
    2399     if (bBAD)
    2400     {
    24012477      // cleanup
    24022478      rDelete(tmpR);
    24032479      if (w!=NULL)
    2404       {
    24052480        delete w;
    2406       }
    24072481      return idCopy(h1);
    24082482    }
Note: See TracChangeset for help on using the changeset viewer.