Data Structures | Typedefs | Functions
tropicalStrategy.h File Reference

implementation of the class tropicalStrategy More...

#include <gfanlib/gfanlib_vector.h>
#include <gfanlib/gfanlib_zcone.h>
#include <polys/simpleideals.h>
#include <kernel/ideals.h>
#include <set>
#include <callgfanlib_conversion.h>
#include <containsMonomial.h>
#include <flip.h>
#include <initial.h>
#include <witness.h>
#include <Singular/ipshell.h>
#include <adjustWeights.h>
#include <ppinitialReduction.h>

Go to the source code of this file.

Data Structures

class  tropicalStrategy
 

Typedefs

typedef gfan::ZVector(* wAdjAlg1) (gfan::ZVector)
 
typedef gfan::ZVector(* wAdjAlg2) (gfan::ZVector, gfan::ZVector)
 
typedef bool(* redAlg) (ideal, ring, number)
 

Functions

BOOLEAN computeWitnessDebug (leftv res, leftv args)
 
BOOLEAN computeFlipDebug (leftv res, leftv args)
 

Detailed Description

implementation of the class tropicalStrategy

tropicalStrategy is a class that contains information relevant for computing tropical varieties that is dependent on the valuation of the coefficient field. It represents the mutable part of an overall framework that is capable of computing tropical varieties both over coefficient fields without valuation and with valuation (currently: only p-adic valuation over rational numbers)

Definition in file tropicalStrategy.h.

Typedef Documentation

§ redAlg

typedef bool(* redAlg) (ideal, ring, number)

Definition at line 35 of file tropicalStrategy.h.

§ wAdjAlg1

typedef gfan::ZVector(* wAdjAlg1) (gfan::ZVector)

Definition at line 33 of file tropicalStrategy.h.

§ wAdjAlg2

typedef gfan::ZVector(* wAdjAlg2) (gfan::ZVector, gfan::ZVector)

Definition at line 34 of file tropicalStrategy.h.

Function Documentation

§ computeFlipDebug()

BOOLEAN computeFlipDebug ( leftv  res,
leftv  args 
)

Definition at line 970 of file tropicalStrategy.cc.

971 {
972  leftv u = args;
973  if ((u!=NULL) && (u->Typ()==IDEAL_CMD))
974  {
975  leftv v = u->next;
976  if ((v!=NULL) && (v->Typ()==NUMBER_CMD))
977  {
978  leftv w = v->next;
979  if ((w!=NULL) && (w->Typ()==BIGINTMAT_CMD))
980  {
981  leftv x = w->next;
982  if ((x!=NULL) && (x->Typ()==BIGINTMAT_CMD))
983  {
984  omUpdateInfo();
985  Print("usedBytesBefore=%ld\n",om_Info.UsedBytes);
986 
987  ideal I = (ideal) u->CopyD();
988  number p = (number) v->CopyD();
989  bigintmat* interiorPoint0 = (bigintmat*) w->CopyD();
990  bigintmat* facetNormal0 = (bigintmat*) x->CopyD();
992 
993  gfan::ZVector* interiorPoint = bigintmatToZVector(interiorPoint0);
994  gfan::ZVector* facetNormal = bigintmatToZVector(facetNormal0);
995  std::pair<ideal,ring> Js = debug.computeFlip(I,currRing,*interiorPoint,*facetNormal);
996  ideal J = Js.first;
997  ring s = Js.second;
998 
999  id_Delete(&J,s);
1000  rDelete(s);
1001 
1002  id_Delete(&I,currRing);
1003  n_Delete(&p,currRing->cf);
1004  delete interiorPoint0;
1005  delete facetNormal0;
1006  delete interiorPoint;
1007  delete facetNormal;
1008 
1009  res->rtyp = NONE;
1010  res->data = NULL;
1011  return FALSE;
1012  }
1013  }
1014  }
1015  }
1016  WerrorS("computeFlipDebug: unexpected parameters");
1017  return TRUE;
1018 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define Print
Definition: emacs.cc:83
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
Matrices of numbers.
Definition: bigintmat.h:51
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
static tropicalStrategy debugStrategy(const ideal startIdeal, number unifParameter, ring startRing)
int Typ()
Definition: subexpr.cc:979
std::pair< ideal, ring > computeFlip(const ideal Ir, const ring r, const gfan::ZVector &interiorPoint, const gfan::ZVector &facetNormal) const
given an interior point of a groebner cone computes the groebner cone adjacent to it ...
void * data
Definition: subexpr.h:90
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
omInfo_t om_Info
Definition: omStats.c:13
leftv next
Definition: subexpr.h:88
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:448
void omUpdateInfo()
Definition: omStats.c:24
const CanonicalForm & w
Definition: facAbsFact.cc:55
int rtyp
Definition: subexpr.h:93
Variable x
Definition: cfModGcd.cc:4023
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459
#define NONE
Definition: tok.h:216
void * CopyD(int t)
Definition: subexpr.cc:679
gfan::ZVector * bigintmatToZVector(const bigintmat &bim)

§ computeWitnessDebug()

BOOLEAN computeWitnessDebug ( leftv  res,
leftv  args 
)

Definition at line 933 of file tropicalStrategy.cc.

934 {
935  leftv u = args;
936  if ((u!=NULL) && (u->Typ()==IDEAL_CMD))
937  {
938  leftv v = u->next;
939  if ((v!=NULL) && (v->Typ()==IDEAL_CMD))
940  {
941  leftv w = v->next;
942  if ((w!=NULL) && (w->Typ()==IDEAL_CMD))
943  {
944  leftv x = w->next;
945  if ((x!=NULL) && (x->Typ()==NUMBER_CMD))
946  {
947  omUpdateInfo();
948  Print("usedBytesBefore=%ld\n",om_Info.UsedBytes);
949 
950  ideal inJ = (ideal) u->CopyD();
951  ideal inI = (ideal) v->CopyD();
952  ideal I = (ideal) w->CopyD();
953  number p = (number) x->CopyD();
955  ideal J = debug.computeWitness(inJ,inI,I,currRing);
956  id_Delete(&inJ,currRing);
957  id_Delete(&inI,currRing);
958  id_Delete(&I,currRing);
959  n_Delete(&p,currRing->cf);
960  res->rtyp = IDEAL_CMD;
961  res->data = (char*) J;
962  return FALSE;
963  }
964  }
965  }
966  }
967  return TRUE;
968 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define Print
Definition: emacs.cc:83
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
ideal computeWitness(const ideal inJ, const ideal inI, const ideal I, const ring r) const
suppose w a weight in maximal groebner cone of > suppose I (initially) reduced standard basis w...
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
#define TRUE
Definition: auxiliary.h:101
static tropicalStrategy debugStrategy(const ideal startIdeal, number unifParameter, ring startRing)
int Typ()
Definition: subexpr.cc:979
void * data
Definition: subexpr.h:90
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
omInfo_t om_Info
Definition: omStats.c:13
leftv next
Definition: subexpr.h:88
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
void omUpdateInfo()
Definition: omStats.c:24
const CanonicalForm & w
Definition: facAbsFact.cc:55
int rtyp
Definition: subexpr.h:93
Variable x
Definition: cfModGcd.cc:4023
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459
void * CopyD(int t)
Definition: subexpr.cc:679