Changeset f2b5839 in git


Ignore:
Timestamp:
Jun 9, 2008, 8:16:04 AM (15 years ago)
Author:
Michael Brickenstein <bricken@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
52e2f60700ff18f1b002b09ada312e11d8a71027
Parents:
ee586a66c94f553b815e0af833a1d2aba622d56f
Message:
+ last block things


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

Legend:

Unmodified
Added
Removed
  • kernel/tgb.cc

    ree586a rf2b5839  
    55*  Computer Algebra System SINGULAR     *
    66****************************************/
    7 /* $Id: tgb.cc,v 1.153 2008-03-19 17:44:12 Singular Exp $ */
     7/* $Id: tgb.cc,v 1.154 2008-06-09 06:16:03 bricken Exp $ */
    88/*
    99* ABSTRACT: slimgb and F4 implementation
     
    351351    return FALSE;
    352352}
    353 static BOOLEAN get_last_dp_block_start(ring r){
     353
     354static BOOLEAN lies_in_last_dp_block(poly p, slimgb_alg* c){
     355    ring r=c->r;
     356    if (p_GetComp(p,r)!=0) return FALSE;
     357    if (c->lastDpBlockStart<=pVariables){
     358        int i;
     359        for(i=1;i<c->lastDpBlockStart;i++){
     360            if (p_GetExp(p,i,r)!=0){
     361                break;
     362            }
     363        }
     364        if (i>=c->lastDpBlockStart) {
     365        //wrp(p);
     366        //PrintS("\n");
     367        return TRUE;
     368        }
     369        else return FALSE;
     370    }else
     371    return FALSE;
     372}
     373
     374static int get_last_dp_block_start(ring r){
    354375    //ring r=c->r;
    355376    int last_block;
     
    11351156
    11361157
    1137 static void add_later(poly p, const char* prot, slimgb_alg* c)
    1138 {
     1158static void add_later(poly p, char* prot, slimgb_alg* c){
    11391159    int i=0;
    11401160    //check, if it is already in the queue
    11411161
    11421162
    1143     while(c->add_later->m[i]!=NULL)
    1144     {
     1163    while(c->add_later->m[i]!=NULL){
    11451164        if (p_LmEqual(c->add_later->m[i],p,c->r))
    11461165            return;
     
    23682387  qsort(terms,reduced_sum,sizeof(poly),terms_sort_crit);
    23692388  int nterms=reduced_sum;
    2370   if (TEST_OPT_PROT)
    2371     Print("orig estimation:%i\n",reduced_sum);
     2389  //if (TEST_OPT_PROT)
     2390  //Print("orig estimation:%i\n",reduced_sum);
    23722391  unify_terms(terms,nterms);
    2373   if (TEST_OPT_PROT)
    2374     Print("actual number of columns:%i\n",nterms);
     2392  //if (TEST_OPT_PROT)
     2393  //    Print("actual number of columns:%i\n",nterms);
    23752394  int rank=reduced_c;
    23762395  linalg_step_modp(reduced, p,rank,terms,nterms,c);
     
    23942413  #ifdef USE_NORO
    23952414  //Print("module rank%d\n",c->S->rank);
    2396   const BOOLEAN use_noro=((!(c->nc))&&(c->S->rank<=1)&&(rField_is_Zp(c->r)) &&(!(c->eliminationProblem))&&(npPrimeM<=32003));
     2415    const BOOLEAN use_noro=c->use_noro;
    23972416  #else
    23982417  const BOOLEAN use_noro=FALSE;
     
    24062425  i=0;
    24072426  int max_pairs=bundle_size;
    2408   if (use_noro)
     2427 
     2428  #ifdef USE_NORO
     2429  if ((use_noro)||(c->use_noro_last_block))
    24092430    max_pairs=bundle_size_noro;
     2431  #endif
    24102432  poly* p=(poly*) omalloc((max_pairs+1)*sizeof(poly));//nullterminated
    24112433
     
    25002522    }
    25012523   
    2502     if (TEST_OPT_PROT){
    2503       Print("reported rank:%i\n",pn);
    2504     }
     2524    //if (TEST_OPT_PROT){
     2525    //  Print("reported rank:%i\n",pn);
     2526    //}
    25052527    mass_add(p,pn,c);
    25062528    omfree(p);
     
    25802602
    25812603    //if (!c->nc) {
    2582       if (c->tailReductions){
     2604      if ((c->tailReductions) ||(lies_in_last_dp_block(p,c))){
    25832605      p=redNFTail(p,c->strat->sl,c->strat, 0);
    25842606      } else {
     
    29722994  idDelete(&I);
    29732995  add_later=idInit(ADD_LATER_SIZE,S->rank);
     2996  #ifdef USE_NORO
     2997  use_noro=((!(nc))&&(S->rank<=1)&&(rField_is_Zp(r)) &&(!(eliminationProblem))&&(npPrimeM<=32003));
     2998  use_noro_last_block=false;
     2999  if ((!(use_noro))&&(lastDpBlockStart<=pVariables)){
     3000      use_noro_last_block=((!(nc))&&(S->rank<=1)&&(rField_is_Zp(r)) &&(npPrimeM<=32003));
     3001  }
     3002  #else
     3003  use_noro=false;
     3004  use_noro_last_block=false;
     3005  #endif
     3006  //Print("NORO last block %i",use_noro_last_block);
    29743007  memset(add_later->m,0,ADD_LATER_SIZE*sizeof(poly));
    29753008}
     
    41234156  // nullen loeschen
    41244157  while(curr_pos>=0){
    4125 
     4158    if ((c->use_noro_last_block)&&(lies_in_last_dp_block(los[curr_pos].p,c))){
     4159        PrintS("L");
     4160        int pn_noro=curr_pos+1;
     4161        poly* p_noro=(poly*) omalloc(pn_noro*sizeof(poly));
     4162        for(i=0;i<pn_noro;i++){
     4163            int dummy_len;
     4164            poly p;
     4165            los[i].p=NULL;
     4166            kBucketClear(los[i].bucket,&p,&dummy_len);
     4167            p_noro[i]=p;
     4168        }
     4169
     4170   
     4171        if (npPrimeM<255){
     4172          noro_step<tgb_uint8>(p_noro,pn_noro,c);
     4173        } else {
     4174          if (npPrimeM<65000){
     4175            noro_step<tgb_uint16>(p_noro,pn_noro,c);
     4176          } else{
     4177            noro_step<tgb_uint32>(p_noro,pn_noro,c);
     4178          }
     4179        }
     4180        for(i=0;i<pn_noro;i++){
     4181            los[i].p=p_noro[i];
     4182            los[i].sev=pGetShortExpVector(los[i].p);
     4183            //ignore quality
     4184            kBucketInit(los[i].bucket,los[i].p,pLength(los[i].p));
     4185           
     4186        }
     4187        qsort(los,pn_noro,sizeof(red_object),red_object_better_gen);
     4188        int deleted=multi_reduction_clear_zeroes(los, losl, pn_noro, curr_pos);
     4189        losl -= deleted;
     4190        curr_pos -= deleted;
     4191        break;
     4192    }
    41264193    find_erg erg;
     4194   
    41274195    multi_reduction_find(los, losl,c,curr_pos,erg);//last argument should be curr_pos
    41284196    if(erg.reduce_by<0) break;
    41294197
    4130 
    4131 
     4198   
     4199   
    41324200    erg.expand=NULL;
    41334201    int d=erg.to_reduce_u-erg.to_reduce_l+1;
  • kernel/tgb_internal.h

    ree586a rf2b5839  
    55*  Computer Algebra System SINGULAR     *
    66****************************************/
    7 /* $Id: tgb_internal.h,v 1.69 2007-02-27 10:40:57 bricken Exp $ */
     7/* $Id: tgb_internal.h,v 1.70 2008-06-09 06:16:04 bricken Exp $ */
    88/*
    99 * ABSTRACT: tgb internal .h file
     
    1919#include "stdlib.h"
    2020#include <modulop.h>
    21 //#define USE_NORO 1
     21#define USE_NORO 1
    2222
    2323
     
    241241  int lastDpBlockStart;
    242242  int lastCleanedDeg;
     243  BOOLEAN use_noro;
     244  BOOLEAN use_noro_last_block;
    243245  BOOLEAN isDifficultField;
    244246  BOOLEAN completed;
     
    15291531template <class number_type > void simplest_gauss_modp(number_type* a, int nrows,int ncols){
    15301532  //use memmoves for changing rows
    1531   if (TEST_OPT_PROT)
    1532     PrintS("StartGauss\n");
     1533  //if (TEST_OPT_PROT)
     1534  //    PrintS("StartGauss\n");
    15331535  ModPMatrixProxyOnArray<number_type> mat(a,nrows,ncols);
    15341536 
     
    15441546  backmat.backwardSubstitute();
    15451547  //backward substitutions
    1546   if (TEST_OPT_PROT)
    1547     PrintS("StopGauss\n");
     1548  //if (TEST_OPT_PROT)
     1549  //PrintS("StopGauss\n");
    15481550}
    15491551//int term_nodes_sort_crit(const void* a, const void* b);
Note: See TracChangeset for help on using the changeset viewer.