Enumerations | Functions
walkMain.h File Reference
#include <misc/intvec.h>
#include <misc/int64vec.h>

Go to the source code of this file.

Enumerations

enum  WalkState {
  WalkNoIdeal, WalkIncompatibleRings, WalkIntvecProblem, WalkOverFlowError,
  WalkIncompatibleDestRing, WalkIncompatibleSourceRing, WalkOk
}
 

Functions

WalkState walkstep64 (ideal &G, int64vec *currw, int step)
 
WalkState walk64 (ideal I, int64vec *currw64, ring destRing, int64vec *destVec64, ideal &destIdeal, BOOLEAN sourceIsSB=FALSE)
 
WalkState fractalWalk64 (ideal sourceIdeal, ring destRing, ideal &destIdeal, BOOLEAN sourceIsSB, BOOLEAN unperturbedStartVectorStrategy)
 
WalkState unperturbedFirstStep64 (ideal &G, int64vec *currw64, ring destRing)
 

Enumeration Type Documentation

enum WalkState
Enumerator
WalkNoIdeal 
WalkIncompatibleRings 
WalkIntvecProblem 
WalkOverFlowError 
WalkIncompatibleDestRing 
WalkIncompatibleSourceRing 
WalkOk 

Definition at line 7 of file walkMain.h.

7  {
12  /*
13  these could be defined to make error management more elegant
14  WalkOverFlowError1,
15  WalkOverFlowError2,
16  WalkOverFlowError3,
17  WalkOverFlowError4,
18  WalkOverFlowError5,
19  WalkOverFlowError6,
20  WalkOverFlowError7,
21  WalkOverFlowError8,
22  WalkOverFlowError9,
23  WalkOverFlowError10,
24  WalkOverFlowError11,
25  WalkOverFlowError12,
26  WalkOverFlowError13,
27  */
30  WalkOk
31 
32 };

Function Documentation

WalkState fractalWalk64 ( ideal  sourceIdeal,
ring  destRing,
ideal &  destIdeal,
BOOLEAN  sourceIsSB,
BOOLEAN  unperturbedStartVectorStrategy 
)

Definition at line 614 of file walkMain.cc.

617 {
618 
619  overflow_error=FALSE; //global
620  WalkState state=WalkOk;
621  BITSET save1,save2;
622  SI_SAVE_OPT(save1,save2);
623 
625  ideal G;
626 
627  if(!sourceIsSB)
628  {
629  G=idStd(sourceIdeal);
630  }
631 
632  else
633  {
634  G=idInterRed(idCopy(sourceIdeal));
635  }
636 
637  SI_RESTORE_OPT(save1,save2); //switches REDSB off
638 
639  //matrices for the orders of the rings
640  intvec *destMat=int64VecToIntVec(rGetGlobalOrderMatrix(destRing));
642 
643  int64vec* currw64=getNthRow64(currMat,1); //start vector
644 
645  state=firstFractalWalkStep64(G,currw64,currMat,destRing,
646  unperturbedStartVectorStrategy);
647  delete currMat;
648 
649  state=fractalRec64(G,currw64,destMat,1,1);
650  if(state==WalkOk)
651  destIdeal=G;
652 
653  if(overflow_error)
654  state=WalkOverFlowError;
655 
656  delete currw64;
657  delete destMat;
658  return state;
659 }
#define OPT_REDSB
Definition: options.h:71
int overflow_error
Definition: walkMain.cc:37
unsigned si_opt_1
Definition: options.c:5
WalkState
Definition: walkMain.h:7
#define FALSE
Definition: auxiliary.h:140
int64vec * getNthRow64(intvec *v, int n)
Definition: walkSupport.cc:184
static TreeM * G
Definition: janet.cc:38
#define BITSET
Definition: structs.h:17
#define Sy_bit(x)
Definition: options.h:30
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
#define SI_RESTORE_OPT(A, B)
Definition: options.h:22
ideal idStd(ideal G)
Definition: walkSupport.cc:941
Definition: intvec.h:16
#define OPT_REDTAIL
Definition: options.h:86
ideal idInterRed(ideal G)
Definition: walkSupport.cc:961
WalkState firstFractalWalkStep64(ideal &G, int64vec *&currw64, intvec *currMat, ring destRing, BOOLEAN unperturbedStartVectorStrategy)
Definition: walkMain.cc:311
WalkState fractalRec64(ideal &G, int64vec *currw64, intvec *destMat, int level, int step)
Definition: walkMain.cc:434
ideal idCopy(ideal A)
Definition: ideals.h:76
#define SI_SAVE_OPT(A, B)
Definition: options.h:19
int64vec * rGetGlobalOrderMatrix(ring r)
intvec * int64VecToIntVec(int64vec *source)
WalkState unperturbedFirstStep64 ( ideal &  G,
int64vec currw64,
ring  destRing 
)

Definition at line 358 of file walkMain.cc.

359 {
360  WalkState state=WalkOk;
361  /* OLDRING **************************************************** */
362  ideal nextG;
363  BITSET save1,save2;
364  SI_SAVE_OPT(save1,save2);
365 
366  if (currwOnBorder64(G,currw64))
367  {
368  ideal Gw=init64(G,currw64);
369  ring oldRing=currRing;
370  /* NEWRING **************************************************** */
371  ring rnew=rCopy0AndAddA(destRing,currw64);
372  rComplete(rnew);
373  rChangeCurrRing(rnew);
374 
375  ideal newGw=idrMoveR(Gw, oldRing,rnew);
376 
377  //turn off bucket representation of polynomials and on redSB
378  //si_opt_1|=Sy_bit(OPT_NOT_BUCKETS);
380 
381  ideal newStdGw=idStd(newGw);
382 
383  //turn on bucket representation of polynomials and off redSB
384  SI_RESTORE_OPT(save1,save2);
385 
386  matrix L=matIdLift(newGw,newStdGw);
387  idDelete(&newStdGw);
388  idDelete(&newGw);
389 
390  nextG=idrMoveR(G,oldRing,rnew); idTest(nextG);
391 
392  matrix nextGmat=(matrix)nextG;
393 
394  matrix resMat=mp_Mult(nextGmat,L,rnew);
395  idDelete((ideal *)&nextGmat);
396  idDelete((ideal *)&L);
397 
398  nextG=(ideal)resMat;
399 
401  nextG = idInterRed(nextG);
402  SI_RESTORE_OPT(save1,save2);
403  }
404  else
405  {
406  ring oldRing=currRing;
407  ring rnew=rCopy0AndAddA(destRing,currw64);
408  rComplete(rnew);
409  rChangeCurrRing(rnew);
410  nextG=idrMoveR(G,oldRing,rnew);
411  }
412 
413  G=nextG;
414  return(state);
415 }
#define OPT_REDSB
Definition: options.h:71
unsigned si_opt_1
Definition: options.c:5
WalkState
Definition: walkMain.h:7
ring rCopy0AndAddA(const ring r, int64vec *wv64, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition: ring.cc:1461
static TreeM * G
Definition: janet.cc:38
#define BITSET
Definition: structs.h:17
#define Sy_bit(x)
Definition: options.h:30
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
#define SI_RESTORE_OPT(A, B)
Definition: options.h:22
ideal idStd(ideal G)
Definition: walkSupport.cc:941
BOOLEAN rComplete(ring r, int force)
this needs to be called whenever a new ring is created: new fields in ring are created (like VarOffse...
Definition: ring.cc:3435
ideal init64(ideal G, int64vec *currw64)
Definition: walkSupport.cc:302
ideal idInterRed(ideal G)
Definition: walkSupport.cc:961
ip_smatrix * matrix
ideal idrMoveR(ideal &id, ring src_r, ring dest_r)
Definition: prCopy.cc:249
matrix matIdLift(ideal Gomega, ideal M)
Definition: walkSupport.cc:981
void rChangeCurrRing(ring r)
Definition: polys.cc:14
matrix mp_Mult(matrix a, matrix b, const ring R)
Definition: matpol.cc:224
BOOLEAN currwOnBorder64(ideal G, int64vec *currw64)
Definition: walkSupport.cc:353
#define SI_SAVE_OPT(A, B)
Definition: options.h:19
void idDelete(ideal *h)
delete an ideal
Definition: ideals.h:31
#define idTest(id)
Definition: ideals.h:63
WalkState walk64 ( ideal  I,
int64vec currw64,
ring  destRing,
int64vec destVec64,
ideal &  destIdeal,
BOOLEAN  sourceIsSB = FALSE 
)

Definition at line 222 of file walkMain.cc.

224 {
225  //some initializations
226  WalkState state=WalkOk;
227  BITSET save1,save2;
228  SI_SAVE_OPT(save1,save2);
229 
232  int step=0;
233  ideal G=I;
234 
236  if(!sourceIsSB)
237  {
238  ideal GG=idStd(G);
239  idDelete(&G); G=GG;
240  }
241  else
242  G=idInterRed(G);
243  SI_RESTORE_OPT(save1,save2);
244 
245  ideal nextG;
246  state=firstWalkStep64(G,currw64,destRing);
247  nextG=G;
248 
249  if(overflow_error)
250  {
251  state=WalkOverFlowError;
252  return(state);
253  }
254 
255  int64 nexttvec0,nexttvec1;
256  //int64vec* nexttvec64=nextt64(nextG,currw64,destVec64);
257  nextt64(nextG,currw64,destVec64,nexttvec0,nexttvec1);
258 
259  //while(0<t<=1) ( t=((*nexttvec64)[0])/((*nexttvec64)[1]) )
260  //while( (*nexttvec64)[0]<=(*nexttvec64)[1] ) {
261  while (nexttvec0<=nexttvec1 )
262  {
263  step=step+1;
264 
265  //int64vec *tt=nextw64(currw64,destVec64,nexttvec64);
266  int64vec *tt=nextw64(currw64,destVec64,nexttvec0,nexttvec1);
267  delete currw64; currw64=tt; tt=NULL;
268 
269  if (TEST_OPT_PROT)
270  {
271  PrintS("walk step:"); currw64->show(); PrintLn();
272  }
273 
274  state=walkStep64(nextG,currw64,step);
275  //uppdates nextG if all is OK
276 
277  if(overflow_error)
278  return(WalkOverFlowError);
279 
280  //delete nexttvec64;
281  //nexttvec64=nextt64(nextG,currw64,destVec64);
282  nextt64(nextG,currw64,destVec64,nexttvec0,nexttvec1);
283 
284  }
285 
286  destIdeal=sortRedSB(nextG);
287  return(state);
288 }
void nextt64(ideal G, int64vec *currw64, int64vec *targw64, int64 &tvec0, int64 &tvec1)
Definition: walkSupport.cc:563
#define OPT_REDSB
Definition: options.h:71
ideal sortRedSB(ideal G)
int overflow_error
Definition: walkMain.cc:37
unsigned si_opt_1
Definition: options.c:5
void PrintLn()
Definition: reporter.cc:322
#define TEST_OPT_PROT
Definition: options.h:98
WalkState
Definition: walkMain.h:7
#define FALSE
Definition: auxiliary.h:140
long int64
Definition: auxiliary.h:112
int64vec * nextw64(int64vec *currw, int64vec *targw, int64 nexttvec0, int64 nexttvec1)
Definition: walkSupport.cc:607
static TreeM * G
Definition: janet.cc:38
#define BITSET
Definition: structs.h:17
void show(int mat=0, int spaces=0)
Definition: int64vec.cc:105
#define Sy_bit(x)
Definition: options.h:30
WalkState walkStep64(ideal &G, int64vec *currw64, int step)
Definition: walkMain.cc:148
const CanonicalForm & GG
Definition: cfModGcd.cc:4017
#define SI_RESTORE_OPT(A, B)
Definition: options.h:22
ideal idStd(ideal G)
Definition: walkSupport.cc:941
#define OPT_REDTAIL
Definition: options.h:86
ideal idInterRed(ideal G)
Definition: walkSupport.cc:961
void PrintS(const char *s)
Definition: reporter.cc:294
#define NULL
Definition: omList.c:10
#define SI_SAVE_OPT(A, B)
Definition: options.h:19
WalkState firstWalkStep64(ideal &G, int64vec *currw64, ring destRing)
Definition: walkMain.cc:69
void idDelete(ideal *h)
delete an ideal
Definition: ideals.h:31
WalkState walkstep64 ( ideal &  G,
int64vec currw,
int  step 
)