Loading...
Searching...
No Matches
walk_ip.cc File Reference
`#include "kernel/mod2.h"`
`#include "Singular/tok.h"`
`#include "misc/options.h"`
`#include "Singular/ipid.h"`
`#include "misc/intvec.h"`
`#include "omalloc/omalloc.h"`
`#include "kernel/polys.h"`
`#include "kernel/ideals.h"`
`#include "polys/matpol.h"`
`#include "kernel/GBEngine/kstd1.h"`
`#include "polys/monomials/ring.h"`
`#include "Singular/subexpr.h"`
`#include "polys/monomials/maps.h"`
`#include "kernel/GBEngine/syz.h"`
`#include "coeffs/numbers.h"`
`#include "Singular/lists.h"`
`#include "Singular/attrib.h"`
`#include "Singular/ipconv.h"`
`#include "Singular/links/silink.h"`
`#include "kernel/combinatorics/stairc.h"`
`#include "polys/weight.h"`
`#include "kernel/spectrum/semic.h"`
`#include "kernel/spectrum/splist.h"`
`#include "kernel/spectrum/spectrum.h"`
`#include "polys/clapsing.h"`
`#include "kernel/combinatorics/hutil.h"`
`#include "Singular/ipshell.h"`
`#include "kernel/groebner_walk/walkMain.h"`
`#include "kernel/groebner_walk/walkProc.h"`
`#include "kernel/groebner_walk/walkSupport.h"`
`#include "polys/prCopy.h"`

Go to the source code of this file.

## Functions

ideal | walkProc (leftv first, leftv second)
ideal | fractalWalkProc (leftv first, leftv second)
int64vec * | getiv64 (lists l)

## Function Documentation

## fractalWalkProc()

ideal fractalWalkProc | ( | leftv | first,
|  | leftv | second )

Definition at line 161 of file walk_ip.cc.

{
//unperturbedStartVectorStrategy SHOULD BE SET BY THE USER THROUGH
//A THIRD ARGUMENT. TRUE MEANS THAT THE UNPERTURBED START
//VECTOR STRATEGY IS USED AND FALSE THAT THE START VECTOR IS
//MAXIMALLY PERTURBED
BOOLEAN unperturbedStartVectorStrategy=TRUE;
WalkState state = WalkOk;
BITSET save1,save2;
SI_SAVE_OPT(save1,save2);
si_opt_1 &= (~Sy_bit(OPT_REDSB)); //make sure option noredSB is set
ring destRing = currRing;
ideal destIdeal = NULL;
idhdl sourceRingHdl = (idhdl)first->data;
rSetHdl( sourceRingHdl );
ring sourceRing = currRing;
int * vperm = (int *)omAlloc0( (currRing->N+1)*sizeof( int ) );
state= fractalWalkConsistency( sourceRing, destRing, vperm );
omFreeSize( (ADDRESS)vperm, (currRing->N+1)*sizeof(int) );
ideal sourceIdeal;
BOOLEAN sourcIdealIsSB=FALSE;
if ( state == WalkOk ) {
idhdl ih = currRing->idroot->get( second->Name(), myynest );
if ( (ih != NULL) && (IDTYP(ih)==IDEAL_CMD) ) {
sourceIdeal = IDIDEAL( ih );
if(hasFlag((leftv)ih,FLAG_STD)){
sourcIdealIsSB=TRUE;
}
}
else {
state=WalkNoIdeal;
}
}
if ( state == WalkOk ) {
// Now the settings are compatible with Walk
state=fractalWalk64(sourceIdeal,destRing,destIdeal,
sourcIdealIsSB,
unperturbedStartVectorStrategy);
}
SI_RESTORE_OPT(save1,save2);//making sure options are as before functiocall
if ( state == WalkOk )
{
ring almostDestRing=currRing;
rChangeCurrRing(destRing);
destIdeal=idrMoveR(destIdeal, almostDestRing, destRing);
}
switch (state) {
case WalkOk:
destIdeal=sortRedSB(destIdeal);
return(destIdeal);
break;
case WalkIncompatibleRings:
Werror( "ring %s and current ring are incompatible\n",
first->Name() );
rChangeCurrRing(destRing);
destIdeal= NULL;
return destIdeal;
break;
case WalkIncompatibleDestRing:
Werror( "Order of basering not allowed,\n must be a combination of lp,dp,Dp,wp,Wp and C or just M.\n");
rChangeCurrRing(destRing);
destIdeal= NULL;
return destIdeal;
break;
case WalkIncompatibleSourceRing:
Werror( "Order of %s not allowed,\n must be a combination of lp,dp,Dp,wp,Wp and C or just M.\n",
first->Name());
rChangeCurrRing(destRing);
destIdeal= NULL;
return destIdeal;
break;
case WalkNoIdeal:
Werror( "Can't find ideal %s in ring %s.\n",
second->Name(), first->Name() );
rChangeCurrRing(destRing);
destIdeal= NULL;
return destIdeal;
break;
case WalkOverFlowError:
Werror( "Overflow occurred in ring %s.\n", first->Name() );
rChangeCurrRing(destRing);
destIdeal= NULL;
return destIdeal;
break;
default:
rChangeCurrRing(destRing);
destIdeal= idInit(1,1);
return destIdeal;
}
return NULL;
}
BITSET
#define BITSET
Definition auxiliary.h:85
BOOLEAN
int BOOLEAN
Definition auxiliary.h:88
TRUE
#define TRUE
Definition auxiliary.h:101
FALSE
#define FALSE
Definition auxiliary.h:97
ADDRESS
void * ADDRESS
Definition auxiliary.h:120
sleftv::Name
const char * Name()
Definition subexpr.h:120
sleftv::data
void * data
Definition subexpr.h:88
myynest
VAR int myynest
Definition febase.cc:41
IDEAL_CMD
@ IDEAL_CMD
Definition grammar.cc:285
hasFlag
#define hasFlag(A, F)
Definition ipid.h:112
IDIDEAL
#define IDIDEAL(a)
Definition ipid.h:133
IDTYP
#define IDTYP(a)
Definition ipid.h:119
FLAG_STD
#define FLAG_STD
Definition ipid.h:106
rSetHdl
void rSetHdl(idhdl h)
Definition ipshell.cc:5129
omFreeSize
#define omFreeSize(addr, size)
Definition omAllocDecl.h:260
omAlloc0
#define omAlloc0(size)
Definition omAllocDecl.h:211
NULL
#define NULL
Definition omList.c:12
si_opt_1
VAR unsigned si_opt_1
Definition options.c:5
SI_SAVE_OPT
#define SI_SAVE_OPT(A, B)
Definition options.h:20
OPT_REDSB
#define OPT_REDSB
Definition options.h:77
Sy_bit
#define Sy_bit(x)
Definition options.h:31
SI_RESTORE_OPT
#define SI_RESTORE_OPT(A, B)
Definition options.h:23
rChangeCurrRing
void rChangeCurrRing(ring r)
Definition polys.cc:16
currRing
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
idrMoveR
ideal idrMoveR(ideal &id, ring src_r, ring dest_r)
Definition prCopy.cc:248
Werror
void Werror(const char *fmt,...)
Definition reporter.cc:189
idhdl
idrec * idhdl
Definition ring.h:22
idInit
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition simpleideals.cc:35
leftv
sleftv * leftv
Definition structs.h:53
fractalWalk64
WalkState fractalWalk64(ideal sourceIdeal, ring destRing, ideal &destIdeal, BOOLEAN sourceIsSB, BOOLEAN unperturbedStartVectorStrategy)
Definition walkMain.cc:614
WalkState
WalkState
Definition walkMain.h:7
WalkIncompatibleDestRing
@ WalkIncompatibleDestRing
Definition walkMain.h:28
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
fractalWalkConsistency
WalkState fractalWalkConsistency(ring sring, ring dring, int *vperm)
Definition walkProc.cc:220
sortRedSB
ideal sortRedSB(ideal G)
Definition walkSupport.cc:1146

## getiv64()

int64vec * getiv64 | ( | lists | l | ) |

Definition at line 284 of file walk_ip.cc.

{
return (int64vec*)(l->m[0].data);
}
l
int l
Definition cfEzgcd.cc:100
int64vec
Definition int64vec.h:24

## walkProc()

ideal walkProc | ( | leftv | first,
|  | leftv | second )

Definition at line 55 of file walk_ip.cc.

{
WalkState state = WalkOk;
BITSET save1,save2;
SI_SAVE_OPT(save1,save2);
si_opt_1 &= (~Sy_bit(OPT_REDSB)); //make sure option noredSB is set
ring destRing = currRing;
ideal destIdeal = NULL;
idhdl sourceRingHdl = (idhdl)first->data;
ring sourceRing = IDRING(sourceRingHdl);
rChangeCurrRing( sourceRing );
if(state==WalkOk)
{
int * vperm = (int *)omAlloc0( (currRing->N+1)*sizeof( int ) );
state= walkConsistency( sourceRing, destRing, vperm );
omFreeSize( (ADDRESS)vperm, (currRing->N+1)*sizeof(int) );
}
int64vec* currw64=rGetGlobalOrderWeightVec(sourceRing);
int64vec* destVec64=rGetGlobalOrderWeightVec(destRing);
ideal sourceIdeal;
BOOLEAN sourcIdealIsSB=FALSE;
if ( state == WalkOk )
{
idhdl ih = currRing->idroot->get( second->Name(), myynest );
if ( (ih != NULL) && (IDTYP(ih)==IDEAL_CMD) )
{
sourceIdeal = idCopy(IDIDEAL( ih ));
if(hasFlag((leftv)ih,FLAG_STD)){
sourcIdealIsSB=TRUE;
}
}
else
{
state=WalkNoIdeal;
}
}
if ( state == WalkOk )
{
// Now the settings are compatible with Walk
state=walk64(sourceIdeal,currw64,destRing,destVec64,
destIdeal,sourcIdealIsSB);
}
SI_RESTORE_OPT(save1,save2);//making sure options are as before function call
ring almostDestRing=currRing;
rChangeCurrRing(destRing);
switch (state) {
case WalkOk:
destIdeal=idrMoveR(destIdeal,currRing,almostDestRing);
break;
case WalkIncompatibleRings:
Werror("ring %s and current ring are incompatible\n",
first->Name() );
destIdeal= NULL;
break;
case WalkIncompatibleDestRing:
WerrorS( "Order of basering not allowed,\n must be a combination of a,A,lp,dp,Dp,wp,Wp,M and C.\n");
destIdeal= NULL;
break;
case WalkIncompatibleSourceRing:
Werror( "Order of %s not allowed,\n must be a combination of a,A,lp,dp,Dp,wp,Wp,M and C.\n",first->Name());
rChangeCurrRing(destRing);
destIdeal= NULL;
break;
case WalkNoIdeal:
Werror( "Can't find ideal %s in ring %s.\n",
second->Name(), first->Name() );
destIdeal= NULL;
break;
case WalkOverFlowError:
WerrorS( "Overflow occurred.\n");
destIdeal= NULL;
break;
default:
destIdeal= NULL;
}
return destIdeal;
}
WerrorS
void WerrorS(const char *s)
Definition feFopen.cc:24
idCopy
ideal idCopy(ideal A)
Definition ideals.h:60
IDRING
#define IDRING(a)
Definition ipid.h:127
walk64
WalkState walk64(ideal I, int64vec *currw64, ring destRing, int64vec *destVec64, ideal &destIdeal, BOOLEAN sourceIsSB)
Definition walkMain.cc:222
walkConsistency
WalkState walkConsistency(ring sring, ring dring, int *vperm)
Definition walkProc.cc:53
rGetGlobalOrderWeightVec
int64vec * rGetGlobalOrderWeightVec(ring r)
Definition walkSupport.cc:1094