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 946 of file tropicalStrategy.cc.

947 {
948  leftv u = args;
949  if ((u!=NULL) && (u->Typ()==IDEAL_CMD))
950  {
951  leftv v = u->next;
952  if ((v!=NULL) && (v->Typ()==NUMBER_CMD))
953  {
954  leftv w = v->next;
955  if ((w!=NULL) && (w->Typ()==BIGINTMAT_CMD))
956  {
957  leftv x = w->next;
958  if ((x!=NULL) && (x->Typ()==BIGINTMAT_CMD))
959  {
960  omUpdateInfo();
961  Print("usedBytesBefore=%ld\n",om_Info.UsedBytes);
962 
963  ideal I = (ideal) u->CopyD();
964  number p = (number) v->CopyD();
965  bigintmat* interiorPoint0 = (bigintmat*) w->CopyD();
966  bigintmat* facetNormal0 = (bigintmat*) x->CopyD();
968 
969  gfan::ZVector* interiorPoint = bigintmatToZVector(interiorPoint0);
970  gfan::ZVector* facetNormal = bigintmatToZVector(facetNormal0);
971  std::pair<ideal,ring> Js = debug.computeFlip(I,currRing,*interiorPoint,*facetNormal);
972  ideal J = Js.first;
973  ring s = Js.second;
974 
975  id_Delete(&J,s);
976  rDelete(s);
977 
978  id_Delete(&I,currRing);
979  n_Delete(&p,currRing->cf);
980  delete interiorPoint0;
981  delete facetNormal0;
982  delete interiorPoint;
983  delete facetNormal;
984 
985  res->rtyp = NONE;
986  res->data = NULL;
987  return FALSE;
988  }
989  }
990  }
991  }
992  WerrorS("computeFlipDebug: unexpected parameters");
993  return TRUE;
994 }
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
const ideal
Definition: gb_hack.h:42
void id_Delete(ideal *h, ring r)
#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:949
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:455
#define NONE
Definition: tok.h:170
void * CopyD(int t)
Definition: subexpr.cc:656
gfan::ZVector * bigintmatToZVector(const bigintmat &bim)
BOOLEAN computeWitnessDebug ( leftv  res,
leftv  args 
)

Definition at line 909 of file tropicalStrategy.cc.

910 {
911  leftv u = args;
912  if ((u!=NULL) && (u->Typ()==IDEAL_CMD))
913  {
914  leftv v = u->next;
915  if ((v!=NULL) && (v->Typ()==IDEAL_CMD))
916  {
917  leftv w = v->next;
918  if ((w!=NULL) && (w->Typ()==IDEAL_CMD))
919  {
920  leftv x = w->next;
921  if ((x!=NULL) && (x->Typ()==NUMBER_CMD))
922  {
923  omUpdateInfo();
924  Print("usedBytesBefore=%ld\n",om_Info.UsedBytes);
925 
926  ideal inJ = (ideal) u->CopyD();
927  ideal inI = (ideal) v->CopyD();
928  ideal I = (ideal) w->CopyD();
929  number p = (number) x->CopyD();
931  ideal J = debug.computeWitness(inJ,inI,I,currRing);
932  id_Delete(&inJ,currRing);
933  id_Delete(&inI,currRing);
934  id_Delete(&I,currRing);
935  n_Delete(&p,currRing->cf);
936  res->rtyp = IDEAL_CMD;
937  res->data = (char*) J;
938  return FALSE;
939  }
940  }
941  }
942  }
943  return TRUE;
944 }
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
const ideal
Definition: gb_hack.h:42
void id_Delete(ideal *h, ring r)
#define TRUE
Definition: auxiliary.h:144
static tropicalStrategy debugStrategy(const ideal startIdeal, number unifParameter, ring startRing)
int Typ()
Definition: subexpr.cc:949
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:455
void * CopyD(int t)
Definition: subexpr.cc:656