Changeset 9108d3 in git


Ignore:
Timestamp:
Jan 31, 2007, 4:22:22 PM (17 years ago)
Author:
Michael Brickenstein <bricken@…>
Branches:
(u'spielwiese', '4a9821a93ffdc22a6696668bd4f6b8c9de3e6c5f')
Children:
1cc61e18c0d6c70b177099c23a52159afb280bb4
Parents:
dd60f3c49de7f734e4192d72024b962103c34c8e
Message:
+ redSB in homog for lower degrees and cleaning


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

Legend:

Unmodified
Added
Removed
  • kernel/tgb.cc

    rdd60f3c r9108d3  
    55*  Computer Algebra System SINGULAR     *
    66****************************************/
    7 /* $Id: tgb.cc,v 1.119 2007-01-30 15:10:36 bricken Exp $ */
     7/* $Id: tgb.cc,v 1.120 2007-01-31 15:22:21 bricken Exp $ */
    88/*
    99* ABSTRACT: slimgb and F4 implementation
     
    1515///@TODO: delay nur auf Sugarvergrï¿œerung
    1616///@TODO: grade aus ecartS, setze dazu strat->honey; und nutze p.ecart
     17//@TODO: no tail reductions in syz comp
    1718#include "mod2.h"
    1819#include "tgb.h"
     
    330331    if (c->lastDpBlockStart<=pVariables){
    331332        int i;
    332         for(i=1;i<=pVariables;i++){
     333        for(i=1;i<c->lastDpBlockStart;i++){
    333334            if (p_GetExp(p,i,r)!=0){
    334335                break;
     
    910911    for (i=old_pos; i>new_pos; i--)
    911912      strat->lenSw[i] = strat->lenSw[i-1];
     913
     914  strat->S[new_pos]=p;
     915  strat->ecartS[new_pos]=ecart;
     916  strat->sevS[new_pos]=sev;
     917  strat->S_2_R[new_pos]=s_2_r;
     918  strat->lenS[new_pos]=length;
     919  if(strat->lenSw!=NULL)
     920    strat->lenSw[new_pos]=length_w;
     921  //assume(lenS_correct(strat));
     922}
     923
     924static void move_backward_in_S(int old_pos, int new_pos,kStrategy strat)
     925{
     926  assume(old_pos<=new_pos);
     927  poly p=strat->S[old_pos];
     928  int ecart=strat->ecartS[old_pos];
     929  long sev=strat->sevS[old_pos];
     930  int s_2_r=strat->S_2_R[old_pos];
     931  int length=strat->lenS[old_pos];
     932  assume(length==pLength(strat->S[old_pos]));
     933  wlen_type length_w;
     934  if(strat->lenSw!=NULL)
     935    length_w=strat->lenSw[old_pos];
     936  int i;
     937  for (i=old_pos; i<new_pos; i++)
     938  {
     939    strat->S[i] = strat->S[i+1];
     940    strat->ecartS[i] = strat->ecartS[i+1];
     941    strat->sevS[i] = strat->sevS[i+1];
     942    strat->S_2_R[i] = strat->S_2_R[i+1];
     943  }
     944  if (strat->lenS!=NULL)
     945    for (i=old_pos; i<new_pos; i++)
     946      strat->lenS[i] = strat->lenS[i+1];
     947  if (strat->lenSw!=NULL)
     948    for (i=old_pos; i<new_pos; i++)
     949      strat->lenSw[i] = strat->lenSw[i+1];
    912950
    913951  strat->S[new_pos]=p;
     
    19682006
    19692007    //if (!c->nc) {
    1970       if ((TEST_OPT_REDTAIL)&&(c->S->rank<=1)){
     2008      if (c->tailReductions){
    19712009      p=redNFTail(p,c->strat->sl,c->strat, 0);
    19722010      } else {
     
    22632301}
    22642302slimgb_alg::slimgb_alg(ideal I, int syz_comp,BOOLEAN F4){
     2303  lastCleanedDeg=-1;
    22652304  completed=FALSE;
    22662305  this->syz_comp=syz_comp;
     
    22882327    }
    22892328  }
    2290   eliminationProblem=((!(is_homog))&&((pLexOrder)||(I->rank>0)));
    2291 
     2329  eliminationProblem=((!(is_homog))&&((pLexOrder)||(I->rank>1)));
     2330  tailReductions=((is_homog)||((TEST_OPT_REDTAIL)&&(!(I->rank>1))));
    22922331  //  Print("is homog:%d",c->is_homog);
    22932332  void* h;
     
    27842823  else return (c->apairs[c->pair_top--]);
    27852824}
     2825void slimgb_alg::cleanDegs(int lower, int upper){
     2826  assume(is_homog);
     2827  int deg;
     2828  if (TEST_OPT_PROT){
     2829    PrintS("C");
     2830  }
     2831  for(deg=lower;deg<=upper;deg++){
     2832    int i;
     2833    for(i=0;i<n;i++){
     2834      if (T_deg[i]==deg){
     2835          poly h;
     2836          h=S->m[i];
     2837          h=redNFTail(h,strat->sl,strat,lengths[i]);
     2838          if (!rField_is_Zp(r))
     2839          {
     2840            pContent(h);
     2841            pCleardenom(h);//should be unnecessary
     2842          } else pNorm(h);
     2843          //TODO:GCD of TERMS
     2844          poly got=::gcd_of_terms(h,r);
     2845          p_Delete(&gcd_of_terms[i],r);
     2846          gcd_of_terms[i]=got;
     2847          int len=pLength(h);
     2848          wlen_type wlen=pQuality(h,this,len);
     2849          if (weighted_lengths)
     2850            weighted_lengths[i]=wlen;
     2851          lengths[i]=len;
     2852          assume(h==S->m[i]);
     2853          int j;
     2854          for(j=0;j<=strat->sl;j++){
     2855            if (h==strat->S[j]){
     2856              int new_pos=simple_posInS(strat, h,len, wlen);
     2857              if (strat->lenS){
     2858                strat->lenS[j]=len;
     2859              }
     2860              if (strat->lenSw){
     2861                strat->lenSw[j]=wlen;
     2862              }
     2863              if (new_pos<j){
     2864                move_forward_in_S(j,new_pos,strat);
     2865              }else{
     2866                if (new_pos>j)
     2867                 new_pos=new_pos-1;//is identical with one element
     2868                if (new_pos>j)
     2869                  move_backward_in_S(j,new_pos,strat);
     2870              }
     2871              break;
     2872            }
     2873          }
     2874        }
     2875       
     2876    }
     2877 
     2878  }
     2879  {
     2880    int i,j;
     2881    for(i=0;i<this->n;i++){
     2882      for(j=0;j<i;j++){
     2883        if (T_deg[i]+T_deg[j]<=upper){
     2884          now_t_rep(i,j,this);
     2885        }
     2886      }
     2887    }
     2888  }
     2889  //TODO resort and update strat->S,strat->lenSw
     2890  //TODO mark pairs
     2891}
    27862892sorted_pair_node* top_pair(slimgb_alg* c){
    2787   super_clean_top_of_pair_list(c);//yeah, I know, it's odd that I use a different proc here
     2893  while(c->pair_top>=0){
     2894    super_clean_top_of_pair_list(c);//yeah, I know, it's odd that I use a different proc here
     2895    if ((c->is_homog)&&(c->pair_top>=0)&&(c->apairs[c->pair_top]->deg>=c->lastCleanedDeg+2)){
     2896      int upper=c->apairs[c->pair_top]->deg-1;
     2897      c->cleanDegs(c->lastCleanedDeg+1,upper);
     2898      c->lastCleanedDeg=upper;
     2899    } else{
     2900      break;
     2901    }
     2902   
     2903  }
     2904
    27882905
    27892906  if(c->pair_top<0) return NULL;
  • kernel/tgb_internal.h

    rdd60f3c r9108d3  
    55*  Computer Algebra System SINGULAR     *
    66****************************************/
    7 /* $Id: tgb_internal.h,v 1.47 2006-11-09 11:14:50 bricken Exp $ */
     7/* $Id: tgb_internal.h,v 1.48 2007-01-31 15:22:22 bricken Exp $ */
    88/*
    99 * ABSTRACT: tgb internal .h file
     
    103103                void introduceDelayedPairs(poly* pa,int s);
    104104    virtual ~slimgb_alg();
     105    void cleanDegs(int lower, int upper);
    105106#ifndef HAVE_BOOST
    106107#ifdef USE_STDVECBOOL
     
    158159  int average_length;
    159160  int lastDpBlockStart;
     161  int lastCleanedDeg;
    160162  BOOLEAN isDifficultField;
    161163  BOOLEAN completed;
    162164  BOOLEAN is_homog;
    163  
     165  BOOLEAN tailReductions;
    164166  BOOLEAN eliminationProblem;
    165167  BOOLEAN F4_mode;
Note: See TracChangeset for help on using the changeset viewer.