Changeset 1f6812 in git


Ignore:
Timestamp:
Feb 14, 2003, 9:18:18 PM (21 years ago)
Author:
Michael Brickenstein <bricken@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
2217b4e28cf2e51884ba5badccb31db717fd34f5
Parents:
335eeed94f74c9b1536e445cd619be96c31754b8
Message:
*bricken: further work on multireductions


git-svn-id: file:///usr/local/Singular/svn/trunk@6502 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Singular/tgb.cc

    r335eee r1f6812  
    66#include "tgb.h"
    77#define OM_KEEP 0
    8 #define LEN_VAR4
     8#define LEN_VAR1
    99
    1010#ifdef LEN_VAR1
     
    277277
    278278
    279 #ifdef RANDOM_WALK
    280 int my_rand(int n){
    281   //RANDOM integer beetween 0,..,n-1
    282   int erg=(double(rand())/RAND_MAX) *n;
    283   return ((erg>=n)?erg-1:erg);
    284 }
    285 #endif
    286279
    287280static BOOLEAN is_empty(calc_dat* c){
     
    356349  return s;
    357350}
    358 static BOOLEAN find_next_pair(calc_dat* c, BOOLEAN go_higher)
    359 {
    360   int start_i,start_j,i,j;
    361   start_i=0;
    362   start_j=-1;
    363 #ifndef HOMOGENEOUS_EXAMPLE
    364   if (c->misses_series>80){
    365     c->current_degree++;
    366     c->misses_series=0;
    367   }
    368 #endif
    369   start_i=c->continue_i;
    370   start_j=c->continue_j;
    371 
    372   for (int i=start_i;i<c->n;i++){
    373     if (c->T_deg[i]>c->current_degree)
    374     {
    375       c->skipped_pairs++;
    376       continue;
    377     }
    378     for(int j=(i==start_i)?start_j+1:0;j<i;j++){
    379       // printf("searching at %d,%d",i,j);
    380       if (c->misses_counter>=2) {
    381         c->skipped_pairs++;
    382         break;
    383       }
    384       if (c->states[i][j]==UNCALCULATED){
    385         if(c->deg[i][j]<=c->current_degree)
    386         {
    387           c->continue_i=c->found_i=i;
    388           c->continue_j=c->found_j=j;
    389           return TRUE;
    390         }
    391         else
    392         {
    393           ++(c->skipped_pairs);
    394         }
    395       }
    396     }
    397     c->misses_counter=0;
    398   }
    399 
    400   if (!((start_i==1) &&(start_j==0))){
    401     c->continue_i=1;
    402     c->continue_j=0;
    403     return find_next_pair(c);
    404   }
    405 
    406   if ((c->skipped_pairs>0) && go_higher){
    407     ++(c->current_degree);
    408     c->skipped_pairs=0;
    409     c->continue_i=0;
    410     c->continue_j=0;
    411     return find_next_pair(c);
    412   }
    413   return FALSE;
    414 }
     351
    415352static void move_forward_in_S(int old_pos, int new_pos,kStrategy strat, BOOLEAN is_char0)
    416353{
     
    15411478}
    15421479
     1480static BOOLEAN redNF2_pseudo (redNF_inf* obj,calc_dat* c, int n){
     1481  if(obj->P->p==NULL) {obj->h=NULL; return TRUE;}
     1482  LObject** P= (LObject**) omalloc(sizeof(LObject*));
     1483  P[0]=obj->P;
     1484  int nonzero=1;
     1485  multi_reduction(P, nonzero, c);
     1486  if(nonzero) {
     1487    int len;
     1488    kBucketClear(P[0]->bucket,&(obj->h), & len);
     1489} else
     1490 {
     1491   obj->h=NULL;
     1492   obj->P=NULL;
     1493}
     1494  omfree(P);
     1495  return TRUE;
     1496}
    15431497static BOOLEAN redNF2_n_steps (redNF_inf* obj,calc_dat* c, int n)
    15441498{
     
    20371991      if (!c->work_on[i].is_free){
    20381992//        Print("Computing i=%i,j=%i",c->work_on[i].i,c->work_on[i].j);
    2039         if(redNF2_n_steps(&(c->work_on[i]),c,((c->reduction_steps+50)/(c->normal_forms+1))/4+5)){
     1993        if(redNF2_pseudo(&(c->work_on[i]),c,((c->reduction_steps+50)/(c->normal_forms+1))/4+5)){
    20401994
    20411995
     
    25792533        erg.swap_roles=FALSE;
    25802534      }
    2581       return;
     2535 
    25822536    }
    25832537      else
     
    26542608  }
    26552609  if(erg.swap_roles){
     2610    PrintS("b");
    26562611    poly clear_into;
    26572612    int dummy_len;
     
    26952650  else                     
    26962651    pNorm(clear_into);
    2697     if (new_pos<j)
     2652    if (new_pos<j){
    26982653      move_forward_in_S(j,new_pos,c->strat,c->is_char0);
    2699 
     2654      erg.reduce_by=new_pos;
     2655    }
    27002656  }
    27012657}
     
    27242680      //not reduceable, try to use this for reducing higher terms
    27252681      int i2;
    2726       for (i2=i+1;i2<=losl;i2++){
     2682      for (i2=i+1;i2<losl;i2++){
    27272683        if (p_LmShortDivisibleBy(los[i]->p,los[i]->sev,los[i2]->p,los[i2]->sev,
    27282684                                c->r)){
     
    28112767    los[i]->p=kBucketGetLm(los[i]->bucket);
    28122768  }
    2813   poly h=kBucketGetLm(los[i]->bucket);
     2769
    28142770  kStrategy strat=c->strat;
    28152771  int curr_pos=losl-1;
     
    28412797    for(i=erg.to_reduce_l;i<=erg.to_reduce_u;i++)
    28422798    {
    2843       assume((!erg.fromS)||(i!=erg.reduce_by));
     2799   
     2800      assume((erg.fromS)||(i!=erg.reduce_by));
     2801      assume(reductor!=NULL);
    28442802       number coef=kBucketPolyRed(los[i]->bucket,reductor,
    28452803                                  len,
  • Singular/tgb.h

    r335eee r1f6812  
    135135BOOLEAN extended_product_criterion(poly p1, poly gcd1, poly p2, poly gcd2, calc_dat* c);
    136136static poly kBucketGcd(kBucket* b, ring r);
     137static void multi_reduction(LObject** los, int & losl, calc_dat* c);
    137138#endif
Note: See TracChangeset for help on using the changeset viewer.