My Project
Toggle main menu visibility
Loading...
Searching...
No Matches
Singular
dyn_modules
gfanlib
groebnerComplex.cc
Go to the documentation of this file.
1
#include "
misc/options.h
"
2
#include "
bbfan.h
"
3
4
#include "
groebnerCone.h
"
5
#include "
startingCone.h
"
6
#include "
groebnerFan.h
"
7
#include "
tropicalTraversal.h
"
8
9
#include "
ppinitialReduction.h
"
10
11
gfan::ZFan*
groebnerComplex
(
const
tropicalStrategy
currentStrategy)
12
{
13
groebnerCone
startingCone =
groebnerStartingCone
(currentStrategy);
14
groebnerCones
tropicalVariety
=
groebnerTraversal
(startingCone);
15
return
toFanStar
(
tropicalVariety
);
16
}
17
18
19
BOOLEAN
groebnerComplex
(
leftv
res
,
leftv
args)
20
{
21
leftv
u = args;
22
if
((u!=
NULL
) && (u->
Typ
()==
IDEAL_CMD
))
23
{
24
ideal I = (ideal) u->
Data
();
25
leftv
v
= u->
next
;
26
if
((
v
!=
NULL
) && (
v
->Typ()==
NUMBER_CMD
))
27
{
28
leftv
w
=
v
->next;
29
if
(
w
==
NULL
)
30
{
31
number
p
= (number)
v
->Data();
32
tropicalStrategy
currentStrategy(I,
p
,
currRing
);
33
if
((I->m[0]!=
NULL
) && (
idElem
(I)==1))
34
{
35
try
36
{
37
ideal startingIdeal = currentStrategy.
getStartingIdeal
();
38
ring startingRing = currentStrategy.
getStartingRing
();
39
currentStrategy.
pReduce
(startingIdeal,startingRing);
40
poly
g
= startingIdeal->m[0];
41
pReduceInhomogeneous
(
g
, currentStrategy.
getUniformizingParameter
(), startingRing);
42
gfan::ZFan* zf =
groebnerFanOfPolynomial
(
g
,startingRing,
true
);
43
res
->rtyp =
fanID
;
44
res
->data = (
char
*) zf;
45
return
FALSE
;
46
}
47
catch
(
const
std::exception& ex)
48
{
49
WerrorS
(
"ERROR: "
);
WerrorS
(ex.what());
WerrorS
(
"\n"
);
50
return
TRUE
;
51
}
52
}
53
else
54
{
55
try
56
{
57
gfan::ZFan* zf =
groebnerComplex
(currentStrategy);
58
res
->rtyp =
fanID
;
59
res
->data = (
char
*) zf;
60
return
FALSE
;
61
}
62
catch
(
const
std::exception& ex)
63
{
64
WerrorS
(
"ERROR: "
);
WerrorS
(ex.what());
WerrorS
(
"\n"
);
65
return
TRUE
;
66
}
67
}
68
}
69
}
70
}
71
if
((u!=
NULL
) && (u->
Typ
()==
POLY_CMD
))
72
{
73
poly
g
= (poly) u->
Data
();
74
leftv
v
= u->
next
;
75
if
((
v
!=
NULL
) && (
v
->Typ()==
NUMBER_CMD
))
76
{
77
leftv
w
=
v
->next;
78
if
(
w
==
NULL
)
79
{
80
try
81
{
82
number
p
= (number)
v
->Data();
83
ideal I =
idInit
(1);
84
I->m[0] =
p_Copy
(
g
,
currRing
);
85
tropicalStrategy
currentStrategy(I,
p
,
currRing
);
86
ideal startingIdeal = currentStrategy.
getStartingIdeal
();
87
ring startingRing = currentStrategy.
getStartingRing
();
88
poly gg = startingIdeal->m[0];
89
pReduceInhomogeneous
(gg, currentStrategy.
getUniformizingParameter
(), startingRing);
90
gfan::ZFan* zf =
groebnerFanOfPolynomial
(gg,startingRing,
true
);
91
id_Delete
(&I,
currRing
);
92
res
->rtyp =
fanID
;
93
res
->data = (
char
*) zf;
94
return
FALSE
;
95
}
96
catch
(
const
std::exception& ex)
97
{
98
WerrorS
(
"ERROR: "
);
WerrorS
(ex.what());
WerrorS
(
"\n"
);
99
return
TRUE
;
100
}
101
}
102
}
103
}
104
WerrorS
(
"groebnerComplex: unexpected parameters"
);
105
return
TRUE
;
106
}
BOOLEAN
int BOOLEAN
Definition
auxiliary.h:88
TRUE
#define TRUE
Definition
auxiliary.h:101
FALSE
#define FALSE
Definition
auxiliary.h:97
fanID
VAR int fanID
Definition
bbfan.cc:19
bbfan.h
toFanStar
gfan::ZFan * toFanStar(std::set< gfan::ZCone > setOfCones)
Definition
callgfanlib_conversion.cc:137
p
int p
Definition
cfModGcd.cc:4086
g
g
Definition
cfModGcd.cc:4098
groebnerCone
Definition
groebnerCone.h:28
sleftv::Typ
int Typ()
Definition
subexpr.cc:1048
sleftv::Data
void * Data()
Definition
subexpr.cc:1192
sleftv::next
leftv next
Definition
subexpr.h:86
tropicalStrategy
Definition
tropicalStrategy.h:37
tropicalStrategy::pReduce
void pReduce(ideal I, const ring r) const
Definition
tropicalStrategy.cc:437
tropicalStrategy::getStartingRing
ring getStartingRing() const
returns the polynomial ring over the valuation ring
Definition
tropicalStrategy.h:176
tropicalStrategy::getStartingIdeal
ideal getStartingIdeal() const
returns the input ideal
Definition
tropicalStrategy.h:185
tropicalStrategy::getUniformizingParameter
number getUniformizingParameter() const
returns the uniformizing parameter in the valuation ring
Definition
tropicalStrategy.h:207
res
CanonicalForm res
Definition
facAbsFact.cc:60
w
const CanonicalForm & w
Definition
facAbsFact.cc:51
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition
facBivar.h:39
WerrorS
void WerrorS(const char *s)
Definition
feFopen.cc:24
IDEAL_CMD
@ IDEAL_CMD
Definition
grammar.cc:285
NUMBER_CMD
@ NUMBER_CMD
Definition
grammar.cc:289
POLY_CMD
@ POLY_CMD
Definition
grammar.cc:290
groebnerComplex
gfan::ZFan * groebnerComplex(const tropicalStrategy currentStrategy)
Definition
groebnerComplex.cc:11
groebnerCone.h
implementation of the class groebnerCone
groebnerCones
std::set< groebnerCone, groebnerCone_compare > groebnerCones
Definition
groebnerCone.h:24
groebnerFanOfPolynomial
gfan::ZFan * groebnerFanOfPolynomial(poly g, ring r, bool onlyLowerHalfSpace=false)
Definition
groebnerFan.cc:36
groebnerFan.h
NULL
#define NULL
Definition
omList.c:12
options.h
p_Copy
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition
p_polys.h:848
currRing
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition
polys.cc:13
pReduceInhomogeneous
void pReduceInhomogeneous(poly &g, const number p, const ring r)
Definition
ppinitialReduction.cc:132
ppinitialReduction.h
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
idElem
static int idElem(const ideal F)
number of non-zero polys in F
Definition
simpleideals.h:69
groebnerStartingCone
groebnerCone groebnerStartingCone(const tropicalStrategy ¤tStrategy)
Definition
startingCone.cc:21
startingCone.h
leftv
sleftv * leftv
Definition
structs.h:53
groebnerTraversal
groebnerCones groebnerTraversal(const groebnerCone startingCone)
Definition
tropicalTraversal.cc:141
tropicalTraversal.h
tropicalVariety
BOOLEAN tropicalVariety(leftv res, leftv args)
Definition
tropicalVariety.cc:43
Generated on
for My Project by
doxygen 1.17.0
for
Singular