Changeset f3461d in git


Ignore:
Timestamp:
Feb 28, 2012, 8:11:33 PM (12 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
9b1590d4c8e281abd068646c9d699284f9ea053a
Parents:
986225e4b879695a1828864dc45519cbf8a0f681
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-02-28 20:11:33+01:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-03-05 17:42:53+01:00
Message:
removed componentWeights from IS-ordering

NOTE/TODO: the induced degrees must be implemented separately
(via an extendable variable and module components weight-vector)
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • dyn_modules/syzextra/mod_main.cc

    r986225e rf3461d  
    3030#include "myNF.h"
    3131
    32 extern BOOLEAN rSetISReference(const ring r, const ideal F, const int i, const int p, const intvec * componentWeights);
    33 
    34 // extern void rSetISReference(const ideal F, const int rank, const int p, const intvec * componentWeights, const ring r);
    3532extern void pISUpdateComponents(ideal F, const intvec *const V, const int MIN, const ring r);
    3633// extern ring rCurrRingAssure_SyzComp();
     
    504501  const int iLimit = r->typ[pos].data.is.limit;
    505502  const ideal F = r->typ[pos].data.is.F;
    506   const intvec* componentWeights = r->typ[pos].data.is.componentWeights;
    507503  ideal FF = id_Copy(F, r);
    508504
    509505  lists l=(lists)omAllocBin(slists_bin);
    510   l->Init(3);
     506  l->Init(2);
    511507
    512508  l->m[0].rtyp = INT_CMD;
     
    529525  l->m[1].data = reinterpret_cast<void *>(FF);
    530526
    531   l->m[2].rtyp = INTVEC_CMD;
    532  
    533   if( componentWeights != NULL )
    534     l->m[2].data = reinterpret_cast<void *>(new intvec(componentWeights));
    535   else
    536     l->m[2].data = reinterpret_cast<void *>(new intvec());
    537    
    538 
    539 
    540527  res->rtyp = LIST_CMD; // list of int/module
    541528  res->data = reinterpret_cast<void *>(l);
     
    558545    return TRUE;
    559546  }
    560 
    561   intvec * componentWeights = (intvec *)atGet(h,"isHomog",INTVEC_CMD); // No copy!
    562547
    563548  const ideal F = (ideal)h->Data(); ; // No copy!
     
    592577
    593578  // F & componentWeights belong to that ordering block of currRing now:
    594   rSetISReference(r, F, rank, p, componentWeights); // F and componentWeights will be copied!
     579  rSetISReference(r, F, rank, p); // F will be copied!
    595580  return FALSE;
    596581}
  • libpolys/polys/monomials/p_polys.cc

    r986225e rf3461d  
    573573      case ringorder_s:
    574574      case ringorder_aa:
     575      case ringorder_IS:
    575576        break;
    576       case ringorder_IS:
    577       {
    578         assume( b0 == b1 );
    579         assume( (-2 < b0) && (b0 < 2) ); // 0 => prefix! +/-1 => suffix!
    580 
    581         if( b0 != 0) // suffix?
    582           break;
    583 
    584         // only prefix adds the weight...
    585 
    586         if( (k = p_GetComp(p, r)) == 0 )
    587           break;
    588 
    589         const int ord_pos = rGetISPos(pIS++, r);
    590 
    591         const intvec* componentWeights = r->typ[ord_pos].data.is.componentWeights;
    592 
    593         if( componentWeights == NULL )
    594           break;
    595 
    596         const int limit = r->typ[ord_pos].data.is.limit;
    597         assume( limit >= 0 );
    598 
    599         if( k > limit )
    600         {
    601           k -= (limit + 1);
    602           assume( k >= 0 );
    603 
    604           assume( componentWeights != NULL );
    605 
    606           if( k < componentWeights->length() )
    607             j += (*componentWeights)[k]; // j += the weight of k^th-component
    608 #ifndef NDEBUG
    609           else
    610             Warn("Unknown (out of known-range (%d)) component index:%d for IS[%d at %d] ordering\n",componentWeights->length(), k, pIS-1, ord_pos);
    611 #endif
    612         }
    613         break;
    614       }
    615577      case ringorder_a:
    616578        for (k=b0 /*r->block0[i]*/;k<=b1 /*r->block1[i]*/;k++)
     
    630592  return  j;
    631593}
    632 
    633 
    634 /// compute the total monomial weight for the case of Induced ordering,
    635 /// where we already have weight for module components!
    636 /// It is only needed to be known by rOptimizeLDeg and rSetDegStuff
    637 long p_TotaldegreeIS(poly p, const ring r)
    638 {
    639   long s = p_Totaldegree(p, r);
    640 
    641   int k = p_GetComp(p, r) - 1;
    642 
    643   if ( (k > 0) && (r->typ!=NULL) )
    644   {
    645     int pIS = 0;
    646     for( int pos = 0; pos < r->OrdSize; pos++ )
    647       if( r->typ[pos].ord_typ == ro_is)
    648       {
    649         const intvec* componentWeights = r->typ[pos].data.is.componentWeights;
    650 
    651         if( componentWeights == NULL )
    652           continue;
    653 
    654         const int limit = r->typ[pos].data.is.limit;
    655         assume( limit >= 0 );
    656 
    657 
    658         if( k > limit )
    659         {
    660           k -= (limit + 1);
    661           assume( k >= 0 );
    662 
    663           assume( componentWeights != NULL );
    664 
    665           if( k < componentWeights->length() )
    666             s += (*componentWeights)[k]; // j += the weight of k^th-component
    667 #ifndef NDEBUG
    668           else
    669             Warn("Unknown (out of known-range (%d)) component index:%d for IS[%d at %d] ordering\n",componentWeights->length(), k, pIS-1, pos);
    670 #endif
    671         }
    672 
    673         pIS++;
    674 
    675         return s; // multiple ro_is blocks are not really supported at the moment...
    676       }
    677   }
    678 
    679   return s;
    680 }
    681 
    682594
    683595long p_DegW(poly p, const short *w, const ring R)
  • libpolys/polys/monomials/ring.cc

    r986225e rf3461d  
    28272827              F,  // WILL BE COPIED!
    28282828              r->typ[i].data.is.limit,
    2829               j++,
    2830               r->typ[i].data.is.componentWeights // WILL BE COPIED
     2829              j++
    28312830              )
    28322831            );
     
    33163315  if( rGetISPos(0, r) != -1 ) // Are there Schreyer induced blocks?
    33173316  {
    3318     if( r->pFDeg == p_Totaldegree )
    3319     {
    3320       extern long p_TotaldegreeIS(poly p, const ring r);
    3321       r->pFDeg = p_TotaldegreeIS;
    3322     }
    33233317#ifndef NDEBUG
    3324     else
    3325       assume( r->pFDeg == p_Deg || r->pFDeg == p_WTotaldegree );
    3326 #endif
    3327 
    3328     r->pLDeg = pLDeg1;
     3318      assume( r->pFDeg == p_Deg || r->pFDeg == p_WTotaldegree || r->pFDeg == p_Totaldegree);
     3319#endif
     3320
     3321    r->pLDeg = pLDeg1; // ?
    33293322  }
    33303323
     
    38593852          r->typ[i].data.is.F = NULL; // ?
    38603853
    3861           if( r->typ[i].data.is.componentWeights != NULL )
    3862           {
    3863             delete r->typ[i].data.is.componentWeights;
    3864             r->typ[i].data.is.componentWeights = NULL; // ?
    3865           }
    3866 
    38673854          if( r->typ[i].data.is.pVarOffset != NULL )
    38683855          {
     
    40764063
    40774064      Print("  limit %d",r->typ[j].data.is.limit);
    4078       #ifndef NDEBUG
     4065#ifndef NDEBUG
    40794066      //PrintS("  F: ");idShow(r->typ[j].data.is.F, r, r, 1);
    4080       #endif
    4081 
    4082       PrintS(", weights: ");
    4083 
    4084       if( r->typ[j].data.is.componentWeights == NULL )
    4085         PrintS("NULL == [0,...,0]\n");
    4086       else
    4087       {
    4088         (r->typ[j].data.is.componentWeights)->show(); PrintLn();
    4089       }
     4067#endif
     4068
     4069      PrintLn();
    40904070    }
    40914071    else if  (r->typ[j].ord_typ==ro_am)
     
    41814161
    41824162  {
    4183     extern long p_TotaldegreeIS(poly p, const ring r);
    4184 
    41854163      PrintLn();
    41864164      Print("pFDeg   : ");
     
    41904168      pFDeg_CASE(p_WTotaldegree); else
    41914169      pFDeg_CASE(p_Deg); else
    4192       pFDeg_CASE(p_TotaldegreeIS); else
    41934170#undef pFDeg_CASE
    41944171      Print("(%p)", (void*)(r->pFDeg)); // default case
     
    49394916
    49404917/// Changes r by setting induced ordering parameters: limit and reference leading terms
    4941 /// F belong to r, we will DO a copy! (same to componentWeights)
     4918/// F belong to r, we will DO a copy!
    49424919/// We will use it AS IS!
    49434920/// returns true is everything was allright!
    4944 BOOLEAN rSetISReference(const ring r, const ideal F, const int i, const int p, const intvec * componentWeights)
     4921BOOLEAN rSetISReference(const ring r, const ideal F, const int i, const int p)
    49454922{
    49464923  // Put the reference set F into the ring -ordering -recor
    4947 
    4948   // TEST THAT THERE ARE DEGs!!!
    4949   // assume( componentWeights == NULL  ); // ???
    4950   if( componentWeights != NULL )
    4951   {
    4952 //    assure that the ring r has degrees!!!
    4953 //    Add weights to degrees of F[i]
    4954   }
    49554924
    49564925  if (r->typ==NULL)
     
    49894958
    49904959  r->typ[pos].data.is.F = FF; // F is owened by ring now! TODO: delete at the end!
    4991 
    4992   if(r->typ[pos].data.is.componentWeights != NULL)
    4993   {
    4994 #if MYTEST
    4995     PrintS("Deleting old componentWeights: "); r->typ[pos].data.is.componentWeights->show(); PrintLn();
    4996 #endif
    4997     delete r->typ[pos].data.is.componentWeights;
    4998     r->typ[pos].data.is.componentWeights = NULL;
    4999   }
    5000 
    5001 
    5002   assume(r->typ[pos].data.is.componentWeights == NULL);
    5003 
    5004   if( componentWeights != NULL )
    5005     componentWeights = ivCopy(componentWeights); // componentWeights is owened by ring now! TODO: delete at the end!
    5006 
    5007   r->typ[pos].data.is.componentWeights = componentWeights;
    50084960
    50094961  r->typ[pos].data.is.limit = i; // First induced component
  • libpolys/polys/monomials/ring.h

    r986225e rf3461d  
    165165  // reference poly set?? // Should it be owned by ring?!!!
    166166  ideal F; // reference leading (module)-monomials set. owned by ring...
    167   const intvec* componentWeights; // component weights! owned by ring...
    168167};
    169168
     
    745744poly rGetVar(const int varIndex, const ring r);
    746745
    747 BOOLEAN rSetISReference(const ring r, const ideal F, const int i = 0, const int p = 0, const intvec * componentWeights = NULL);
     746BOOLEAN rSetISReference(const ring r, const ideal F, const int i = 0, const int p = 0);
    748747
    749748/// return the position of the p^th IS block order block in r->typ[]...
Note: See TracChangeset for help on using the changeset viewer.