Changeset 359f09 in git


Ignore:
Timestamp:
Dec 1, 2022, 11:48:21 AM (2 months ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'ad2543eab51733612ba7d118afc77edca719600e')
Children:
5cc997784cbce4c118fa8bc8c2a902459d4068d4
Parents:
5a0dde71de01068fad5736a17555c993ecbbf495
Message:
simplify ring.cc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/kutil.cc

    r5a0dde7 r359f09  
    389389  //if ( !(n_IsUnit(pGetCoeff(p), r->cf)) ) return;
    390390
    391 //    for(i=r->N;i>0;i--)
    392 //    {
    393 //      if ((p_GetExp(p,i,r)>0) && (rIsPolyVar(i, r)==TRUE)) return;
    394 //    }
    395391  poly h = pNext(p);
    396392  int  i;
  • libpolys/polys/monomials/ring.cc

    r5a0dde7 r359f09  
    20342034}
    20352035
    2036 BOOLEAN rIsPolyVar(int v,const ring r)
    2037 {
    2038   int  i=0;
    2039   while(r->order[i]!=0)
    2040   {
    2041     if((r->block0[i]<=v)
    2042     && (r->block1[i]>=v))
    2043     {
    2044       switch(r->order[i])
    2045       {
    2046         case ringorder_a:
    2047           return (r->wvhdl[i][v-r->block0[i]]>0);
    2048         case ringorder_M:
    2049           return 2; /*don't know*/
    2050         case ringorder_a64: /* assume: all weight are non-negative!*/
    2051         case ringorder_lp:
    2052         case ringorder_rs:
    2053         case ringorder_dp:
    2054         case ringorder_Dp:
    2055         case ringorder_wp:
    2056         case ringorder_Wp:
    2057           return TRUE;
    2058         case ringorder_ls:
    2059         case ringorder_ds:
    2060         case ringorder_Ds:
    2061         case ringorder_ws:
    2062         case ringorder_Ws:
    2063           return FALSE;
    2064         default:
    2065           break;
    2066       }
    2067     }
    2068     i++;
    2069   }
    2070   return 3; /* could not find var v*/
    2071 }
    2072 
    20732036#ifdef RDEBUG
    20742037// This should eventually become a full-fledge ring check, like pTest
     
    43974360
    43984361
    4399 //    F = system("ISUpdateComponents", F, V, MIN );
    4400 //    // replace gen(i) -> gen(MIN + V[i-MIN]) for all i > MIN in all terms from F!
    4401 void pISUpdateComponents(ideal F, const intvec *const V, const int MIN, const ring r )
    4402 {
    4403   assume( V != NULL );
    4404   assume( MIN >= 0 );
    4405 
    4406   if( F == NULL )
    4407     return;
    4408 
    4409   for( int j = (F->ncols*F->nrows) - 1; j >= 0; j-- )
    4410   {
    4411 #ifdef PDEBUG
    4412     Print("F[%d]:", j);
    4413     p_wrp(F->m[j], r);
    4414 #endif
    4415 
    4416     for( poly p = F->m[j]; p != NULL; pIter(p) )
    4417     {
    4418       int c = p_GetComp(p, r);
    4419 
    4420       if( c > MIN )
    4421       {
    4422 #ifdef PDEBUG
    4423         Print("gen[%d] -> gen(%d)\n", c, MIN + (*V)[ c - MIN - 1 ]);
    4424 #endif
    4425 
    4426         p_SetComp( p, MIN + (*V)[ c - MIN - 1 ], r );
    4427       }
    4428     }
    4429 #ifdef PDEBUG
    4430     Print("new F[%d]:", j);
    4431     p_Test(F->m[j], r);
    4432     p_wrp(F->m[j], r);
    4433 #endif
    4434   }
    4435 }
    4436 
    44374362/*2
    44384363* asssume that rComplete was called with r
     
    52565181    return 0;
    52575182  }
    5258 }
    5259 
    5260 BOOLEAN rRing_is_Homog(const ring r)
    5261 {
    5262   if (r == NULL) return FALSE;
    5263   int i, j, nb = rBlocks(r);
    5264   for (i=0; i<nb; i++)
    5265   {
    5266     if (r->wvhdl[i] != NULL)
    5267     {
    5268       int length = r->block1[i] - r->block0[i]+1;
    5269       int* wvhdl = r->wvhdl[i];
    5270       if (r->order[i] == ringorder_M) length *= length;
    5271 
    5272       for (j=0; j< length; j++)
    5273       {
    5274         if (wvhdl[j] != 0 && wvhdl[j] != 1) return FALSE;
    5275       }
    5276     }
    5277   }
    5278   return TRUE;
    52795183}
    52805184
     
    58575761#endif
    58585762
    5859 void rModify_a_to_A(ring r)
    5860 // to be called BEFORE rComplete:
    5861 // changes every Block with a(...) to A(...)
    5862 {
    5863   int i=0;
    5864   int j;
    5865   while(r->order[i]!=0)
    5866   {
    5867     if (r->order[i]==ringorder_a)
    5868     {
    5869       r->order[i]=ringorder_a64;
    5870       int *w=r->wvhdl[i];
    5871       int64 *w64=(int64 *)omAlloc((r->block1[i]-r->block0[i]+1)*sizeof(int64));
    5872       for(j=r->block1[i]-r->block0[i];j>=0;j--)
    5873               w64[j]=(int64)w[j];
    5874       r->wvhdl[i]=(int*)w64;
    5875       omFreeSize(w,(r->block1[i]-r->block0[i]+1)*sizeof(int));
    5876     }
    5877     i++;
    5878   }
    5879 }
    5880 
    5881 
    58825763poly rGetVar(const int varIndex, const ring r)
    58835764{
  • libpolys/polys/monomials/ring.h

    r5a0dde7 r359f09  
    471471void   rUnComplete(ring r);
    472472
    473 BOOLEAN rRing_is_Homog(const ring r);
    474473BOOLEAN rRing_has_CompLastBlock(const ring r);
    475474BOOLEAN rRing_ord_pure_dp(const ring r);
     
    771770rOrderType_t    rGetOrderType(ring r);
    772771
    773 /// returns TRUE if var(i) belongs to p-block
    774 BOOLEAN rIsPolyVar(int i, const ring r);
    775 
    776772static inline BOOLEAN rOrd_is_Comp_dp(const ring r)
    777773{
     
    796792/// construct Wp, C ring
    797793ring rModifyRing_Wp(ring r, int* weights);
    798 void rModify_a_to_A(ring r);
    799794
    800795void rKillModifiedRing(ring r);
     
    825820/// return the position of the p^th IS block order block in r->typ[]...
    826821int rGetISPos(const int p, const ring r);
    827 void pISUpdateComponents(ideal F, const intvec *const V, const int MIN, const ring r);
    828822
    829823BOOLEAN rCheckIV(const intvec *iv);
Note: See TracChangeset for help on using the changeset viewer.