Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vinci.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
Include dependency graph for vinci.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  T_Vertex
 
struct  T_VertexSet
 
struct  T_VertexSuperset
 
union  T_Key
 
struct  T_Tree
 

Macros

#define COPYRIGHT1   "(C) Benno Bueeler and Andreas Enge, {bueeler,enge}@ifor.math.ethz.ch"
 
#define COPYRIGHT2   " Developed in the ETHZ-EPFL project on Optimisation and Computational"
 
#define COPYRIGHT3   " Geometry with Komei Fukuda"
 
#define VERSION   "1"
 
#define VERSION_DATE   "March 1998"
 
#define T01   "The package computes the volume of a polytope whose vertices, defining"
 
#define T02   "hyperplanes and/or incidences of vertices and facettes are stored in files"
 
#define T03   "following Avis' and Fukuda's polytope format. The vertices are supposed to"
 
#define T04   "be in a file with extension '.ine', the hyperplanes in '.ext' and the"
 
#define T05   "incidences in '.icd' (see the sample files 'square.ext', 'square.icd' and"
 
#define T06   "'square.ine').\n"
 
#define T07   "Its basic call is 'vinci file' where 'file' stands for the polyhedron file"
 
#define T08   "name without extension, e. g. 'vinci square'. In this case the existing files"
 
#define T09   "and installed additional packages are analysed and according to the problem"
 
#define T10   "type an appropriate volume computation method is chosen automatically."
 
#define T11   ""
 
#define T12   "The following additional parameters are possible:"
 
#define T13   "-m followed by the label of a specific volume computation method; to see a"
 
#define T14   " list of the implemented methods, use 'vinci -m' without any label."
 
#define T15   "-p1, -p2 or -p3 which are valid for some methods. They determine the space"
 
#define T16   " and time complexity. Higher values lead to more space consume and a fast-"
 
#define T17   " er execution. If none of the parameters is specified the value"
 
#define T18   " DEFAULT_PRECOMP defined in 'vinci.h' is chosen."
 
#define T19   "-s directly followed by a natural integer. The value determines for how many"
 
#define T20   " recursion levels intermediate results are stored. A higher value speeds"
 
#define T21   " up certain methods considerably while needing more storage space."
 
#define T22   "-r directly followed by an integer. The value sets the random seed used for"
 
#define T23   " determining the objective function for Lawrence's formula."
 
#define T24   "\nFor more information please consult the manual."
 
#define LRS_EXEC   "lrs"
 
#define CDD_EXEC   "cddf+"
 
#define QHULL_EXEC   "qhull"
 
#define QHULL_OPTIONS   "d i Q0 Qz"
 
#define PIVOTING   1
 
#define MIN_PIVOT   0.5
 
#define PIVOTING_LASS   0
 
#define MIN_PIVOT_LASS   0.1
 
#define MAX_PRECOMP   3
 
#define DEFAULT_PRECOMP   1
 
#define DEFAULT_STORAGE   20
 
#define STATISTICS
 
#define NO_RATIONAL
 
#define NO_COG
 
#define EPSILON   1e-10
 
#define ARRAYSIZESTEP   5
 
#define FALSE   0
 
#define TRUE   1
 
#define EOLN   10 /* end of line character */
 
#define NONE   0 /* constants for data types in files */
 
#define INTEGER_T   1
 
#define REAL_T   2
 
#define RATIONAL_T   3
 
#define RCH   1 /* constants for the volume computation methods */
 
#define GS   2
 
#define GSH   3
 
#define HOT   4
 
#define HOTH   5
 
#define CDDP   6
 
#define CDDM   7
 
#define QHULL   8
 
#define LAWD   9
 
#define LAWND   10
 
#define RLASS   11
 
#define LRS   12
 
#define PREPARE   1 /* constants for precomputation of hyperplane intersections */
 
#define RETRIEVE   2
 
#define FREE   3
 
#define KEY_PLANES   1 /* constants for the key type actually used in the balanced */
 
#define KEY_VERTICES   2 /* tree routines */
 
#define KEY_PLANES_VAR   3
 
#define SCHMIDT   1 /* constants for the orthonormalisation technique used */
 
#define HOUSEHOLDER   2
 
#define STAT_SMALLEST_EXP   -200
 
#define STAT_BIGGEST_EXP   200
 

Typedefs

typedef double real
 
typedef int boolean
 
typedef unsigned char T_LassInt
 
typedef real rational
 
typedef struct T_Vertex T_Vertex
 
typedef struct T_VertexSet T_VertexSet
 
typedef struct T_VertexSuperset T_VertexSuperset
 
typedef union T_Key T_Key
 
typedef struct T_Tree T_Tree
 

Functions

void * my_malloc (long int size)
 
void * my_realloc (void *pointer, long int new_size, long int size_diff)
 
void my_free (void *pointer, long int size)
 
T_Vertexcreate_vertex ()
 
void free_vertex (T_Vertex *v)
 
void create_hyperplanes ()
 
void free_hyperplanes ()
 
void create_incidence ()
 
void free_incidence ()
 
T_VertexSetcreate_faces ()
 
void free_faces (T_VertexSet *face)
 
rational *** create_basis ()
 
void free_basis (rational ***basis)
 
rationalcreate_fact ()
 
void free_fact (rational *fact)
 
rationalcreate_vector ()
 
void free_vector (rational *v)
 
int * create_int_vector (int n)
 
void free_int_vector (int *v, int n)
 
rational ** create_matrix (int m, int n)
 
void redim_matrix (rational ***A, int m_alt, int m_neu, int n)
 
void free_matrix (rational **A, int m, int n)
 
void create_key (T_Key *key, int key_choice)
 
void free_key (T_Key key, int key_choice)
 
void tree_out (T_Tree **ppr, int *pi_balance, T_Key key, rational **volume, T_Key **keyfound, int key_choice)
 
void add_hypervar (T_LassInt hyperplane, T_LassInt variable, T_Key *key)
 
void delete_hypervar (T_LassInt hyperplane, T_LassInt variable, T_Key *key)
 
T_VertexSet create_empty_set (void)
 
T_VertexSet duplicate_set (T_VertexSet s)
 
rational normalise_vertices ()
 
void print_set (FILE *f, T_VertexSet s)
 
boolean empty (T_VertexSet s)
 
boolean is_in_set (T_Vertex *e, T_VertexSet s)
 
boolean is_contained (T_VertexSet s1, T_VertexSet s2)
 
boolean are_equal_sets (T_VertexSet s1, T_VertexSet s2)
 
void add_element (T_VertexSet *s, T_Vertex *e)
 
boolean delete_element (T_VertexSet *s, T_Vertex *e)
 
void intersect (T_VertexSet s1, T_VertexSet s2, T_VertexSet *inter)
 
T_VertexSupersetcreate_empty_superset (void)
 
void free_superset (T_VertexSuperset **S)
 
void print_superset (FILE *f, T_VertexSuperset *S)
 
boolean is_in_superset (T_VertexSet s, T_VertexSuperset *S)
 
void add_superelement (T_VertexSuperset **S, T_VertexSet s)
 
rational factorial (int n)
 
rational det_and_invert (rational **A, int rows, int columns, boolean verbose)
 
void simplex_volume (T_VertexSet S, rational *volume, boolean verbose)
 
T_VertexSetdo_intersections (int precomp, int i1, int i2, int i3, int action)
 
rational add_orthonormal_schmidt (int d, T_VertexSet face, rational **B, T_Vertex *vertex)
 
rational orthonormal_schmidt (int d, T_VertexSet face, rational **B)
 
rational add_orthonormal_householder (int d, T_VertexSet face, rational **H, T_Vertex *vertex)
 
rational orthonormal_householder (int d, T_VertexSet face, rational **H)
 
void volume_ch_file (rational *volume, char vertexfile[255], char incidencefile[255])
 
void volume_ortho_file (rational *volume, char vertexfile[255], char incidencefile[255], int key_choice, int ortho_choice)
 
void volume_cdd_file (rational *volume, int direction, char vertexfile[255])
 
void volume_qhull_file (rational *volume, char vertexfile[255])
 
void volume_lawrence_file (rational *volume, char vertexfile[255], char planesfile[255], char incidencefile[255])
 
void volume_lawrence_lrs_file (rational *volume, char planesfile[255])
 
void volume_lrs_file (rational *volume, char *rational_volume, char vertexfile[255])
 
void volume_lasserre_file (double planes2[7][4], rational *volume)
 

Variables

int G_d
 
int G_m
 
real ** G_Hyperplanes
 
T_VertexSetG_Incidence
 
T_VertexSet G_Vertices
 
int G_Precomp
 
int G_Storage
 
int G_RandomSeed
 
boolean G_OutOfMem
 
void * G_MemRes
 
rational G_Minus1
 
unsigned int Stat_Count
 
real Stat_Smallest
 
real Stat_Biggest
 
unsigned int Stat_CountPos [STAT_BIGGEST_EXP-STAT_SMALLEST_EXP+3]
 
unsigned int Stat_CountNeg [STAT_BIGGEST_EXP-STAT_SMALLEST_EXP+3]
 
unsigned int * Stat_CountStored
 
unsigned int * Stat_CountRetrieved
 
unsigned int Stat_CountShifts
 
long int Stat_ActualMem
 
long int Stat_MaxMem
 

Macro Definition Documentation

#define ARRAYSIZESTEP   5

Definition at line 130 of file vinci.h.

#define CDD_EXEC   "cddf+"

Definition at line 65 of file vinci.h.

#define CDDM   7

Definition at line 148 of file vinci.h.

#define CDDP   6

Definition at line 147 of file vinci.h.

#define COPYRIGHT1   "(C) Benno Bueeler and Andreas Enge, {bueeler,enge}@ifor.math.ethz.ch"

Definition at line 22 of file vinci.h.

#define COPYRIGHT2   " Developed in the ETHZ-EPFL project on Optimisation and Computational"

Definition at line 23 of file vinci.h.

#define COPYRIGHT3   " Geometry with Komei Fukuda"

Definition at line 24 of file vinci.h.

#define DEFAULT_PRECOMP   1

Definition at line 88 of file vinci.h.

#define DEFAULT_STORAGE   20

Definition at line 101 of file vinci.h.

#define EOLN   10 /* end of line character */

Definition at line 135 of file vinci.h.

#define EPSILON   1e-10

Definition at line 129 of file vinci.h.

#define FREE   3

Definition at line 157 of file vinci.h.

#define GS   2

Definition at line 143 of file vinci.h.

#define GSH   3

Definition at line 144 of file vinci.h.

#define HOT   4

Definition at line 145 of file vinci.h.

#define HOTH   5

Definition at line 146 of file vinci.h.

#define HOUSEHOLDER   2

Definition at line 164 of file vinci.h.

#define INTEGER_T   1

Definition at line 138 of file vinci.h.

#define KEY_PLANES   1 /* constants for the key type actually used in the balanced */

Definition at line 159 of file vinci.h.

Referenced by compare_key(), create_key(), free_key(), and tree_out().

#define KEY_PLANES_VAR   3

Definition at line 161 of file vinci.h.

Referenced by compare_key(), create_key(), free_key(), lass(), tree_out(), and VOLUME_LASSERRE_FILE().

#define KEY_VERTICES   2 /* tree routines */

Definition at line 160 of file vinci.h.

Referenced by compare_key(), and tree_out().

#define LAWD   9

Definition at line 150 of file vinci.h.

#define LAWND   10

Definition at line 151 of file vinci.h.

#define LRS   12

Definition at line 153 of file vinci.h.

#define LRS_EXEC   "lrs"

Definition at line 64 of file vinci.h.

#define MAX_PRECOMP   3

Definition at line 87 of file vinci.h.

#define MIN_PIVOT   0.5

Definition at line 71 of file vinci.h.

#define MIN_PIVOT_LASS   0.1

Definition at line 73 of file vinci.h.

Referenced by lass(), and shift_P().

#define NO_COG

Definition at line 115 of file vinci.h.

#define NO_RATIONAL

Definition at line 110 of file vinci.h.

#define NONE   0 /* constants for data types in files */

Definition at line 137 of file vinci.h.

#define PIVOTING   1

Definition at line 70 of file vinci.h.

#define PIVOTING_LASS   0

Definition at line 72 of file vinci.h.

#define PREPARE   1 /* constants for precomputation of hyperplane intersections */

Definition at line 155 of file vinci.h.

#define QHULL   8

Definition at line 149 of file vinci.h.

#define QHULL_EXEC   "qhull"

Definition at line 66 of file vinci.h.

#define QHULL_OPTIONS   "d i Q0 Qz"

Definition at line 67 of file vinci.h.

#define RATIONAL_T   3

Definition at line 140 of file vinci.h.

#define RCH   1 /* constants for the volume computation methods */

Definition at line 142 of file vinci.h.

#define REAL_T   2

Definition at line 139 of file vinci.h.

#define RETRIEVE   2

Definition at line 156 of file vinci.h.

#define RLASS   11

Definition at line 152 of file vinci.h.

#define SCHMIDT   1 /* constants for the orthonormalisation technique used */

Definition at line 163 of file vinci.h.

#define STAT_BIGGEST_EXP   200

Definition at line 168 of file vinci.h.

#define STAT_SMALLEST_EXP   -200

Definition at line 167 of file vinci.h.

#define STATISTICS

Definition at line 106 of file vinci.h.

#define T01   "The package computes the volume of a polytope whose vertices, defining"

Definition at line 28 of file vinci.h.

#define T02   "hyperplanes and/or incidences of vertices and facettes are stored in files"

Definition at line 29 of file vinci.h.

#define T03   "following Avis' and Fukuda's polytope format. The vertices are supposed to"

Definition at line 30 of file vinci.h.

#define T04   "be in a file with extension '.ine', the hyperplanes in '.ext' and the"

Definition at line 31 of file vinci.h.

#define T05   "incidences in '.icd' (see the sample files 'square.ext', 'square.icd' and"

Definition at line 32 of file vinci.h.

#define T06   "'square.ine').\n"

Definition at line 33 of file vinci.h.

#define T07   "Its basic call is 'vinci file' where 'file' stands for the polyhedron file"

Definition at line 34 of file vinci.h.

#define T08   "name without extension, e. g. 'vinci square'. In this case the existing files"

Definition at line 35 of file vinci.h.

#define T09   "and installed additional packages are analysed and according to the problem"

Definition at line 36 of file vinci.h.

#define T10   "type an appropriate volume computation method is chosen automatically."

Definition at line 37 of file vinci.h.

#define T11   ""

Definition at line 38 of file vinci.h.

#define T12   "The following additional parameters are possible:"

Definition at line 39 of file vinci.h.

#define T13   "-m followed by the label of a specific volume computation method; to see a"

Definition at line 40 of file vinci.h.

#define T14   " list of the implemented methods, use 'vinci -m' without any label."

Definition at line 41 of file vinci.h.

#define T15   "-p1, -p2 or -p3 which are valid for some methods. They determine the space"

Definition at line 42 of file vinci.h.

#define T16   " and time complexity. Higher values lead to more space consume and a fast-"

Definition at line 43 of file vinci.h.

#define T17   " er execution. If none of the parameters is specified the value"

Definition at line 44 of file vinci.h.

#define T18   " DEFAULT_PRECOMP defined in 'vinci.h' is chosen."

Definition at line 45 of file vinci.h.

#define T19   "-s directly followed by a natural integer. The value determines for how many"

Definition at line 46 of file vinci.h.

#define T20   " recursion levels intermediate results are stored. A higher value speeds"

Definition at line 47 of file vinci.h.

#define T21   " up certain methods considerably while needing more storage space."

Definition at line 48 of file vinci.h.

#define T22   "-r directly followed by an integer. The value sets the random seed used for"

Definition at line 49 of file vinci.h.

#define T23   " determining the objective function for Lawrence's formula."

Definition at line 50 of file vinci.h.

#define T24   "\nFor more information please consult the manual."

Definition at line 51 of file vinci.h.

#define VERSION   "1"

Definition at line 25 of file vinci.h.

#define VERSION_DATE   "March 1998"

Definition at line 26 of file vinci.h.

Typedef Documentation

typedef int boolean

Definition at line 183 of file vinci.h.

typedef real rational

Definition at line 189 of file vinci.h.

typedef double real

Definition at line 182 of file vinci.h.

typedef union T_Key T_Key

Definition at line 236 of file vinci.h.

typedef unsigned char T_LassInt

Definition at line 184 of file vinci.h.

typedef struct T_Tree T_Tree

Definition at line 244 of file vinci.h.

typedef struct T_Vertex T_Vertex

Definition at line 197 of file vinci.h.

typedef struct T_VertexSet T_VertexSet

Definition at line 208 of file vinci.h.

Definition at line 217 of file vinci.h.

Function Documentation

void add_element ( T_VertexSet s,
T_Vertex e 
)
void add_hypervar ( T_LassInt  hyperplane,
T_LassInt  variable,
T_Key key 
)

Definition at line 168 of file vinci_lass.c.

Referenced by lass().

176 { int i, j;
177 
178  if (hyperplane != G_m+1)
179  {
180  for (i = 0; (*key).hypervar.hyperplanes [i] < hyperplane; i++);
181  if ((*key).hypervar.hyperplanes [i] != hyperplane)
182  { /* insert index */
183  for (j = G_d; j > i; j--)
184  (*key).hypervar.hyperplanes [j] = (*key).hypervar.hyperplanes [j-1];
185  (*key).hypervar.hyperplanes [i] = hyperplane;
186  }
187  }
188 
189  if (variable != G_d+1)
190  {
191  for (i = 0; (*key).hypervar.variables [i] < variable; i++);
192  if ((*key).hypervar.variables [i] != variable)
193  { /* insert index */
194  for (j = G_d; j > i; j--)
195  (*key).hypervar.variables [j] = (*key).hypervar.variables [j-1];
196  (*key).hypervar.variables [i] = variable;
197  }
198  }
199 }
int G_m
Definition: vinci_lass.c:51
blockLoc i
Definition: read.cpp:79
j indices j
Definition: Indexing.h:6
int G_d
Definition: vinci_lass.c:50

Here is the caller graph for this function:

rational add_orthonormal_householder ( int  d,
T_VertexSet  face,
rational **  H,
T_Vertex vertex 
)
rational add_orthonormal_schmidt ( int  d,
T_VertexSet  face,
rational **  B,
T_Vertex vertex 
)
void add_superelement ( T_VertexSuperset **  S,
T_VertexSet  s 
)
boolean are_equal_sets ( T_VertexSet  s1,
T_VertexSet  s2 
)
rational*** create_basis ( )
T_VertexSet create_empty_set ( void  )
T_VertexSuperset* create_empty_superset ( void  )
T_VertexSet* create_faces ( )
rational* create_fact ( )
void create_hyperplanes ( )
void create_incidence ( )
int* create_int_vector ( int  n)

Referenced by create_key(), and shift_P().

Here is the caller graph for this function:

void create_key ( T_Key key,
int  key_choice 
)

Definition at line 131 of file vinci_lass.c.

Referenced by tree_out(), and VOLUME_LASSERRE_FILE().

134 {
135  switch (key_choice)
136  {
137  case KEY_PLANES:
138  key -> hyperplanes = create_int_vector (G_d + 1);
139  break;
140  case KEY_PLANES_VAR:
141  key -> hypervar.hyperplanes =
142  (T_LassInt *) my_malloc ((G_Storage + 2) * sizeof (T_LassInt));
143  key -> hypervar.variables =
144  (T_LassInt *) my_malloc ((G_Storage + 2) * sizeof (T_LassInt));
145  break;
146  }
147 }
int * create_int_vector(int n)
void * my_malloc(long int size)
Definition: vinci_lass.c:90
#define KEY_PLANES_VAR
Definition: vinci.h:161
int G_Storage
Definition: vinci_lass.c:58
#define KEY_PLANES
Definition: vinci.h:159
int G_d
Definition: vinci_lass.c:50
T_LassInt * variables
Definition: vinci.h:232
int * hyperplanes
Definition: vinci.h:224
unsigned char T_LassInt
Definition: vinci.h:184

Here is the caller graph for this function:

rational** create_matrix ( int  m,
int  n 
)
rational* create_vector ( )
T_Vertex* create_vertex ( )
boolean delete_element ( T_VertexSet s,
T_Vertex e 
)
void delete_hypervar ( T_LassInt  hyperplane,
T_LassInt  variable,
T_Key key 
)

Definition at line 204 of file vinci_lass.c.

Referenced by lass().

209 { int i, j;
210 
211  if (hyperplane != G_m+1)
212  {
213  for (i = 0; i <= G_d && (*key).hypervar.hyperplanes [i] != hyperplane; i++);
214  if (i != G_d + 1)
215  { /* index found, delete it */
216  for (j = i; (*key).hypervar.hyperplanes [j] != G_m + 1; j++)
217  (*key).hypervar.hyperplanes [j] = (*key).hypervar.hyperplanes [j+1];
218  }
219  }
220 
221  if (variable != G_d+1)
222  {
223  for (i = 0; i <= G_d && (*key).hypervar.variables [i] != variable; i++);
224  if (i != G_d + 1)
225  { /* index found, delete it */
226  for (j = i; (*key).hypervar.variables [j] != G_d + 1; j++)
227  (*key).hypervar.variables [j] = (*key).hypervar.variables [j+1];
228  }
229  }
230 }
int G_m
Definition: vinci_lass.c:51
blockLoc i
Definition: read.cpp:79
j indices j
Definition: Indexing.h:6
int G_d
Definition: vinci_lass.c:50

Here is the caller graph for this function:

rational det_and_invert ( rational **  A,
int  rows,
int  columns,
boolean  verbose 
)
T_VertexSet* do_intersections ( int  precomp,
int  i1,
int  i2,
int  i3,
int  action 
)
T_VertexSet duplicate_set ( T_VertexSet  s)

Definition at line 1028 of file vinci_lass.c.

Referenced by tree_out().

1031 { T_VertexSet newset;
1032 
1033  newset.maxel = s.lastel;
1034  newset.lastel = s.lastel;
1035  newset.loe = (T_Vertex **) my_malloc ((s.lastel + 1) * sizeof (T_Vertex *));
1036  memcpy (newset.loe, s.loe, (s.lastel + 1) * sizeof (T_Vertex *));
1037  return newset;
1038 }
T_Vertex ** loe
Definition: vinci.h:204
void * my_malloc(long int size)
Definition: vinci_lass.c:90
int maxel
Definition: vinci.h:201
int lastel
Definition: vinci.h:202

Here is the caller graph for this function:

rational factorial ( int  n)
void free_basis ( rational ***  basis)
void free_faces ( T_VertexSet face)
void free_fact ( rational fact)
void free_hyperplanes ( )
void free_incidence ( )
void free_int_vector ( int *  v,
int  n 
)

Definition at line 248 of file vinci_lass.c.

Referenced by free_key().

251 {
252  my_free (v, n * sizeof (int));
253 }
void my_free(void *pointer, long int size)
Definition: vinci_lass.c:121
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
const NT & n

Here is the caller graph for this function:

void free_key ( T_Key  key,
int  key_choice 
)

Definition at line 151 of file vinci_lass.c.

Referenced by VOLUME_LASSERRE_FILE().

154 {
155  switch (key_choice)
156  {
157  case KEY_PLANES:
158  free_int_vector (key.hyperplanes, G_d + 1);
159  break;
160  case KEY_PLANES_VAR:
161  my_free (key.hypervar.hyperplanes, (G_Storage + 2) * sizeof (T_LassInt));
162  my_free (key.hypervar.variables, (G_Storage + 2) * sizeof (T_LassInt));
163  break;
164  }
165 }
void my_free(void *pointer, long int size)
Definition: vinci_lass.c:121
void free_int_vector(int *v, int n)
Definition: vinci_lass.c:248
struct T_Key::@40 hypervar
#define KEY_PLANES_VAR
Definition: vinci.h:161
int G_Storage
Definition: vinci_lass.c:58
#define KEY_PLANES
Definition: vinci.h:159
int G_d
Definition: vinci_lass.c:50
T_LassInt * variables
Definition: vinci.h:232
int * hyperplanes
Definition: vinci.h:224
unsigned char T_LassInt
Definition: vinci.h:184

Here is the caller graph for this function:

void free_matrix ( rational **  A,
int  m,
int  n 
)
void free_superset ( T_VertexSuperset **  S)
void free_vector ( rational v)
void free_vertex ( T_Vertex v)

Referenced by QualityMetric::compute_element_numerical_hessian().

Here is the caller graph for this function:

void intersect ( T_VertexSet  s1,
T_VertexSet  s2,
T_VertexSet inter 
)

Referenced by P_triRay().

Here is the caller graph for this function:

boolean is_contained ( T_VertexSet  s1,
T_VertexSet  s2 
)
boolean is_in_set ( T_Vertex e,
T_VertexSet  s 
)
boolean is_in_superset ( T_VertexSet  s,
T_VertexSuperset S 
)
void my_free ( void *  pointer,
long int  size 
)

Definition at line 121 of file vinci_lass.c.

Referenced by free_int_vector(), free_key(), and lass().

125 {
126  free (pointer);
127 }

Here is the caller graph for this function:

void* my_malloc ( long int  size)

Definition at line 90 of file vinci_lass.c.

Referenced by compact(), create_int_vector(), create_key(), duplicate_set(), lass(), my_malloc(), tree_out(), and VOLUME_LASSERRE_FILE().

94 { void *pointer;
95 
96  pointer = malloc (size);
97 
98  if (pointer == NULL)
99  if (!G_OutOfMem)
100  {
101  fprintf (stderr, "\n***** WARNING: Out of memory; freeing memory reserve\n");
102  free (G_MemRes);
103  G_OutOfMem = TRUE;
104  pointer = my_malloc (size);
105  }
106  else
107  {
108  fprintf (stderr, "\n***** ERROR: Out of memory\n");
109  exit (0);
110  }
111  else
112  {
113 
114  }
115 
116  return pointer;
117 }
void * my_malloc(long int size)
Definition: vinci_lass.c:90
boolean G_OutOfMem
Definition: vinci_lass.c:61
#define TRUE
Definition: vinci.h:134
void * G_MemRes
Definition: vinci_lass.c:62

Here is the caller graph for this function:

void* my_realloc ( void *  pointer,
long int  new_size,
long int  size_diff 
)
rational normalise_vertices ( )
rational orthonormal_householder ( int  d,
T_VertexSet  face,
rational **  H 
)
rational orthonormal_schmidt ( int  d,
T_VertexSet  face,
rational **  B 
)
void print_set ( FILE *  f,
T_VertexSet  s 
)
void print_superset ( FILE *  f,
T_VertexSuperset S 
)
void redim_matrix ( rational ***  A,
int  m_alt,
int  m_neu,
int  n 
)
void simplex_volume ( T_VertexSet  S,
rational volume,
boolean  verbose 
)
void tree_out ( T_Tree **  ppr,
int *  pi_balance,
T_Key  key,
rational **  volume,
T_Key **  keyfound,
int  key_choice 
)

Definition at line 870 of file vinci_lass.c.

Referenced by lass(), and tree_out().

883 { T_Tree *p1, *p2;
884  int cmp;
885 
886  /* Are we grounded? If so, add the node here and set the rebalance flag, then exit. */
887  if (!*ppr)
888  {
889  if (G_OutOfMem)
890  { /* don't allocate if out of memory */
891  *volume = &G_Minus1;
892  }
893  else
894  { (*ppr) = (T_Tree *) my_malloc (sizeof (T_Tree));
895  (*ppr) -> tree_l = NULL;
896  (*ppr) -> tree_r = NULL;
897  (*ppr) -> tree_b = 0;
898  /* copy the key into the new node */
899  create_key (&((*ppr) -> key), key_choice);
900  switch (key_choice)
901  {
902  case KEY_PLANES:
903  memcpy ((*ppr) -> key.hyperplanes, key.hyperplanes,
904  (G_d + 1) * sizeof (int));
905  break;
906  case KEY_VERTICES:
907  (*ppr) -> key.vertices.set = duplicate_set (key.vertices.set);
908  (*ppr) -> key.vertices.d = key.vertices.d;
909  break;
910  case KEY_PLANES_VAR:
911  memcpy ((*ppr) -> key.hypervar.hyperplanes, key.hypervar.hyperplanes,
912  (G_Storage + 2) * sizeof (T_LassInt));
913  memcpy ((*ppr) -> key.hypervar.variables, key.hypervar.variables,
914  (G_Storage + 2) * sizeof (T_LassInt));
915  break;
916  }
917  (*ppr) -> vol = -1; /* to recognise that element is newly created */
918  *volume = &((*ppr) -> vol);
919  *pi_balance = TRUE;
920  }
921  return;
922  }
923 
924  cmp = compare_key ((*ppr) -> key, key, key_choice);
925 
926  /* if LESS, prepare to move to the left. */
927  if (cmp < 0)
928  {
929  tree_out (&((*ppr) -> tree_l), pi_balance, key, volume, keyfound, key_choice);
930  if (*pi_balance)
931  { /* left branch has grown longer */
932  switch ((*ppr) -> tree_b)
933  {
934  case 1: /* right branch WAS longer; balance is ok now */
935  /* LESS: case 1.. balance restored implicitly */
936  (*ppr) -> tree_b = 0;
937  *pi_balance = FALSE;
938  break;
939  case 0: /* balance WAS okay; now left branch longer */
940  /* LESS: case 0.. balance bad but still ok */
941  (*ppr) -> tree_b = -1;
942  break;
943  case -1: /* left branch was already too long. rebalance */
944  p1 = (*ppr) -> tree_l;
945  if (p1 -> tree_b == -1)
946  { /* LESS: single LL */
947  (*ppr) -> tree_l = p1->tree_r;
948  p1 -> tree_r = (*ppr);
949  (*ppr) -> tree_b = 0;
950  (*ppr) = p1;
951  }
952  else
953  { /* LESS: real LR */
954  p2 = p1 -> tree_r;
955  p1 -> tree_r = p2 -> tree_l;
956  p2 -> tree_l = p1;
957  (*ppr) -> tree_l = p2 -> tree_r;
958  p2 -> tree_r = (*ppr);
959  if (p2 -> tree_b == -1)
960  (*ppr) -> tree_b = 1;
961  else (*ppr) -> tree_b = 0;
962  if (p2->tree_b == 1)
963  p1 -> tree_b = -1;
964  else p1 -> tree_b = 0;
965  (*ppr) = p2;
966  }
967  (*ppr) -> tree_b = 0;
968  *pi_balance = FALSE;
969  } /* switch */
970  } /* if */
971  } /* cmp < 0 */
972 
973  /* if MORE, prepare to move to the right. */
974  else if (cmp > 0)
975  {
976  tree_out (&((*ppr) -> tree_r), pi_balance, key, volume, keyfound, key_choice);
977  if (*pi_balance)
978  { /* right branch has grown longer */
979  switch ((*ppr) -> tree_b)
980  {
981  case -1: /* MORE: balance was off, fixed implicitly */
982  (*ppr) -> tree_b = 0;
983  *pi_balance = FALSE;
984  break;
985  case 0: /* MORE: balance was okay, now off but ok */
986  (*ppr)->tree_b = 1;
987  break;
988  case 1: /* MORE: balance was off, need to rebalance */
989  p1 = (*ppr) -> tree_r;
990  if (p1 -> tree_b == 1)
991  { /* MORE: single RR */
992  (*ppr) -> tree_r = p1 -> tree_l;
993  p1 -> tree_l = (*ppr);
994  (*ppr) -> tree_b = 0;
995  (*ppr) = p1;
996  }
997  else
998  { /* MORE: real RL */
999  p2 = p1 -> tree_l;
1000  p1 -> tree_l = p2 -> tree_r;
1001  p2 -> tree_r = p1;
1002  (*ppr) -> tree_r = p2 -> tree_l;
1003  p2 -> tree_l = (*ppr);
1004  if (p2 -> tree_b == 1)
1005  (*ppr) -> tree_b = -1;
1006  else (*ppr) -> tree_b = 0;
1007  if (p2 -> tree_b == -1)
1008  p1 -> tree_b = 1;
1009  else p1 -> tree_b = 0;
1010  (*ppr) = p2;
1011  }
1012  (*ppr) -> tree_b = 0;
1013  *pi_balance = FALSE;
1014  } /* switch */
1015  } /* if */
1016  } /* cmp > 0 */
1017 
1018  /* not less, not more: this is the same key! give volume back! */
1019  else
1020  {
1021  *pi_balance = FALSE;
1022  *volume = &((*ppr) -> vol);
1023  *keyfound = &((*ppr) -> key);
1024  }
1025 }
#define FALSE
Definition: vinci.h:133
if(dy > dx)
struct T_Tree * tree_r
Definition: vinci.h:239
Definition: vinci.h:238
NT p1
struct T_Key::@39 vertices
#define KEY_VERTICES
Definition: vinci.h:160
void * my_malloc(long int size)
Definition: vinci_lass.c:90
void tree_out(T_Tree **ppr, int *pi_balance, T_Key key, rational **volume, T_Key **keyfound, int key_choice)
Definition: vinci_lass.c:870
rational G_Minus1
Definition: vinci_lass.c:63
T_VertexSet duplicate_set(T_VertexSet s)
Definition: vinci_lass.c:1028
int volume(const block *b)
Definition: split.cpp:181
boolean G_OutOfMem
Definition: vinci_lass.c:61
#define TRUE
Definition: vinci.h:134
struct T_Key::@40 hypervar
#define KEY_PLANES_VAR
Definition: vinci.h:161
void create_key(T_Key *key, int key_choice)
Definition: vinci_lass.c:131
int tree_b
Definition: vinci.h:240
int d
Definition: vinci.h:228
int G_Storage
Definition: vinci_lass.c:58
#define KEY_PLANES
Definition: vinci.h:159
static int compare_key(T_Key key1, T_Key key2, int key_choice)
Definition: vinci_lass.c:818
int G_d
Definition: vinci_lass.c:50
static T_Key key
Definition: vinci_lass.c:76
T_LassInt * variables
Definition: vinci.h:232
int * hyperplanes
Definition: vinci.h:224
T_VertexSet set
Definition: vinci.h:227
unsigned char T_LassInt
Definition: vinci.h:184

Here is the caller graph for this function:

void volume_cdd_file ( rational volume,
int  direction,
char  vertexfile[255] 
)
void volume_ch_file ( rational volume,
char  vertexfile[255],
char  incidencefile[255] 
)
void volume_lasserre_file ( double  planes2[7][4],
rational volume 
)

Definition at line 800 of file vinci_lass.c.

Referenced by volratio().

800  {
801  VOLUME_LASSERRE_FILE( planes2, volume);
802 }
int volume(const block *b)
Definition: split.cpp:181
void VOLUME_LASSERRE_FILE(double planes2[7][4], rational *volume)
Definition: vinci_lass.c:737

Here is the caller graph for this function:

void volume_lawrence_file ( rational volume,
char  vertexfile[255],
char  planesfile[255],
char  incidencefile[255] 
)
void volume_lawrence_lrs_file ( rational volume,
char  planesfile[255] 
)
void volume_lrs_file ( rational volume,
char *  rational_volume,
char  vertexfile[255] 
)
void volume_ortho_file ( rational volume,
char  vertexfile[255],
char  incidencefile[255],
int  key_choice,
int  ortho_choice 
)
void volume_qhull_file ( rational volume,
char  vertexfile[255] 
)

Variable Documentation

real** G_Hyperplanes

Definition at line 53 of file vinci_lass.c.

Referenced by compact(), and VOLUME_LASSERRE_FILE().

T_VertexSet* G_Incidence

Definition at line 54 of file vinci_lass.c.

void* G_MemRes

Definition at line 62 of file vinci_lass.c.

Referenced by lass(), my_malloc(), and VOLUME_LASSERRE_FILE().

rational G_Minus1

Definition at line 63 of file vinci_lass.c.

Referenced by tree_out().

boolean G_OutOfMem

Definition at line 61 of file vinci_lass.c.

Referenced by lass(), my_malloc(), tree_out(), and VOLUME_LASSERRE_FILE().

int G_Precomp

Definition at line 57 of file vinci_lass.c.

int G_RandomSeed

Definition at line 59 of file vinci_lass.c.

int G_Storage

Definition at line 58 of file vinci_lass.c.

Referenced by create_key(), free_key(), lass(), tree_out(), and VOLUME_LASSERRE_FILE().

T_VertexSet G_Vertices

Definition at line 55 of file vinci_lass.c.

long int Stat_ActualMem
real Stat_Biggest
unsigned int Stat_Count
unsigned int Stat_CountNeg[STAT_BIGGEST_EXP-STAT_SMALLEST_EXP+3]
unsigned int Stat_CountPos[STAT_BIGGEST_EXP-STAT_SMALLEST_EXP+3]
unsigned int * Stat_CountRetrieved
unsigned int Stat_CountShifts
unsigned int* Stat_CountStored
long int Stat_MaxMem
real Stat_Smallest