Changeset 5f4463 in git for kernel/tgb.cc


Ignore:
Timestamp:
Apr 11, 2011, 6:39:34 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
5beac5a8a177a4d4938cbc1e887bbd115a393f3a
Parents:
16733868763266ec04dae72db238bced32663735
Message:
making the sun-c/c++ compiler happy (still waiting for to issues...)



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

Legend:

Unmodified
Added
Removed
  • kernel/tgb.cc

    r1673386 r5f4463  
    11051105  int* i_con =make_connections(i,j,lm,c);
    11061106
    1107   for (int n=0;((n<c->n) && (i_con[n]>=0));n++){
    1108     if (i_con[n]==j){
     1107  for (int n=0;((n<c->n) && (i_con[n]>=0));n++)
     1108  {
     1109    if (i_con[n]==j)
     1110    {
    11091111      now_t_rep(i,j,c);
    11101112      omfree(i_con);
     
    11271129  int sugar=c->pTotaldegree(lm);
    11281130  p_Delete(&lm, c->r);
    1129     if(c->T_deg_full)//Sugar
    1130     {
    1131       int t_i=c->T_deg_full[i]-c->T_deg[i];
    1132       int t_j=c->T_deg_full[j]-c->T_deg[j];
    1133       sugar+=si_max(t_i,t_j);
    1134       //Print("\n max: %d\n",max(t_i,t_j));
    1135     }
    1136 
    1137 
    1138 
    1139 
    1140 
    1141   for (int m=0;((m<c->n) && (i_con[m]>=0));m++){
    1142     if(c->T_deg_full!=NULL){
     1131  if(c->T_deg_full)//Sugar
     1132  {
     1133    int t_i=c->T_deg_full[i]-c->T_deg[i];
     1134    int t_j=c->T_deg_full[j]-c->T_deg[j];
     1135    sugar+=si_max(t_i,t_j);
     1136    //Print("\n max: %d\n",max(t_i,t_j));
     1137  }
     1138
     1139  for (int m=0;((m<c->n) && (i_con[m]>=0));m++)
     1140  {
     1141    if(c->T_deg_full!=NULL)
     1142    {
    11431143        int s1=c->T_deg_full[i_con[m]]+syz_deg-c->T_deg[i_con[m]];
    11441144        if (s1>sugar) continue;
     
    11461146    if (c->weighted_lengths[i_con[m]]<c->weighted_lengths[i])
    11471147        i=i_con[m];
    1148     }
    1149     for (int m=0;((m<c->n) && (j_con[m]>=0));m++){
    1150         if (c->T_deg_full!=NULL){
    1151         int s1=c->T_deg_full[j_con[m]]+syz_deg-c->T_deg[j_con[m]];
    1152         if (s1>sugar) continue;}
    1153         if (c->weighted_lengths[j_con[m]]<c->weighted_lengths[j])
    1154             j=j_con[m];
    1155     }
    1156 
    1157      //can also try dependend search
     1148  }
     1149  for (int m=0;((m<c->n) && (j_con[m]>=0));m++)
     1150  {
     1151    if (c->T_deg_full!=NULL)
     1152    {
     1153      int s1=c->T_deg_full[j_con[m]]+syz_deg-c->T_deg[j_con[m]];
     1154      if (s1>sugar) continue;
     1155    }
     1156    if (c->weighted_lengths[j_con[m]]<c->weighted_lengths[j])
     1157      j=j_con[m];
     1158  }
     1159
     1160  //can also try dependend search
    11581161  omfree(i_con);
    11591162  omfree(j_con);
    1160   return;
    11611163}
    11621164
     
    12101212
    12111213
    1212 static int iq_crit(const void* ap,const void* bp){
    1213 
     1214static int iq_crit(const void* ap,const void* bp)
     1215{
    12141216  sorted_pair_node* a=*((sorted_pair_node**)ap);
    12151217  sorted_pair_node* b=*((sorted_pair_node**)bp);
     
    15371539    for(upper=lower+1;upper<spc;upper++)
    15381540    {
    1539 
    15401541      if(!pLmEqual(nodes[lower]->lcm_of_lm,nodes[upper]->lcm_of_lm))
    15411542      {
     
    15431544      }
    15441545      if (has_t_rep(nodes[upper]->i,nodes[upper]->j,c))
    1545   has=TRUE;
    1546 
     1546        has=TRUE;
    15471547    }
    15481548    upper=upper-1;
     
    28652865  omfree(si_array);
    28662866}
    2867 slimgb_alg::slimgb_alg(ideal I, int syz_comp,BOOLEAN F4,int deg_pos){
    2868   this->deg_pos=deg_pos;
     2867slimgb_alg::slimgb_alg(ideal I, int ssyz_comp,BOOLEAN F4,int ddeg_pos)
     2868{
     2869  this->deg_pos=ddeg_pos;
    28692870  lastCleanedDeg=-1;
    28702871  completed=FALSE;
    2871   this->syz_comp=syz_comp;
     2872  this->syz_comp=ssyz_comp;
    28722873  r=currRing;
    28732874  nc=rIsPluralRing(r);
     
    28772878  {
    28782879    int hzz;
    2879     for(hzz=0;hzz<IDELEMS(I);hzz++){
     2880    for(hzz=0;hzz<IDELEMS(I);hzz++)
     2881    {
    28802882      assume(I->m[hzz]!=NULL);
    28812883      int d=this->pTotaldegree(I->m[hzz]);
     
    29302932  pair_top=-1;
    29312933
    2932   int n=IDELEMS(I);
    2933   array_lengths=n;
    2934 
     2934  int nn=IDELEMS(I);
     2935  array_lengths=nn;
    29352936
    29362937  i=0;
    29372938  this->n=0;
    2938   T_deg=(int*) omalloc(n*sizeof(int));
     2939  T_deg=(int*) omalloc(nn*sizeof(int));
    29392940  if(eliminationProblem)
    2940     T_deg_full=(int*) omalloc(n*sizeof(int));
     2941    T_deg_full=(int*) omalloc(nn*sizeof(int));
    29412942  else
    29422943    T_deg_full=NULL;
    2943   tmp_pair_lm=(poly*) omalloc(n*sizeof(poly));
    2944   tmp_spn=(sorted_pair_node**) omalloc(n*sizeof(sorted_pair_node*));
     2944  tmp_pair_lm=(poly*) omalloc(nn*sizeof(poly));
     2945  tmp_spn=(sorted_pair_node**) omalloc(nn*sizeof(sorted_pair_node*));
    29452946  lm_bin=omGetSpecBin(POLYSIZE + (r->ExpL_Size)*sizeof(long));
    29462947#ifdef HEAD_BIN
     
    29512952  #ifdef USE_STDVECBOOL
    29522953  #else
    2953   h=omalloc(n*sizeof(char*));
     2954  h=omalloc(nn*sizeof(char*));
    29542955
    29552956  states=(char**) h;
     
    29582959  h=omalloc(n*sizeof(int));
    29592960  lengths=(int*) h;
    2960   weighted_lengths=(wlen_type*)omalloc(n*sizeof(wlen_type));
    2961   gcd_of_terms=(poly*) omalloc(n*sizeof(poly));
    2962 
    2963   short_Exps=(long*) omalloc(n*sizeof(long));
     2961  weighted_lengths=(wlen_type*)omalloc(nn*sizeof(wlen_type));
     2962  gcd_of_terms=(poly*) omalloc(nn*sizeof(poly));
     2963
     2964  short_Exps=(long*) omalloc(nn*sizeof(long));
    29642965  if (F4_mode)
    2965     S=idInit(n,I->rank);
     2966    S=idInit(nn,I->rank);
    29662967  else
    29672968    S=idInit(1,I->rank);
     
    29762977  strat->enterS = enterSBba;
    29772978  strat->sl = -1;
    2978   i=n;
     2979  i=nn;
    29792980  i=1;//some strange bug else
    29802981  /* initS(c->S,NULL,c->strat); */
     
    29942995    strat->lenSw=NULL;
    29952996  sorted_pair_node* si;
    2996   assume(n>0);
     2997  assume(nn>0);
    29972998  add_to_basis_ideal_quotient(I->m[0],this,NULL);
    29982999
     
    30003001  if(!(F4_mode))
    30013002  {
    3002         poly* array_arg=I->m;
    3003         array_arg++;
    3004         introduceDelayedPairs(array_arg,n-1);
    3005         /*
    3006     for (i=1;i<n;i++)//the 1 is wanted, because first element is added to basis
     3003    poly* array_arg=I->m;
     3004    array_arg++;
     3005    introduceDelayedPairs(array_arg,nn-1);
     3006    /*
     3007    for (i=1;i<nn;i++)//the 1 is wanted, because first element is added to basis
    30073008    {
    30083009      //     add_to_basis(I->m[i],-1,-1,c);
     
    30183019      si->lcm_of_lm=I->m[i];
    30193020
    3020       //      c->apairs[n-1-i]=si;
    3021       apairs[n-i-1]=si;
     3021      //      c->apairs[nn-1-i]=si;
     3022      apairs[nn-i-1]=si;
    30223023      ++(pair_top);
    30233024    }*/
     
    30253026  else
    30263027  {
    3027     for (i=1;i<n;i++)//the 1 is wanted, because first element is added to basis
     3028    for (i=1;i<nn;i++)//the 1 is wanted, because first element is added to basis
    30283029      add_to_basis_ideal_quotient(I->m[i],this,NULL);
    30293030  }
     
    30373038  use_noro=((!(nc))&&(S->rank<=1)&&(rField_is_Zp(r)) &&(!(eliminationProblem))&&(npPrimeM<=32003));
    30383039  use_noro_last_block=false;
    3039   if ((!(use_noro))&&(lastDpBlockStart<=pVariables)){
     3040  if ((!(use_noro))&&(lastDpBlockStart<=pVariables))
     3041  {
    30403042      use_noro_last_block=((!(nc))&&(S->rank<=1)&&(rField_is_Zp(r)) &&(npPrimeM<=32003));
    30413043  }
     
    30473049  memset(add_later->m,0,ADD_LATER_SIZE*sizeof(poly));
    30483050}
    3049 slimgb_alg::~slimgb_alg(){
    3050 
    3051   if (!(completed)){
    3052       poly* add=(poly*) omalloc((pair_top+2)*sizeof(poly));
    3053       int piter;
    3054       int pos=0;
    3055       for(piter=0;piter<=pair_top;piter++){
    3056         sorted_pair_node* s=apairs[piter];
    3057         if (s->i<0){
    3058             //delayed element
    3059             if (s->lcm_of_lm!=NULL){
    3060                 add[pos]=s->lcm_of_lm;
    3061                 pos++;
    3062 
    3063             }
     3051slimgb_alg::~slimgb_alg()
     3052{
     3053  if (!(completed))
     3054  {
     3055    poly* add=(poly*) omalloc((pair_top+2)*sizeof(poly));
     3056    int piter;
     3057    int pos=0;
     3058    for(piter=0;piter<=pair_top;piter++)
     3059    {
     3060      sorted_pair_node* s=apairs[piter];
     3061      if (s->i<0)
     3062      {
     3063        //delayed element
     3064        if (s->lcm_of_lm!=NULL)
     3065        {
     3066          add[pos]=s->lcm_of_lm;
     3067          pos++;
    30643068        }
    3065 
    3066         free_sorted_pair_node(s,r);
    3067         apairs[piter]=NULL;
    3068       }
    3069       pair_top=-1;
    3070       add[pos]=NULL;
    3071       pos=0;
    3072       while(add[pos]!=NULL){
    3073         add_to_basis_ideal_quotient(add[pos],this,NULL);
    3074         pos++;
    3075       }
    3076       for(piter=0;piter<=pair_top;piter++){
    3077         sorted_pair_node* s=apairs[piter];
    3078         assume(s->i>=0);
    3079         free_sorted_pair_node(s,r);
    3080         apairs[piter]=NULL;
    3081       }
    3082       pair_top=-1;
     3069      }
     3070
     3071      free_sorted_pair_node(s,r);
     3072      apairs[piter]=NULL;
     3073    }
     3074    pair_top=-1;
     3075    add[pos]=NULL;
     3076    pos=0;
     3077    while(add[pos]!=NULL)
     3078    {
     3079      add_to_basis_ideal_quotient(add[pos],this,NULL);
     3080      pos++;
     3081    }
     3082    for(piter=0;piter<=pair_top;piter++)
     3083    {
     3084      sorted_pair_node* s=apairs[piter];
     3085      assume(s->i>=0);
     3086      free_sorted_pair_node(s,r);
     3087      apairs[piter]=NULL;
     3088    }
     3089    pair_top=-1;
    30833090  }
    30843091  id_Delete(&add_later,r);
     
    30943101  while(c->F)
    30953102  {
    3096     for(i=0;i<c->F->size;i++){
     3103    for(i=0;i<c->F->size;i++)
     3104    {
    30973105      pDelete(&(c->F->mp[i].m));
    30983106    }
     
    31053113  while(c->F_minus)
    31063114  {
    3107     for(i=0;i<c->F_minus->size;i++){
     3115    for(i=0;i<c->F_minus->size;i++)
     3116    {
    31083117      pDelete(&(c->F_minus->p[i]));
    31093118    }
     
    31163125  #ifndef HAVE_BOOST
    31173126  #ifndef USE_STDVECBOOL
    3118   for(int z=1 /* zero length at 0 */;z<c->n;z++){
     3127  for(int z=1 /* zero length at 0 */;z<c->n;z++)
     3128  {
    31193129    omfree(c->states[z]);
    31203130  }
     
    31423152  omFree(c->strat->S_2_R);
    31433153
    3144 
    31453154  omFree(c->strat->lenS);
    31463155
    31473156  if(c->strat->lenSw)  omFree(c->strat->lenSw);
    31483157
    3149 
    3150 
    3151 
    3152   for(i=0;i<c->n;i++){
     3158  for(i=0;i<c->n;i++)
     3159  {
    31533160    if(c->gcd_of_terms[i])
    31543161      pDelete(&(c->gcd_of_terms[i]));
     
    31663173  int deleted_form_c_s=0;
    31673174
    3168   for(i=0;i<=c->strat->sl;i++){
     3175  for(i=0;i<=c->strat->sl;i++)
     3176  {
    31693177    if (!c->strat->S[i]) continue;
    31703178    BOOLEAN found=FALSE;
    3171     for(j=0;j<c->n;j++){
    3172       if (c->S->m[j]==c->strat->S[i]){
     3179    for(j=0;j<c->n;j++)
     3180    {
     3181      if (c->S->m[j]==c->strat->S[i])
     3182      {
    31733183        found=TRUE;
    31743184        break;
     
    31903200//   }
    31913201
    3192   if (completed){
    3193   for(i=0;i<c->n;i++)
    3194   {
    3195     assume(c->S->m[i]!=NULL);
    3196     if (p_GetComp(c->S->m[i],currRing)>this->syz_comp) continue;
    3197     for(j=0;j<c->n;j++)
    3198     {
    3199       if((c->S->m[j]==NULL)||(i==j))
    3200         continue;
    3201       assume(p_LmShortDivisibleBy(c->S->m[j],c->short_Exps[j],
     3202  if (completed)
     3203  {
     3204    for(i=0;i<c->n;i++)
     3205    {
     3206      assume(c->S->m[i]!=NULL);
     3207      if (p_GetComp(c->S->m[i],currRing)>this->syz_comp) continue;
     3208      for(j=0;j<c->n;j++)
     3209      {
     3210        if((c->S->m[j]==NULL)||(i==j))
     3211          continue;
     3212        assume(p_LmShortDivisibleBy(c->S->m[j],c->short_Exps[j],
    32023213             c->S->m[i],~c->short_Exps[i],
    32033214             c->r)==p_LmDivisibleBy(c->S->m[j],
    32043215             c->S->m[i],
    32053216             c->r));
    3206       if (p_LmShortDivisibleBy(c->S->m[j],c->short_Exps[j],
     3217        if (p_LmShortDivisibleBy(c->S->m[j],c->short_Exps[j],
    32073218          c->S->m[i],~c->short_Exps[i],
    32083219          c->r))
    3209       {
    3210         pDelete(&c->S->m[i]);
    3211         break;
    3212       }
    3213     }
    3214   }
     3220        {
     3221          pDelete(&c->S->m[i]);
     3222          break;
     3223        }
     3224      }
     3225    }
    32153226  }
    32163227  omfree(c->short_Exps);
    3217 
    32183228
    32193229  ideal I=c->S;
Note: See TracChangeset for help on using the changeset viewer.