Changeset f93c5e9 in git


Ignore:
Timestamp:
Feb 29, 2012, 7:49:42 PM (12 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'd08f5f0bb3329b8ca19f23b74cb1473686415c3a')
Children:
ece1ce5f2a8a9e000496d4f95d697f07df0551e6
Parents:
8d8cd944663cf80b3fd163a42279526ce163a5fd
Message:
add: new order am: weights on vars and gens
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • Singular/ipshell.cc

    r8d8cd94 rf93c5e9  
    18631863      iv=new intvec(1);
    18641864      (*iv)[0] = s;
    1865     } else
    1866     if (r->block1[i]-r->block0[i] >=0 )
    1867     {
    1868       j=r->block1[i]-r->block0[i];
    1869       if (r->order[i]==ringorder_M)  j=(j+1)*(j+1)-1;
     1865    }
     1866    else if (r->block1[i]-r->block0[i] >=0 )
     1867    {
     1868      int bl=j=r->block1[i]-r->block0[i];
     1869      if (r->order[i]==ringorder_M)
     1870      {
     1871        j=(j+1)*(j+1)-1;
     1872        bl=j+1;
     1873      }
     1874      else if (r->order[i]==ringorder_am)
     1875      {
     1876        j+=r->wvhdl[i][bl+1];
     1877      }
    18701878      iv=new intvec(j+1);
    18711879      if ((r->wvhdl!=NULL) && (r->wvhdl[i]!=NULL))
    18721880      {
    1873         for(;j>=0; j--) (*iv)[j]=r->wvhdl[i][j];
     1881        for(;j>=0; j--) (*iv)[j]=r->wvhdl[i][j+(j>bl)];
    18741882      }
    18751883      else switch (r->order[i])
     
    44604468
    44614469  uResultant::resMatType mtype= determineMType( imtype );
    4462   int i,c,count;
     4470  int i,count;
    44634471  lists listofroots= NULL;
    44644472  number smv= NULL;
     
    45174525
    45184526#ifdef mprDEBUG_PROT
    4519   c= iproots[0]->getAnzElems();
     4527  int c= iproots[0]->getAnzElems();
    45204528  for (i=0; i < c; i++) pWrite(iproots[i]->getPoly());
    45214529  c= muiproots[0]->getAnzElems();
     
    46614669    }
    46624670    else if (((*iv)[1]!=ringorder_a)
    4663     && ((*iv)[1]!=ringorder_a64))
     4671    && ((*iv)[1]!=ringorder_a64)
     4672    && ((*iv)[1]!=ringorder_am))
    46644673      o++;
    46654674    n++;
     
    48054814            break;
    48064815          }
     4816          case ringorder_am:
     4817          {
     4818            R->block0[n] = last+1;
     4819            R->block1[n] = si_min(last+iv->length()-2 , rVar(R));
     4820            R->wvhdl[n] = (int*)omAlloc(iv->length()*sizeof(int));
     4821            if (R->block1[n]- R->block0[n]+2>=iv->length())
     4822               WarnS("missing module weights");
     4823            for (i=2; i<=(R->block1[n]-R->block0[n]+2); i++)
     4824            {
     4825              R->wvhdl[n][i-2]=(*iv)[i];
     4826              last++;
     4827              if (weights[last]==0) weights[last]=(*iv)[i]*typ;
     4828            }
     4829            R->wvhdl[n][i-2]=iv->length() -3 -(R->block1[n]- R->block0[n]);
     4830            for (; i<iv->length(); i++)
     4831            {
     4832              R->wvhdl[n][i-1]=(*iv)[i];
     4833            }
     4834            last=R->block0[n]-1;
     4835            break;
     4836          }
    48074837          case ringorder_a64:
    48084838          {
  • libpolys/polys/monomials/p_polys.cc

    r8d8cd94 rf93c5e9  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id$
    109 *******************************************************************/
    1110
     
    119118#endif
    120119          p->exp[o->data.wp.place]=ord;
     120          break;
     121        }
     122        case ro_am:
     123        {
     124          ord=POLY_NEGWEIGHT_OFFSET;
     125          int a,e;
     126          a=o->data.am.start;
     127          e=o->data.am.end;
     128          int *w=o->data.am.weights;
     129#if 1
     130          for(int i=a;i<=e;i++) ord+=p_GetExp(p,i,r)*w[i-a];
     131          int c=p_GetComp(p,r);
     132#else
     133          long ai;
     134          int ei,wi;
     135          for(int i=a;i<=e;i++)
     136          {
     137             ei=p_GetExp(p,i,r);
     138             wi=w[i-a];
     139             ai=ei*wi;
     140             if (ai/ei!=wi) pSetm_error=TRUE;
     141             ord+=ai;
     142             if (ord<ai) pSetm_error=TRUE;
     143          }
     144#endif
     145          if ((c>0)&&(c<=o->data.am.len_gen))
     146          {
     147            ord+=w[c-(e-a)+2];
     148          }
     149          p->exp[o->data.am.place]=ord;
    121150          break;
    122151        }
     
    205234          const short place = o->data.syz.place;
    206235          const int limit = o->data.syz.limit;
    207          
     236
    208237          if (c > limit)
    209238            p->exp[place] = o->data.syz.curr_index;
     
    319348#ifndef NDEBUG
    320349#if MYTEST
    321             Print("Respective F[c - %d: %d] pp: ", limit, c); 
     350            Print("Respective F[c - %d: %d] pp: ", limit, c);
    322351            p_DebugPrint(pp, r, r, 1);
    323352#endif
     
    329358
    330359
    331 //        const int st = o->data.isTemp.start;       
     360//          const int st = o->data.isTemp.start;
    332361
    333362#ifndef NDEBUG
     
    372401          {
    373402            p->exp[start] = 0; //!!!!????? where?????
    374              
     403
    375404            const int* const pVarOffset = o->data.is.pVarOffset;
    376405
     
    488517  p_LmCheckPolyRing(p, r);
    489518  int i, k;
    490   int pIS = 0; 
     519  int pIS = 0;
    491520  long j =0;
    492521
     
    551580          break;
    552581
    553         // only prefix adds the weight... 
     582        // only prefix adds the weight...
    554583
    555584        if( (k = p_GetComp(p, r)) == 0 )
     
    557586
    558587        const int ord_pos = rGetISPos(pIS++, r);
    559        
     588
    560589        const intvec* componentWeights = r->typ[ord_pos].data.is.componentWeights;
    561590
    562591        if( componentWeights == NULL )
    563592          break;
    564              
     593
    565594        const int limit = r->typ[ord_pos].data.is.limit;
    566595        assume( limit >= 0 );
    567        
     596
    568597        if( k > limit )
    569598        {
    570599          k -= (limit + 1);
    571600          assume( k >= 0 );
    572          
     601
    573602          assume( componentWeights != NULL );
    574          
     603
    575604          if( k < componentWeights->length() )
    576605            j += (*componentWeights)[k]; // j += the weight of k^th-component
     
    623652        const int limit = r->typ[pos].data.is.limit;
    624653        assume( limit >= 0 );
    625        
     654
    626655
    627656        if( k > limit )
     
    15601589  assume(divisor != NULL);
    15611590  if (p == NULL) return NULL;
    1562  
     1591
    15631592  poly result = NULL;
    15641593  number divisorLC = p_GetCoeff(divisor, r);
     
    16341663{
    16351664  assume((p != NULL) || (q != NULL));
    1636  
     1665
    16371666  poly a = p; poly b = q;
    16381667  if (p_Deg(a, r) < p_Deg(b, r)) { a = q; b = p; }
     
    16781707poly p_ExtGcd(poly p, poly &pFactor, poly q, poly &qFactor, ring r)
    16791708{
    1680   assume((p != NULL) || (q != NULL)); 
     1709  assume((p != NULL) || (q != NULL));
    16811710  poly a = p; poly b = q; BOOLEAN aCorrespondsToP = TRUE;
    16821711  if (p_Deg(a, r) < p_Deg(b, r))
     
    22282257  }
    22292258
    2230    
     2259
    22312260  poly p=ph;
    22322261  number h=d;
     
    34053434
    34063435/*2
    3407  * returns a re-ordered convertion of a number as a polynomial, 
     3436 * returns a re-ordered convertion of a number as a polynomial,
    34083437 * with permutation of parameters
    34093438 * NOTE: this only works for Frank's alg. & trans. fields
     
    34213450    n_Delete(&zz, src->cf);
    34223451  }
    3423    
     3452
    34243453  PrintS("\nDestination Ring: \n");
    34253454  rWrite(dst);
    3426    
     3455
    34273456  Print("\nOldPar: %d\n", OldPar);
    34283457  for( int i = 1; i <= OldPar; i++ )
     
    34333462  if( z == NULL )
    34343463     return NULL;
    3435    
     3464
    34363465  const coeffs srcCf = src->cf;
    34373466  assume( srcCf != NULL );
     
    34393468  assume( !nCoeff_is_GF(srcCf) );
    34403469  assume( rField_is_Extension(src) );
    3441    
     3470
    34423471  poly zz = NULL;
    3443    
     3472
    34443473  const ring srcExtRing = srcCf->extRing;
    34453474  assume( srcExtRing != NULL );
    3446    
     3475
    34473476  const coeffs dstCf = dst->cf;
    34483477  assume( dstCf != NULL );
     
    34543483    if( zz == NULL )
    34553484       return NULL;
    3456      
    3457   } else if (nCoeff_is_transExt(srcCf)) 
    3458   {   
     3485
     3486  } else if (nCoeff_is_transExt(srcCf))
     3487  {
    34593488    assume( !IS0(z) );
    3460      
     3489
    34613490    zz = NUM(z);
    34623491    p_Test (zz, srcExtRing);
    3463      
     3492
    34643493    if( zz == NULL )
    34653494       return NULL;
    3466      
     3495
    34673496    if( !DENIS1(z) )
    34683497      WarnS("Not implemented yet: Cannot permute a rational fraction and make a polynomial out of it! Ignorring the denumerator.");
    34693498  } else
    34703499     {
    3471         assume (FALSE);
    3472         Werror("Number permutation is not implemented for this data yet!");
    3473         return NULL;
     3500        assume (FALSE);
     3501        Werror("Number permutation is not implemented for this data yet!");
     3502        return NULL;
    34743503     }
    3475    
     3504
    34763505  assume( zz != NULL );
    34773506  p_Test (zz, srcExtRing);
    34783507
    3479  
     3508
    34803509  nMapFunc nMap = n_SetMap(srcExtRing->cf, dstCf);
    3481      
     3510
    34823511  assume( nMap != NULL );
    3483      
     3512
    34843513  poly qq = p_PermPoly(zz, par_perm - 1, srcExtRing, dst, nMap, NULL, rVar(srcExtRing) );
    34853514//       poly p_PermPoly (poly p, int * perm, const ring oldRing, const ring dst, nMapFunc nMap, int *par_perm, int OldPar)
    3486    
     3515
    34873516//  assume( FALSE );  WarnS("longalg missing 2");
    3488      
     3517
    34893518  return qq;
    34903519}
     
    35013530    PrintS("\np_PermPoly::p: "); p_Write(p, oldRing, oldRing); PrintLn();
    35023531#endif
    3503  
     3532
    35043533  const int OldpVariables = rVar(oldRing);
    35053534  poly result = NULL;
     
    35163545      assume( nMap != NULL );
    35173546      number n = nMap(p_GetCoeff(p, oldRing), oldRing->cf, dst->cf);
    3518        
     3547
    35193548      if ( (!rMinpolyIsNULL(dst)) && (rField_is_Zp_a(dst) || rField_is_Q_a(dst)) )
    35203549        n_Normalize(n, dst->cf);
    3521        
     3550
    35223551      p_GetCoeff(qq, dst) = n;
    3523       // coef may be zero: 
     3552      // coef may be zero:
    35243553      p_Test(qq, dst);
    35253554    }
    35263555    else
    35273556    {
    3528       qq = p_One(dst);       
     3557      qq = p_One(dst);
    35293558
    35303559//      aq = naPermNumber(p_GetCoeff(p, oldRing), par_perm, OldPar, oldRing); // no dst???
     
    35333562
    35343563      p_Test(aq, dst);
    3535        
     3564
    35363565      if ( (!rMinpolyIsNULL(dst)) && (rField_is_Zp_a(dst) || rField_is_Q_a(dst)) )
    35373566      {
    35383567        p_Normalize(aq,dst);
    3539          
     3568
    35403569      }
    35413570      if (aq == NULL)
    3542         p_SetCoeff(qq, n_Init(0, dst->cf),dst); // Very dirty trick!!!
    3543          
     3571        p_SetCoeff(qq, n_Init(0, dst->cf),dst); // Very dirty trick!!!
     3572
    35443573      p_Test(aq, dst);
    35453574    }
    3546      
    3547     if (rRing_has_Comp(dst)) 
     3575
     3576    if (rRing_has_Comp(dst))
    35483577       p_SetComp(qq, p_GetComp(p, oldRing), dst);
    35493578
     
    35523581      p_LmDelete(&qq,dst);
    35533582      qq = NULL;
    3554     }     
     3583    }
    35553584    else
    35563585    {
     
    35713600            if (rField_is_GF(dst))
    35723601            {
    3573               assume( dst->cf->extRing == NULL );
     3602               assume( dst->cf->extRing == NULL );
    35743603              number ee = nfPar(1, dst->cf); // NOTE: using nfPar is a BAD thing to do...
    35753604
    3576               number eee;
    3577               n_Power(ee, e, &eee, dst->cf); //nfDelete(ee,dst);
    3578                
     3605              number eee;
     3606              n_Power(ee, e, &eee, dst->cf); //nfDelete(ee,dst);
     3607
    35793608              ee = n_Mult(c, eee, dst->cf);
    35803609              //nfDelete(c,dst);nfDelete(eee,dst);
     
    35833612            else if (nCoeff_is_Extension(dst->cf))
    35843613            {
    3585               const int par = -perm[i];
    3586               assume( par > 0 );
     3614              const int par = -perm[i];
     3615              assume( par > 0 );
    35873616
    35883617//              WarnS("longalg missing 3");
    35893618#if 1
    3590               const coeffs C = dst->cf;
    3591               assume( C != NULL );
    3592              
    3593               const ring R = C->extRing;
    3594               assume( R != NULL );
    3595                
    3596               assume( par <= rVar(R) );
    3597                
    3598               poly pcn; // = (number)c
    3599              
    3600               assume( !n_IsZero(c, C) );
    3601                
    3602               if( nCoeff_is_algExt(C) )
    3603                 pcn = (poly) c;
    3604                else //            nCoeff_is_transExt(C)
    3605                 pcn = NUM(c);
    3606              
     3619              const coeffs C = dst->cf;
     3620              assume( C != NULL );
     3621
     3622              const ring R = C->extRing;
     3623              assume( R != NULL );
     3624
     3625              assume( par <= rVar(R) );
     3626
     3627              poly pcn; // = (number)c
     3628
     3629              assume( !n_IsZero(c, C) );
     3630
     3631              if( nCoeff_is_algExt(C) )
     3632                pcn = (poly) c;
     3633               else //            nCoeff_is_transExt(C)
     3634                pcn = NUM(c);
     3635
    36073636              if (pNext(pcn) == NULL) // c->z
    36083637                p_AddExp(pcn, -perm[i], e, R);
     
    36123641                p_SetExp(mmc, -perm[i], e, R);
    36133642                p_Setm(mmc, R);
    3614                  
    3615                 number nnc;
    3616                 // convert back to a number: number nnc = mmc;
    3617                 if( nCoeff_is_algExt(C) )
    3618                    nnc = (number) mmc;
    3619                 else //            nCoeff_is_transExt(C)
    3620                   nnc = ntInit(mmc, C);
    3621                
     3643
     3644                number nnc;
     3645                // convert back to a number: number nnc = mmc;
     3646                if( nCoeff_is_algExt(C) )
     3647                   nnc = (number) mmc;
     3648                else //            nCoeff_is_transExt(C)
     3649                  nnc = ntInit(mmc, C);
     3650
    36223651                p_GetCoeff(qq, dst) = n_Mult((number)c, nnc, C);
    36233652                n_Delete((number *)&c, C);
    36243653                n_Delete((number *)&nnc, C);
    36253654              }
    3626                
     3655
    36273656              mapped_to_par=1;
    36283657#endif
     
    36453674    }
    36463675    pIter(p);
    3647      
     3676
    36483677#if 0
    36493678    p_Test(aq,dst);
    36503679    PrintS("\naq: "); p_Write(aq, dst, dst); PrintLn();
    36513680#endif
    3652      
     3681
    36533682
    36543683#if 1
     
    36563685    {
    36573686      p_Setm(qq,dst);
    3658        
     3687
    36593688      p_Test(aq,dst);
    36603689      p_Test(qq,dst);
    3661        
     3690
    36623691#if 0
    36633692    p_Test(qq,dst);
    36643693    PrintS("\nqq: "); p_Write(qq, dst, dst); PrintLn();
    36653694#endif
    3666        
    3667       if (aq!=NULL) 
    3668         qq=p_Mult_q(aq,qq,dst);
    3669        
     3695
     3696      if (aq!=NULL)
     3697        qq=p_Mult_q(aq,qq,dst);
     3698
    36703699      aq = qq;
    3671        
     3700
    36723701      while (pNext(aq) != NULL) pIter(aq);
    3673        
     3702
    36743703      if (result_last==NULL)
    36753704      {
     
    36883717    }
    36893718  }
    3690    
     3719
    36913720  result=p_SortAdd(result,dst);
    36923721#else
     
    37193748#endif
    37203749  p_Test(result,dst);
    3721    
     3750
    37223751#if 0
    37233752  p_Test(result,dst);
  • libpolys/polys/monomials/ring.cc

    r8d8cd94 rf93c5e9  
    7373  "ws", ///< ringorder_ws,
    7474  "Ws", ///< ringorder_Ws,
     75  "am",  ///< ringorder_am,
    7576  "L", ///< ringorder_L,
    7677  "aa", ///< ringorder_aa
     
    321322    ||(r->order[l] == ringorder_M)
    322323    ||(r->order[l] == ringorder_a)
     324    ||(r->order[l] == ringorder_am)
    323325    ||(r->order[l] == ringorder_a64)
    324326    ||(r->order[l] == ringorder_aa) ) && (r->order[l] < ringorder_IS) )
     
    355357        if (r->order[l]!=ringorder_M) break;
    356358      }
     359      if (r->order[l]==ringorder_am) /*j==0*/
     360      {
     361        int m=r->wvhdl[l][i];
     362        Print("\n//                  : %d module weights ",m);
     363        m+=i;i++;
     364        for(;i<=m;i++) Print(" %*d" ,nlen,r->wvhdl[l][i]);
     365      }
    357366    }
    358367  }
     
    381390    } else
    382391      PrintS(" ...");
    383      
     392
    384393#if 0  /*Singularg should not differ from Singular except in error case*/
    385394    Print("\n//   noncommutative type:%d", (int)ncRingType(r));
     
    412421    if( details )
    413422    {
    414       PrintLn();       
     423      PrintLn();
    415424      iiWriteMatrix((matrix)r->qideal,"_",1,r);
    416425    } else PrintS(" ...");
     
    11501159
    11511160      nMapFunc nMap1 = n_SetMap(R1->cf,sum->cf); /* can change something global: not usable
    1152                                                     after the next nSetMap call :( */
     1161                                                    after the next nSetMap call :( */
    11531162      // Create blocked C and D matrices:
    11541163      for (i=1; i<= rVar(R1); i++)
     
    11671176
    11681177      nMapFunc nMap2 = n_SetMap(R2->cf,sum->cf); /* can change something global: not usable
    1169                                                     after the next nSetMap call :( */
     1178                                                    after the next nSetMap call :( */
    11701179      for (i=1; i<= rVar(R2); i++)
    11711180        for (j=i+1; j<=rVar(R2); j++)
     
    13761385  if (r->extRing!=NULL)
    13771386    r->extRing->ref++;
    1378  
    1379   res->extRing=r->extRing; 
     1387
     1388  res->extRing=r->extRing;
    13801389  //memset: res->minideal=NULL;
    13811390*/
    1382  
    1383  
     1391
     1392
    13841393  if (copy_ordering == TRUE)
    13851394  {
     
    15201529  if (r->extRing!=NULL)
    15211530    r->extRing->ref++;
    1522  
    1523   res->extRing=r->extRing; 
     1531
     1532  res->extRing=r->extRing;
    15241533  //memset: res->minideal=NULL;
    15251534*/
    1526  
    1527  
     1535
     1536
    15281537  if (copy_ordering == TRUE)
    15291538  {
     
    16781687    if ( rMinpolyIsNULL(r2) ) return FALSE;
    16791688    if (! p_EqualPolys(r1->cf->extRing->minideal->m[0],
    1680                   r2->cf->extRing->minideal->m[0], 
    1681                   r1->cf->extRing))
     1689                  r2->cf->extRing->minideal->m[0],
     1690                  r1->cf->extRing))
    16821691      return FALSE;
    16831692  }
     
    21932202    }
    21942203  }
     2204}
     2205
     2206static void rO_WMDegree(int &place, int &bitplace, int start, int end,
     2207    long *o, sro_ord &ord_struct, int *weights)
     2208{
     2209  // weighted degree (aligned) of variables v_start..v_end, ordsgn 1
     2210  while((start<end) && (weights[0]==0)) { start++; weights++; }
     2211  while((start<end) && (weights[end-start]==0)) { end--; }
     2212  rO_Align(place,bitplace);
     2213  ord_struct.ord_typ=ro_am;
     2214  ord_struct.data.am.start=start;
     2215  ord_struct.data.am.end=end;
     2216  ord_struct.data.am.place=place;
     2217  ord_struct.data.am.len_gen=weights[end-start+1];
     2218  ord_struct.data.am.weights=weights;
     2219  o[place]=1;
     2220  place++;
     2221  rO_Align(place,bitplace);
    21952222}
    21962223
     
    30393066    case ringorder_a:
    30403067    case ringorder_aa:
     3068    case ringorder_am:
    30413069    case ringorder_a64:
    30423070      if (r->OrdSgn==-1) r->MixedOrder=TRUE;
     
    31513179  int** wvhdl = r->wvhdl;
    31523180
    3153  
    3154 
    31553181  if (order[0]==ringorder_S ||order[0]==ringorder_s || order[0]==ringorder_IS)
    31563182  {
     
    31663192  r->pLDeg = (r->OrdSgn == 1 ? pLDegb : pLDeg0);
    31673193
     3194  /*======== ordering type is (am,_) ==================*/
     3195  if ((order[0]==ringorder_am)
     3196  )
     3197  {
     3198    r->MixedOrder = FALSE;
     3199    for(int ii=block0[0];ii<=block1[0];ii++)
     3200      if (wvhdl[0][ii-1]<0) { r->MixedOrder=TRUE;break;}
     3201    r->LexOrder=FALSE;
     3202    for(int ii=block0[0];ii<=block1[0];ii++)
     3203      if (wvhdl[0][ii-1]==0) { r->LexOrder=TRUE;break;}
     3204    if ((block0[0]==1)&&(block1[0]==r->N))
     3205    {
     3206      r->pFDeg = p_Deg;
     3207      r->pLDeg = pLDeg1c_Deg;
     3208    }
     3209    else
     3210   {
     3211      r->pFDeg = p_WTotaldegree;
     3212      r->LexOrder=TRUE;
     3213      r->pLDeg = pLDeg1c_WFirstTotalDegree;
     3214    }
     3215    r->firstwv = wvhdl[0];
     3216  }
    31683217  /*======== ordering type is (_,c) =========================*/
    3169   if ((order[0]==ringorder_unspec) || (order[1] == 0)
     3218  else if ((order[0]==ringorder_unspec) || (order[1] == 0)
    31703219      ||(
    31713220    ((order[1]==ringorder_c)||(order[1]==ringorder_C)
     
    32723321      r->pFDeg = p_TotaldegreeIS;
    32733322    }
    3274 #ifndef NDEBUG   
     3323#ifndef NDEBUG
    32753324    else
    32763325      assume( r->pFDeg == p_Deg || r->pFDeg == p_WTotaldegree );
    32773326#endif
    3278    
     3327
    32793328    r->pLDeg = pLDeg1;
    32803329  }
     
    34053454      case ringorder_aa:
    34063455        rO_WDegree(j,j_bits,r->block0[i],r->block1[i],tmp_ordsgn,tmp_typ[typ_i],
     3456                   r->wvhdl[i]);
     3457        typ_i++;
     3458        break;
     3459
     3460      case ringorder_am:
     3461        rO_WMDegree(j,j_bits,r->block0[i],r->block1[i],tmp_ordsgn,tmp_typ[typ_i],
    34073462                   r->wvhdl[i]);
    34083463        typ_i++;
     
    35433598                                     tmp_typ[typ_i]);
    35443599             typ_i++;
    3545              rCheckOrdSgn(r,i);
     3600             rCheckOrdSgn(r,i);
    35463601          }
    35473602        }
     
    35693624                                     tmp_typ[typ_i]);
    35703625             typ_i++;
    3571              rCheckOrdSgn(r,i);
     3626             rCheckOrdSgn(r,i);
    35723627          }
    35733628        }
     
    35883643                         tmp_ordsgn, v,bits, r->block0[i]);
    35893644        }
    3590         rCheckOrdSgn(r,i);
     3645        rCheckOrdSgn(r,i);
    35913646        break;
    35923647
     
    36003655                     tmp_ordsgn,v, bits, r->block1[i]);
    36013656        }
    3602         rCheckOrdSgn(r,i);
     3657        rCheckOrdSgn(r,i);
    36033658        break;
    36043659
     
    39564011  }
    39574012  // corresponds to ro_typ from ring.h:
    3958   const char *TYP[]={"ro_dp","ro_wp","ro_wp64","ro_wp_neg","ro_cp",
     4013  const char *TYP[]={"ro_dp","ro_wp","ro_am","ro_wp64","ro_wp_neg","ro_cp",
    39594014                     "ro_syzcomp", "ro_syz", "ro_isTemp", "ro_is", "ro_none"};
    39604015  int i,j;
     
    40274082      }
    40284083    }
     4084    else if  (r->typ[j].ord_typ==ro_am)
     4085    {
     4086      Print("  place %d",r->typ[j].data.am.place);
     4087      Print("  start %d",r->typ[j].data.am.start);
     4088      Print("  end %d",r->typ[j].data.am.end);
     4089      Print("  len_gen %d",r->typ[j].data.am.len_gen);
     4090      PrintS(" w:");
     4091      int l=0;
     4092      for(l=r->typ[j].data.am.start;l<=r->typ[j].data.am.end;l++)
     4093            Print(" %d",r->typ[j].data.am.weights[l-r->typ[j].data.am.start]);
     4094      l=r->typ[j].data.am.end+1;
     4095      int ll=r->typ[j].data.am.weights[l-r->typ[j].data.am.start];
     4096      PrintS(" m:");
     4097      for(int lll=l+1;lll<l+ll+1;lll++)
     4098            Print(" %d",r->typ[j].data.am.weights[lll-r->typ[j].data.am.start]);
     4099    }
    40294100    else
    40304101    {
     
    41144185      pFDeg_CASE(p_TotaldegreeIS); else
    41154186#undef pFDeg_CASE
    4116      
    41174187      Print("(%p)", (void*)(r->pFDeg)); // default case
    41184188
    41194189    PrintLn();
    4120     Print("pLDeg   : (%p)", (void*)(r->pLDeg));   
     4190    Print("pLDeg   : (%p)", (void*)(r->pLDeg));
    41214191    PrintLn();
    41224192  }
    4123 
     4193  Print("pSetm:");
     4194  void p_Setm_Dummy(poly p, const ring r);
     4195  void p_Setm_TotalDegree(poly p, const ring r);
     4196  void p_Setm_WFirstTotalDegree(poly p, const ring r);
     4197  void p_Setm_General(poly p, const ring r);
     4198  if (r->p_Setm==p_Setm_General) PrintS("p_Setm_General\n");
     4199  else if (r->p_Setm==p_Setm_Dummy) PrintS("p_Setm_Dummy\n");
     4200  else if (r->p_Setm==p_Setm_TotalDegree) PrintS("p_Setm_Totaldegree\n");
     4201  else if (r->p_Setm==p_Setm_WFirstTotalDegree) PrintS("p_Setm_WFirstTotalDegree\n");
     4202  else Print("%x\n",r->p_Setm);
    41244203}
    41254204
     
    45934672{
    45944673  rTest(r);
    4595    
     4674
    45964675  ring new_r_1 = rAssure_CompLastBlock(r, FALSE); // due to this FALSE - no completion!
    45974676  ring new_r = rAssure_SyzComp(new_r_1, FALSE); // new_r_1 is used only here!!!
     
    45994678  if (new_r == r)
    46004679     return r;
    4601      
     4680
    46024681  ring old_r = r;
    46034682  if (new_r_1 != new_r && new_r_1 != old_r) rDelete(new_r_1);
    4604      
     4683
    46054684   rComplete(new_r, 1);
    46064685#ifdef HAVE_PLURAL
     
    46104689       {
    46114690# ifndef NDEBUG
    4612           WarnS("error in nc_rComplete"); // cleanup?      rDelete(res);       return r;  // just go on...?
     4691          WarnS("error in nc_rComplete"); // cleanup?      rDelete(res);       return r;  // just go on...?
    46134692# endif
    46144693       }
    46154694   }
    46164695#endif
    4617      
     4696
    46184697///?    rChangeCurrRing(new_r);
    46194698   if (old_r->qideal != NULL)
     
    46284707       {
    46294708#ifndef NDEBUG
    4630           WarnS("error in nc_SetupQuotient"); // cleanup?      rDelete(res);       return r;  // just go on...?
     4709          WarnS("error in nc_SetupQuotient"); // cleanup?      rDelete(res);       return r;  // just go on...?
    46314710#endif
    46324711       }
     
    46394718   assume(ncRingType(new_r) == ncRingType(old_r));
    46404719#endif
    4641    
     4720
    46424721   rTest(new_r);
    46434722   rTest(old_r);
     
    55795658
    55805659  const BOOLEAN ret = nCoeff_is_algExt(C);
    5581  
     5660
    55825661  if( ret )
    55835662  {
     
    55865665    assume( !idIs0(R->minideal) );
    55875666  }
    5588  
     5667
    55895668  return ret;
    55905669}
     
    56145693  if( _filed_type == n_algExt )
    56155694    return naParam(iParameter, C);
    5616  
     5695
    56175696  if( _filed_type == n_transExt )
    56185697    return ntParam(iParameter, C);
    5619    
     5698
    56205699  return NULL;
    56215700}
  • libpolys/polys/monomials/ring.h

    r8d8cd94 rf93c5e9  
    5555  ro_dp, // ordering is a degree ordering
    5656  ro_wp, // ordering is a weighted degree ordering
     57  ro_am, // ordering is am: weights for vars + weights for gen
    5758  ro_wp64, // ordering is a weighted64 degree ordering
    5859  ro_wp_neg, // ordering is a weighted degree ordering
     
    8687
    8788// ordering is a weighted degree ordering
     89struct sro_am
     90{
     91  short place;  // where weighted degree is stored (in L)
     92  short start;  // bounds of ordering (in E)
     93  short end;
     94  short len_gen; // i>len_gen: weight(gen(i)):=0
     95  int *weights; // pointers into wvhdl field of length (end-start+1) + len_gen
     96                // contents w_1,... w_n, len, mod_w_1, .. mod_w_len, 0
     97};
     98typedef struct sro_am sro_am;
     99
     100// ordering is a weighted degree ordering
    88101struct sro_wp64
    89102{
     
    166179     sro_dp dp;
    167180     sro_wp wp;
     181     sro_am am;
    168182     sro_wp64 wp64;
    169183     sro_cp cp;
     
    600614  ringorder_ws,
    601615  ringorder_Ws,
     616  ringorder_am,
    602617  ringorder_L,
    603618  // the following are only used internally
Note: See TracChangeset for help on using the changeset viewer.