Loading...
Searching...
No Matches
tropicalDebug.h File Reference
`#include "libpolys/polys/simpleideals.h"`
`#include "gfanlib/gfanlib.h"`

Go to the source code of this file.

## Functions

bool | checkForNonPositiveEntries (const gfan::ZVector &w)
bool | checkForNonPositiveLaterEntries (const gfan::ZVector &w)
bool | areIdealsEqual (ideal I, ring r, ideal J, ring s)
bool | checkWeightVector (const ideal I, const ring r, const gfan::ZVector &weightVector, bool checkBorder=0)
bool | checkOrderingAndCone (const ring r, const gfan::ZCone zc)
bool | checkPolynomialInput (const ideal I, const ring r)
bool | checkPolyhedralInput (const gfan::ZCone zc, const gfan::ZVector p)

## Function Documentation

## areIdealsEqual()

bool areIdealsEqual | ( | ideal | I,
|  | ring | r,
|  | ideal | J,
|  | ring | s )

Definition at line 41 of file tropicalDebug.cc.

{
ideal Is = idInit(IDELEMS(I));
nMapFunc identity = n_SetMap(r->cf,s->cf);
for (int i=0; i<IDELEMS(I); i++)
Is->m[i] = p_PermPoly(I->m[i],NULL,r,s,identity,NULL,0);
ring origin = currRing;
if (origin!=s)
rChangeCurrRing(s);
ideal stdI = gfanlib_kStd_wrapper(Is,s);
ideal stdJ = gfanlib_kStd_wrapper(J,s);
ideal NF1 = kNF(stdI,s->qideal,stdJ);
ideal NF2 = kNF(stdJ,s->qideal,stdI);
if (origin!=s)
rChangeCurrRing(origin);
bool b = true;
if (NF1 != NULL)
b = b && idIs0(NF1);
if (NF2 != NULL)
b = b && idIs0(NF2);
if (!b)
std::cout << "ERROR: input ideals not equal!" << std::endl;
id_Delete(&stdI,s);
id_Delete(&stdJ,s);
id_Delete(&NF1,s);
id_Delete(&NF2,s);
return (b);
}
i
int i
Definition cfEzgcd.cc:132
b
CanonicalForm b
Definition cfModGcd.cc:4111
n_SetMap
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition coeffs.h:703
nMapFunc
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition coeffs.h:80
s
const CanonicalForm int s
Definition facAbsFact.cc:51
idIs0
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
Definition simpleideals.cc:960
kNF
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition kstd1.cc:3229
NULL
#define NULL
Definition omList.c:12
p_PermPoly
poly p_PermPoly(poly p, const int *perm, const ring oldRing, const ring dst, nMapFunc nMap, const int *par_perm, int OldPar, BOOLEAN use_mult)
Definition p_polys.cc:4256
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
idInit
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition simpleideals.cc:35
id_Delete
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
Definition simpleideals.cc:123
IDELEMS
#define IDELEMS(i)
Definition simpleideals.h:23
gfanlib_kStd_wrapper
ideal gfanlib_kStd_wrapper(ideal I, ring r, tHomog h=testHomog)
Definition std_wrapper.cc:6

## checkForNonPositiveEntries()

bool checkForNonPositiveEntries | ( | const gfan::ZVector & | w | ) |

Definition at line 13 of file tropicalDebug.cc.

{
for (unsigned i=0; i<w.size(); i++)
{
if (w[i].sign()<=0)
{
std::cout << "ERROR: non-positive weight in weight vector" << std::endl
<< "weight: " << w << std::endl;
return false;
}
}
return true;
}
w
const CanonicalForm & w
Definition facAbsFact.cc:51
sign
static int sign(int x)
Definition ring.cc:3504

## checkForNonPositiveLaterEntries()

bool checkForNonPositiveLaterEntries | ( | const gfan::ZVector & | w | ) |

Definition at line 27 of file tropicalDebug.cc.

{
for (unsigned i=1; i<w.size(); i++)
{
if (w[i].sign()<=0)
{
std::cout << "ERROR: non-positive weight in weight vector later entries" << std::endl
<< "weight: " << w << std::endl;
return false;
}
}
return true;
}

## checkOrderingAndCone()

bool checkOrderingAndCone | ( | const ring | r,
|  | const gfan::ZCone | zc )

Definition at line 90 of file tropicalDebug.cc.

{
if (r)
{
if (r->order[0]==ringorder_dp)
return true;
int n = rVar(r);
int* w = r->wvhdl[0];
gfan::ZVector v = wvhdlEntryToZVector(n,w);
if (r->order[0]==ringorder_ws)
v = gfan::Integer((long)-1)*v;
if (!zc.contains(v))
{
std::cout << "ERROR: weight of ordering not inside Groebner cone!" << std::endl;
return false;
}
}
return true;
}
wvhdlEntryToZVector
gfan::ZVector wvhdlEntryToZVector(const int n, const int *wvhdl0)
Definition callgfanlib_conversion.cc:102
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition facBivar.h:39
ringorder_dp
@ ringorder_dp
Definition ring.h:79
ringorder_ws
@ ringorder_ws
Definition ring.h:88
rVar
static short rVar(const ring r)
define rVar(r) (r->N)
Definition ring.h:598

## checkPolyhedralInput()

bool checkPolyhedralInput | ( | const gfan::ZCone | zc,
|  | const gfan::ZVector | p )

Definition at line 117 of file tropicalDebug.cc.

{
return zc.containsRelatively(p);
}
p
int p
Definition cfModGcd.cc:4086

## checkPolynomialInput()

bool checkPolynomialInput | ( | const ideal | I,
|  | const ring | r )

Definition at line 110 of file tropicalDebug.cc.

{
if (r) rTest(r);
if (I && r) id_Test(I,r);
return ((!I) || (I && r));
}
rTest
#define rTest(r)
Definition ring.h:794
id_Test
#define id_Test(A, lR)
Definition simpleideals.h:89

## checkWeightVector()

bool checkWeightVector | ( | const ideal | I,
|  | const ring | r,
|  | const gfan::ZVector & | weightVector,
|  | bool | checkBorder = 0 )

Definition at line 74 of file tropicalDebug.cc.

{
gfan::ZCone cI = maximalGroebnerCone(I,r);
if (!cI.contains(weightVector))
{
std::cout << "ERROR: weight vector not inside maximal Gröbner cone" << std::endl;
return false;
}
if (checkBorder && cI.containsRelatively(weightVector))
{
std::cout << "ERROR: weight vector in the relative interior of maximal Gröbner cone" << std::endl;
return false;
}
return true;
}
maximalGroebnerCone
gfan::ZCone maximalGroebnerCone(const ideal &I, const ring &r)
Definition tropical.cc:291