Changeset 172d852 in git for Singular/walk.cc


Ignore:
Timestamp:
Jan 24, 2019, 2:32:29 PM (5 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
08394f319ba420091cccad7e025c3f7cac04c373
Parents:
5abb79fd2458b47b21d297f2c8b26f285ac9546f756676ef1fcf4cff300fb1607a6d21293b253245
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2019-01-24 14:32:29+01:00
git-committer:
GitHub <noreply@github.com>2019-01-24 14:32:29+01:00
Message:
Merge pull request #906 from rbehrends/prelim-thread-rewrite

Singular changes for multi-threading support.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/walk.cc

    r5abb79f r172d852  
    7878#include "misc/mylimits.h"
    7979
    80 int nstep;
     80VAR int nstep;
    8181
    8282extern BOOLEAN ErrorCheck();
    8383
    84 extern BOOLEAN pSetm_error;
     84EXTERN_VAR BOOLEAN pSetm_error;
    8585
    8686void Set_Error( BOOLEAN f) { pSetm_error=f; }
    8787
    88 BOOLEAN Overflow_Error =  FALSE;
    89 
    90 #ifdef TIME_TEST
    91 clock_t xtif, xtstd, xtlift, xtred, xtnw;
    92 clock_t xftostd, xtextra, xftinput, to;
     88VAR BOOLEAN Overflow_Error =  FALSE;
     89
     90#ifdef TIME_TEST
     91VAR clock_t xtif, xtstd, xtlift, xtred, xtnw;
     92VAR clock_t xftostd, xtextra, xftinput, to;
    9393#endif
    9494
     
    15091509*  compute a perturbed weight vector of a matrix order w.r.t. an ideal  *
    15101510*************************************************************************/
    1511 int Xnlev;
     1511VAR int Xnlev;
    15121512intvec* Mfpertvector(ideal G, intvec* ivtarget)
    15131513{
     
    36563656 //mpz_out_str(stdout, 10, ndeg);
    36573657#endif
    3658   mpz_t deg_tmp;
     3658  VAR mpz_t deg_tmp;
    36593659  mpz_init_set(deg_tmp, ndeg);
    36603660
    3661   mpz_t *ivres=( mpz_t *) omAlloc(nV*sizeof(mpz_t));
     3661  VAR mpz_t *ivres=( mpz_t *) omAlloc(nV*sizeof(mpz_t));
    36623662  mpz_init_set_ui(ivres[nV-1],1);
    36633663
     
    36683668  }
    36693669
    3670   mpz_t *ivtmp=(mpz_t *)omAlloc(nV*sizeof(mpz_t));
     3670  VAR mpz_t *ivtmp=(mpz_t *)omAlloc(nV*sizeof(mpz_t));
    36713671  for(i=0; i<nV; i++)
    36723672  {
    36733673    mpz_init(ivtmp[i]);
    36743674  }
    3675   mpz_t sing_int;
     3675  VAR mpz_t sing_int;
    36763676  mpz_init_set_ui(sing_int,  2147483647);
    36773677
    3678   intvec* repr_vector = new intvec(nV);
     3678  VAR intvec* repr_vector = new intvec(nV);
    36793679
    36803680  // define ivtmp := ndeg^(n-1).w_1 + ndeg^(n-2).w_2 + ... + w_n
     
    36953695    }
    36963696  }
    3697   delete ivMat;
    3698 
    3699   int ntrue=0;
     3697  VAR delete ivMat;
     3698
     3699  VAR int ntrue=0;
    37003700  for(i=0; i<nV; i++)
    37013701  {
     
    37313731  mpz_clear(ndeg);
    37323732
    3733   return repr_vector;
     3733  VAR return repr_vector;
    37343734}
    37353735#endif
     
    37803780#endif
    37813781
    3782   mpz_t deg_tmp;
     3782  VAR mpz_t deg_tmp;
    37833783  mpz_init_set(deg_tmp, ndeg);
    37843784
    3785   mpz_t *ivres=(mpz_t *)omAlloc(nV*sizeof(mpz_t));
     3785  VAR mpz_t *ivres=(mpz_t *)omAlloc(nV*sizeof(mpz_t));
    37863786  mpz_init_set_ui(ivres[nV-1], 1);
    37873787
     
    37923792  }
    37933793
    3794   mpz_t sing_int;
     3794  VAR mpz_t sing_int;
    37953795  mpz_init_set_ui(sing_int,  2147483647);
    37963796
    3797   intvec* repr_vector = new intvec(nV);
    3798   int ntrue=0;
     3797  VAR intvec* repr_vector = new intvec(nV);
     3798  VAR int ntrue=0;
    37993799  for(i=0; i<nV; i++)
    38003800  {
     
    38273827  mpz_clear(sing_int);
    38283828
    3829   return repr_vector;
     3829  VAR return repr_vector;
    38303830}
    38313831#endif
     
    45034503}
    45044504
    4505 int ngleich;
    4506 intvec* Xsigma;
    4507 intvec* Xtau;
    4508 int xn;
    4509 intvec* Xivinput;
    4510 intvec* Xivlp;
     4505VAR int ngleich;
     4506VAR intvec* Xsigma;
     4507VAR intvec* Xtau;
     4508VAR int xn;
     4509VAR intvec* Xivinput;
     4510VAR intvec* Xivlp;
    45114511
    45124512
     
    69256925}
    69266926
    6927 intvec* XivNull;
     6927VAR intvec* XivNull;
    69286928
    69296929/*****************************
     
    69426942}
    69436943
    6944 int nnflow;
    6945 int Xcall;
    6946 int Xngleich;
     6944VAR int nnflow;
     6945VAR int Xcall;
     6946VAR int Xngleich;
    69476947
    69486948/***********************************************************************
     
    88358835
    88368836#ifdef TIME_TEST
    8837   clock_t tostd, tif=0, tstd=0, tlift=0, tred=0, tnw=0, textra=0;
    8838   clock_t tinput = clock();
    8839 #endif
    8840   int nsteppert=0, i, nV = currRing->N, nwalk=0, npert_tmp=0;
    8841   int *npert=(int*)omAlloc(2*nV*sizeof(int));
    8842   ideal Gomega, M,F,  G1, Gomega1, Gomega2, M1, F1;
     8837  VAR clock_t tostd, tif=0, tstd=0, tlift=0, tred=0, tnw=0, textra=0;
     8838  VAR clock_t tinput = clock();
     8839#endif
     8840  VAR int nsteppert=0, i, nV = currRing->N, nwalk=0, npert_tmp=0;
     8841  VAR int *npert=(int*)omAlloc(2*nV*sizeof(int));
     8842  INST_VAR ideal Gomega, M,F,  G1, Gomega1, Gomega2, M1, F1;
    88438843  //ring endRing;
    8844   ring newRing, oldRing, lpRing;
    8845   intvec* next_weight;
    8846   intvec* ivNull = new intvec(nV); //define (0,...,0)
    8847   intvec* iv_dp = MivUnit(nV);// define (1,1,...,1)
    8848   intvec* iv_lp = Mivlp(nV); //define (1,0,...,0)
    8849   ideal H0;
     8844  VAR ring newRing, oldRing, lpRing;
     8845  VAR intvec* next_weight;
     8846  VAR intvec* ivNull = new intvec(nV); //define (0,...,0)
     8847  VAR intvec* iv_dp = MivUnit(nV);// define (1,1,...,1)
     8848  VAR intvec* iv_lp = Mivlp(nV); //define (1,0,...,0)
     8849  INST_VAR ideal H0;
    88508850  //ideal H1;
    8851   ideal H2, Glp;
    8852   int weight_norm, nGB, endwalks = 0,  nwalkpert=0,  npertstep=0;
    8853   intvec* Mlp =  MivMatrixOrderlp(nV);
    8854   intvec* vector_tmp = new intvec(nV);
     8851  INST_VAR ideal H2, Glp;
     8852  VAR int weight_norm, nGB, endwalks = 0,  nwalkpert=0,  npertstep=0;
     8853  VAR intvec* Mlp =  MivMatrixOrderlp(nV);
     8854  VAR intvec* vector_tmp = new intvec(nV);
    88558855#ifndef BUCHBERGER_ALG
    8856   intvec* hilb_func;
     8856  VAR intvec* hilb_func;
    88578857#endif
    88588858  // to avoid (1,0,...,0) as the target vector
    8859   intvec* last_omega = new intvec(nV);
     8859  VAR intvec* last_omega = new intvec(nV);
    88608860  for(i=nV-1; i>0; i--)
    88618861  {
     
    88658865
    88668866//intvec* extra_curr_weight = new intvec(nV);
    8867   intvec* target_weight = new intvec(nV);
     8867  VAR intvec* target_weight = new intvec(nV);
    88688868  for(i=nV-1; i>=0; i--)
    88698869  {
    88708870    (*target_weight)[i] = (*target_tmp)[i];
    88718871  }
    8872   ring XXRing = currRing;
     8872  VAR ring XXRing = currRing;
    88738873  newRing = currRing;
    88748874
     
    89018901
    89028902#ifdef REPRESENTATION_OF_SIGMA
    8903   ideal Gw = MwalkInitialForm(G, curr_weight);
     8903  INST_VAR ideal Gw = MwalkInitialForm(G, curr_weight);
    89048904
    89058905  if(islengthpoly2(Gw)==1)
     
    89428942
    89438943  idDelete(&Gw);
    8944   delete iv_dp;
     8944  VAR delete iv_dp;
    89458945#endif
    89468946
     
    93559355 FINISH:
    93569356  delete ivNull;
    9357   delete next_weight;
    9358   delete iv_lp;
     9357  VAR delete next_weight;
     9358  VAR delete iv_lp;
    93599359  omFree(npert);
    93609360
Note: See TracChangeset for help on using the changeset viewer.