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

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

Definition at line 35 of file tropicalStrategy.h.

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

Definition at line 33 of file tropicalStrategy.h.

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

Definition at line 34 of file tropicalStrategy.h.

Function Documentation

BOOLEAN computeFlipDebug ( leftv  res,
leftv  args 
)

Definition at line 958 of file tropicalStrategy.cc.

959 {
960  leftv u = args;
961  if ((u!=NULL) && (u->Typ()==IDEAL_CMD))
962  {
963  leftv v = u->next;
964  if ((v!=NULL) && (v->Typ()==NUMBER_CMD))
965  {
966  leftv w = v->next;
967  if ((w!=NULL) && (w->Typ()==BIGINTMAT_CMD))
968  {
969  leftv x = w->next;
970  if ((x!=NULL) && (x->Typ()==BIGINTMAT_CMD))
971  {
972  omUpdateInfo();
973  Print("usedBytesBefore=%ld\n",om_Info.UsedBytes);
974 
975  ideal I = (ideal) u->CopyD();
976  number p = (number) v->CopyD();
977  bigintmat* interiorPoint0 = (bigintmat*) w->CopyD();
978  bigintmat* facetNormal0 = (bigintmat*) x->CopyD();
980 
981  gfan::ZVector* interiorPoint = bigintmatToZVector(interiorPoint0);
982  gfan::ZVector* facetNormal = bigintmatToZVector(facetNormal0);
983  std::pair<ideal,ring> Js = debug.computeFlip(I,currRing,*interiorPoint,*facetNormal);
984  ideal J = Js.first;
985  ring s = Js.second;
986 
987  id_Delete(&J,s);
988  rDelete(s);
989 
990  id_Delete(&I,currRing);
991  n_Delete(&p,currRing->cf);
992  delete interiorPoint0;
993  delete facetNormal0;
994  delete interiorPoint;
995  delete facetNormal;
996 
997  res->rtyp = NONE;
998  res->data = NULL;
999  return FALSE;
1000  }
1001  }
1002  }
1003  }
1004  WerrorS("computeFlipDebug: unexpected parameters");
1005  return TRUE;
1006 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define Print
Definition: emacs.cc:83
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
Matrices of numbers.
Definition: bigintmat.h:32
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
#define TRUE
Definition: auxiliary.h:144
void WerrorS(const char *s)
Definition: feFopen.cc:23
static tropicalStrategy debugStrategy(const ideal startIdeal, number unifParameter, ring startRing)
int Typ()
Definition: subexpr.cc:955
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
omInfo_t om_Info
Definition: omStats.c:13
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 ...
leftv next
Definition: subexpr.h:87
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:92
Variable x
Definition: cfModGcd.cc:4023
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:456
#define NONE
Definition: tok.h:170
void * CopyD(int t)
Definition: subexpr.cc:662
gfan::ZVector * bigintmatToZVector(const bigintmat &bim)
BOOLEAN computeWitnessDebug ( leftv  res,
leftv  args 
)

Definition at line 921 of file tropicalStrategy.cc.

922 {
923  leftv u = args;
924  if ((u!=NULL) && (u->Typ()==IDEAL_CMD))
925  {
926  leftv v = u->next;
927  if ((v!=NULL) && (v->Typ()==IDEAL_CMD))
928  {
929  leftv w = v->next;
930  if ((w!=NULL) && (w->Typ()==IDEAL_CMD))
931  {
932  leftv x = w->next;
933  if ((x!=NULL) && (x->Typ()==NUMBER_CMD))
934  {
935  omUpdateInfo();
936  Print("usedBytesBefore=%ld\n",om_Info.UsedBytes);
937 
938  ideal inJ = (ideal) u->CopyD();
939  ideal inI = (ideal) v->CopyD();
940  ideal I = (ideal) w->CopyD();
941  number p = (number) x->CopyD();
943  ideal J = debug.computeWitness(inJ,inI,I,currRing);
944  id_Delete(&inJ,currRing);
945  id_Delete(&inI,currRing);
946  id_Delete(&I,currRing);
947  n_Delete(&p,currRing->cf);
948  res->rtyp = IDEAL_CMD;
949  res->data = (char*) J;
950  return FALSE;
951  }
952  }
953  }
954  }
955  return TRUE;
956 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define Print
Definition: emacs.cc:83
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...
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
#define TRUE
Definition: auxiliary.h:144
static tropicalStrategy debugStrategy(const ideal startIdeal, number unifParameter, ring startRing)
int Typ()
Definition: subexpr.cc:955
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
omInfo_t om_Info
Definition: omStats.c:13
leftv next
Definition: subexpr.h:87
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:92
Variable x
Definition: cfModGcd.cc:4023
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:456
void * CopyD(int t)
Definition: subexpr.cc:662