File: Mori.h

package info (click to toggle)
palp 2.1-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 1,164 kB
  • sloc: ansic: 20,792; makefile: 43
file content (152 lines) | stat: -rw-r--r-- 5,312 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
/* =========================================================== */
/* ===                                                     === */
/* ===                  M o r i . h                        === */
/* ===                                                     === */
/* ===	Authors: Maximilian Kreuzer, Nils-Ole Walliser	   === */
/* ===	Last update: 19/03/12                              === */
/* ===                                                     === */
/* =========================================================== */


/* ======================================================== */
/* =========            D E F I N I T I O N s     ========= */

/*** local for Moricone.c ***/
#define Inci64		unsigned long long

/* ====================================================== */
/* =========           T Y P E D E F s          ========= */

/*** from mori.c ***/
typedef struct {
  	int FilterFlag, g, m, P, K, i, t, c, d, a, b, D, H, I, M, Read_HyperSurfCounter;
} MORI_Flags;
/*
List of flags that correspond to the options of mori.x -h for
more info plus Read_HyperSurfCounter. The latter controls if an 
hypersurface class has been inserted (option -H). Avoids to type 
the hyper class each time that HyperSurfSingula() is called. 
HyperSurfSingular() is called for each triangulation of the polytope.
*/

/*** from Moricone.c ***/
typedef struct {
	int d, v, n, nmax;
	Inci64 *I;
} triang;
/*
INCIDENCE structure needed for Triangulation and SR-ideal data 
d: dimension of the lattice polytope
v: number of digits in an INCIDENCE
n: number of INCIDENCES
nmax: max number of n
I: INCIDENCE, (Inci64: unsigned long long)
*/

/* ====================================================== */
/* =========         P R O T O T Y P E s        ========= */

/*** from MoriCone.c ***/
void TriList_to_MoriList(PolyPointList *_P, FibW *F, MORI_Flags * _Flag);
/*
Having read the Polytope matrix, asks for the triangulation and computes
SR-Ideal and Mori cone of the ambient space. The user has to specify the
number of triangulations, the number of simplices and insert the
simplices in INCI format.
 */

void HyperSurfDivisorsQ(PolyPointList *_P,VertexNumList*V,EqList *E,
		MORI_Flags *Flag);
/*
Hypersurface divisors Q(charges) permutes the N-lattice points of
non-intersecting divisors to the end of the PPL *_P, calls IP_Simplex_Fiber
and then prints the charges = linear relations.
 */

void Subdivide(PolyPointList *P,int v,Inci64 I[],int p,Inci64 *T,int *t,
		MORI_Flags *_Flag, FibW *F);
/*
Triangulate and call InterSectionRing. Incidences of ni=*t bounding
equations on I[]; subdivide -> T[*t]; assuming 4 dimensions and at most 3
non-vertices, etc.; triangulate and call InterSectionRing(T,t,P,p...).
For each T[] if simplicial add <=3 pts by hand else use GKZ for <= 3d secondary
fan.
*/

void GKZsubdivide(Inci64 *F,int f,PolyPointList *P,int p,int *Tp,int *ntp,
		int nPS, MORI_Flags *_Flag, FibW *_F );
/*
List maximal 2ndary fans of facets with descending dimensions for all compatible
max triangulations make (induced) triangulation of facets. Depending in dim of
the 2ndary fan triangulates circuits calling either Triang1dSFan(), Triang2dSFan()
or Triang2dSFan(). If dim (2ndary fan) > 3 then exit(0);
*/

void InterSectionRing(Inci64 *Tri,int *t,PolyPointList *P, int p,
		MORI_Flags *_Flag, FibW *F);
/*
Print triangulation and call StanleyReisner(SR,T). Call HyperSurfaceSingular(P,T,SR...).
Call Print_Mori(P,p,t,Tri).
*/

void StanleyReisner(triang *SR,triang *T);
/*
Determine and print the SR ideal.
*/

void DivClassBasis(FILE *SF,PolyPointList *P,int v,char *D,char *B);
/*
Find basis for divisor classes, i.e. integral basis of intersection ring.
Simply trying to find toric divisors that span the lattice of DivClasses i.e. find
subdeterminants=volumes=1 for elimination.
*/


/*  ======  typedefs and functions related to INCIDENCEs  ======  */

Inci64 makeN(int N);
void putN(int N,Inci64 *I); /* make INCIDENCE */
void setN(int N,Inci64 *I); /* make INCIDENCE */
int  getN(int N,Inci64 I);  /* read INCIDENCE */

void prnI(int N,Inci64 I); /* print INCIDENCE */
void fprI(int N,Inci64 I); /* print INCIDENCE to file */

int Inci64_LE(Inci64 A,Inci64 B);
int Inci64_LT(Inci64 A,Inci64 B);

void PRNtriang(triang *SR,const char *c);
/*
print (Inci64) triangulation
*/

/*** from SingularInput.c ***/
void HyperSurfSingular(PolyPointList *P,triang *T, triang *SR ,MORI_Flags *_Flag ,
		FibW *F, int *cp);
/*
Interface between the Mori and SINGULAR. Given the polytope P and the linear relations
among their points, the triangulation T and the SR ideal it generates the the input
for SINGULAR.
*/


/*======== 	dependences from other modules  ======== */

/*** from Polynf.c ***/
void IP_Simplex_Fiber(Long PM[][POLY_Dmax], int p, int d, /* need PM[i]!=0 */ FibW *F, int Wmax, int CD);
/*
It analyzes the IP simplices among (1 <= codim <= CD) points of P*. 
Given the matrix CM of coordinates of p points in Z^d, the list W[i] of *nw
weight systems corresponding to IP-simplices spanned by the points in CM is
created. If codim!=0 only the IP-simplices with dimension > 1 and codimension
between 1 and codim are computed. It is assumed that p<=VERT_Nmax and that W 
can hold at least Wmax sets of coefficients.
*/

Long SimplexVolume(Long *V[POLY_Dmax+1],int d);



int nr_SR_elements;