Loading...
Searching...
No Matches
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

## WalkState

enum WalkState

Enumerator
WalkNoIdeal |
WalkIncompatibleRings |
WalkIntvecProblem |
WalkOverFlowError |
WalkIncompatibleDestRing |
WalkIncompatibleSourceRing |
WalkOk |

Definition at line 7 of file walkMain.h.

{
WalkNoIdeal,
WalkIncompatibleRings,
WalkIntvecProblem,
WalkOverFlowError,
/*
these could be defined to make error management more elegant
WalkOverFlowError1,
WalkOverFlowError2,
WalkOverFlowError3,
WalkOverFlowError4,
WalkOverFlowError5,
WalkOverFlowError6,
WalkOverFlowError7,
WalkOverFlowError8,
WalkOverFlowError9,
WalkOverFlowError10,
WalkOverFlowError11,
WalkOverFlowError12,
WalkOverFlowError13,
*/
WalkIncompatibleDestRing,
WalkIncompatibleSourceRing,
WalkOk
};
WalkIncompatibleDestRing
@ WalkIncompatibleDestRing
Definition walkMain.h:28
WalkIntvecProblem
@ WalkIntvecProblem
Definition walkMain.h:10
WalkIncompatibleRings
@ WalkIncompatibleRings
Definition walkMain.h:9
WalkOverFlowError
@ WalkOverFlowError
Definition walkMain.h:11
WalkOk
@ WalkOk
Definition walkMain.h:30
WalkNoIdeal
@ WalkNoIdeal
Definition walkMain.h:8
WalkIncompatibleSourceRing
@ WalkIncompatibleSourceRing
Definition walkMain.h:29

## Function Documentation

## fractalWalk64()

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

Definition at line 614 of file walkMain.cc.

{
overflow_error=FALSE; //global
WalkState state=WalkOk;
BITSET save1;
SI_SAVE_OPT1(save1);
si_opt_1|= (Sy_bit(OPT_REDTAIL)|Sy_bit(OPT_REDSB));
ideal G;
if(!sourceIsSB)
{
G=idStd(sourceIdeal);
}
else
{
G=idInterRed(idCopy(sourceIdeal));
}
SI_RESTORE_OPT1(save1); //switches REDSB off
//matrices for the orders of the rings
intvec *destMat=int64VecToIntVec(rGetGlobalOrderMatrix(destRing));
intvec *currMat=int64VecToIntVec(rGetGlobalOrderMatrix(currRing));
int64vec* currw64=getNthRow64(currMat,1); //start vector
state=firstFractalWalkStep64(G,currw64,currMat,destRing,
unperturbedStartVectorStrategy);
delete currMat;
state=fractalRec64(G,currw64,destMat,1,1);
if(state==WalkOk)
destIdeal=G;
if(overflow_error)
state=WalkOverFlowError;
delete currw64;
delete destMat;
return state;
}
BITSET
#define BITSET
Definition auxiliary.h:85
FALSE
#define FALSE
Definition auxiliary.h:97
int64vec
Definition int64vec.h:24
intvec
Definition intvec.h:24
idCopy
ideal idCopy(ideal A)
Definition ideals.h:60
G
STATIC_VAR TreeM * G
Definition janet.cc:31
si_opt_1
VAR unsigned si_opt_1
Definition options.c:5
OPT_REDTAIL
#define OPT_REDTAIL
Definition options.h:92
SI_SAVE_OPT1
#define SI_SAVE_OPT1(A)
Definition options.h:21
SI_RESTORE_OPT1
#define SI_RESTORE_OPT1(A)
Definition options.h:24
OPT_REDSB
#define OPT_REDSB
Definition options.h:77
Sy_bit
#define Sy_bit(x)
Definition options.h:31
currRing
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
overflow_error
VAR int overflow_error
Definition walkMain.cc:37
firstFractalWalkStep64
WalkState firstFractalWalkStep64(ideal &G, int64vec *&currw64, intvec *currMat, ring destRing, BOOLEAN unperturbedStartVectorStrategy)
Definition walkMain.cc:311
fractalRec64
WalkState fractalRec64(ideal &G, int64vec *currw64, intvec *destMat, int level, int step)
Definition walkMain.cc:434
WalkState
WalkState
Definition walkMain.h:7
rGetGlobalOrderMatrix
int64vec * rGetGlobalOrderMatrix(ring r)
Definition walkSupport.cc:1019
int64VecToIntVec
intvec * int64VecToIntVec(int64vec *source)
Definition walkSupport.cc:1181
getNthRow64
int64vec * getNthRow64(intvec *v, int n)
Definition walkSupport.cc:181
idInterRed
ideal idInterRed(ideal G)
Definition walkSupport.cc:958
idStd
ideal idStd(ideal G)
Definition walkSupport.cc:938

## unperturbedFirstStep64()

WalkState unperturbedFirstStep64 | ( | ideal & | G,
|  | int64vec * | currw64,
|  | ring | destRing )

Definition at line 358 of file walkMain.cc.

{
WalkState state=WalkOk;
/* OLDRING **************************************************** */
ideal nextG;
BITSET save1;
SI_SAVE_OPT1(save1);
if (currwOnBorder64(G,currw64))
{
ideal Gw=init64(G,currw64);
ring oldRing=currRing;
/* NEWRING **************************************************** */
ring rnew=rCopy0AndAddA(destRing,currw64);
rComplete(rnew);
rChangeCurrRing(rnew);
ideal newGw=idrMoveR(Gw, oldRing,rnew);
//turn off bucket representation of polynomials and on redSB
//si_opt_1|=Sy_bit(OPT_NOT_BUCKETS);
si_opt_1|=Sy_bit(OPT_REDSB);
ideal newStdGw=idStd(newGw);
//turn on bucket representation of polynomials and off redSB
SI_RESTORE_OPT1(save1);
matrix L=matIdLift(newGw,newStdGw);
idDelete(&newStdGw);
idDelete(&newGw);
nextG=idrMoveR(G,oldRing,rnew); idTest(nextG);
matrix nextGmat=(matrix)nextG;
matrix resMat=mp_Mult(nextGmat,L,rnew);
idDelete((ideal *)&nextGmat);
idDelete((ideal *)&L);
nextG=(ideal)resMat;
si_opt_1|=Sy_bit(OPT_REDSB);
nextG = idInterRed(nextG);
SI_RESTORE_OPT1(save1);
}
else
{
ring oldRing=currRing;
ring rnew=rCopy0AndAddA(destRing,currw64);
rComplete(rnew);
rChangeCurrRing(rnew);
nextG=idrMoveR(G,oldRing,rnew);
}
G=nextG;
return(state);
}
idDelete
#define idDelete(H)
delete an ideal
Definition ideals.h:29
idTest
#define idTest(id)
Definition ideals.h:47
mp_Mult
matrix mp_Mult(matrix a, matrix b, const ring R)
Definition matpol.cc:206
matrix
ip_smatrix * matrix
Definition matpol.h:43
rChangeCurrRing
void rChangeCurrRing(ring r)
Definition polys.cc:16
idrMoveR
ideal idrMoveR(ideal &id, ring src_r, ring dest_r)
Definition prCopy.cc:248
rComplete
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:3527
rCopy0AndAddA
ring rCopy0AndAddA(const ring r, int64vec *wv64, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition ring.cc:1570
matIdLift
matrix matIdLift(ideal Gomega, ideal M)
Definition walkSupport.cc:978
currwOnBorder64
BOOLEAN currwOnBorder64(ideal G, int64vec *currw64)
Definition walkSupport.cc:350
init64
ideal init64(ideal G, int64vec *currw64)
Definition walkSupport.cc:299

## walk64()

WalkState walk64 | ( | ideal | I,
|  | int64vec * | currw64,
|  | ring | destRing,
|  | int64vec * | destVec64,
|  | ideal & | destIdeal,
|  | BOOLEAN | sourceIsSB = FALSE )

Definition at line 222 of file walkMain.cc.

{
//some initializations
WalkState state=WalkOk;
BITSET save1;
SI_SAVE_OPT1(save1);
si_opt_1|=Sy_bit(OPT_REDTAIL);
overflow_error=FALSE;
int step=0;
ideal G=I;
si_opt_1|=Sy_bit(OPT_REDSB);
if(!sourceIsSB)
{
ideal GG=idStd(G);
idDelete(&G); G=GG;
}
else
G=idInterRed(G);
SI_RESTORE_OPT1(save1);
ideal nextG;
state=firstWalkStep64(G,currw64,destRing);
nextG=G;
if(overflow_error)
{
state=WalkOverFlowError;
return(state);
}
int64 nexttvec0,nexttvec1;
//int64vec* nexttvec64=nextt64(nextG,currw64,destVec64);
nextt64(nextG,currw64,destVec64,nexttvec0,nexttvec1);
//while(0<t<=1) ( t=((*nexttvec64)[0])/((*nexttvec64)[1]) )
//while( (*nexttvec64)[0]<=(*nexttvec64)[1] ) {
while (nexttvec0<=nexttvec1 )
{
step=step+1;
//int64vec *tt=nextw64(currw64,destVec64,nexttvec64);
int64vec *tt=nextw64(currw64,destVec64,nexttvec0,nexttvec1);
delete currw64; currw64=tt; tt=NULL;
if (TEST_OPT_PROT)
{
PrintS("walk step:"); currw64->show(); PrintLn();
}
state=walkStep64(nextG,currw64);
//uppdates nextG if all is OK
if(overflow_error)
return(WalkOverFlowError);
//delete nexttvec64;
//nexttvec64=nextt64(nextG,currw64,destVec64);
nextt64(nextG,currw64,destVec64,nexttvec0,nexttvec1);
}
destIdeal=sortRedSB(nextG);
return(state);
}
int64
long int64
Definition auxiliary.h:68
GG
const CanonicalForm & GG
Definition cfModGcd.cc:4084
int64vec::show
void show(int mat=0, int spaces=0)
Definition int64vec.cc:104
NULL
#define NULL
Definition omList.c:12
TEST_OPT_PROT
#define TEST_OPT_PROT
Definition options.h:105
PrintS
void PrintS(const char *s)
Definition reporter.cc:288
PrintLn
void PrintLn()
Definition reporter.cc:314
firstWalkStep64
WalkState firstWalkStep64(ideal &G, int64vec *currw64, ring destRing)
Definition walkMain.cc:69
walkStep64
WalkState walkStep64(ideal &G, int64vec *currw64)
Definition walkMain.cc:148
nextt64
void nextt64(ideal G, int64vec *currw64, int64vec *targw64, int64 &tvec0, int64 &tvec1)
Definition walkSupport.cc:560
nextw64
int64vec * nextw64(int64vec *currw, int64vec *targw, int64 nexttvec0, int64 nexttvec1)
Definition walkSupport.cc:604
sortRedSB
ideal sortRedSB(ideal G)
Definition walkSupport.cc:1146

## walkstep64()

WalkState walkstep64 | ( | ideal & | G,
|  | int64vec * | currw,
|  | int | step )