PIPS
sc_debug.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include "linear_assert.h"
#include "boolean.h"
#include "arithmetique.h"
#include "vecteur.h"
#include "contrainte.h"
#include "sc.h"
#include "sc-private.h"
+ Include dependency graph for sc_debug.c:

Go to the source code of this file.

Macros

#define SC_DEBUG_LEVEL   "SC_DEBUG_LEVEL"
 
#define SC_SWITCH_HEURISTIC_FLAG   "SC_SWITCH_HEURISTIC_FLAG"
 

Typedefs

typedef char *(* var_name_t) (Variable)
 

Functions

void set_sc_debug_level (int l)
 SET FUNCTIONS. More...
 
static void set_sc_switch_heuristic_flag (int l)
 
void sc_variable_name_push (char *(*fun)(Variable))
 
static void sc_variable_name_init (void)
 
void sc_variable_name_pop (void)
 
char * default_variable_to_string (Variable v)
 
void initialize_sc (char *(*var_to_string)(Variable))
 

Variables

int sc_debug_level = 0
 
int sc_switch_heuristic_flag = 0
 
static var_name_tvar_name_stack = NULL
 
static int var_name_stack_index = 0
 
static int var_name_stack_size = 0
 next available chunck More...
 

Macro Definition Documentation

◆ SC_DEBUG_LEVEL

#define SC_DEBUG_LEVEL   "SC_DEBUG_LEVEL"

Definition at line 46 of file sc_debug.c.

◆ SC_SWITCH_HEURISTIC_FLAG

#define SC_SWITCH_HEURISTIC_FLAG   "SC_SWITCH_HEURISTIC_FLAG"

Definition at line 47 of file sc_debug.c.

Typedef Documentation

◆ var_name_t

typedef char*(* var_name_t) (Variable)

Definition at line 211 of file sc_debug.c.

Function Documentation

◆ default_variable_to_string()

char* default_variable_to_string ( Variable  v)

Definition at line 245 of file sc_debug.c.

246 {
248  return (*(var_name_stack[var_name_stack_index-1]))(v);
249 }
#define assert(ex)
Definition: newgen_assert.h:41
static int var_name_stack_index
Definition: sc_debug.c:214
static var_name_t * var_name_stack
Definition: sc_debug.c:213

References assert, var_name_stack, and var_name_stack_index.

Referenced by chose_variable_to_project_for_feasability(), hyperplane(), new_system_with_only_live_variable(), sc_default_dump(), sc_default_dump_to_files(), sc_fm_project_variables(), and sc_fourier_motzkin_feasibility_ofl_ctrl().

+ Here is the caller graph for this function:

◆ initialize_sc()

void initialize_sc ( char *(*)(Variable var_to_string)

sc debug

sc switch heuristic

variable name stuff

Definition at line 253 of file sc_debug.c.

254 {
255  char * tmp;
256 
257  /* sc debug */
258  tmp = getenv(SC_DEBUG_LEVEL);
259  if (tmp) set_sc_debug_level(atoi(tmp));
260 
261  /* sc switch heuristic */
262  tmp = getenv(SC_SWITCH_HEURISTIC_FLAG);
263  if (tmp) set_sc_switch_heuristic_flag(atoi(tmp));
264 
265 #ifdef FILTERING
266 
267  /* timeout filtering*/
268  tmp = getenv(FLAG_FILTERING_TIMEOUT_JANUS);
269  if (tmp) set_filtering_timeout_J(atoi(tmp));
270 
271  tmp = getenv(FLAG_FILTERING_TIMEOUT_LINEAR_SIMPLEX);
272  if (tmp) set_filtering_timeout_S(atoi(tmp));
273 
274  tmp = getenv(FLAG_FILTERING_TIMEOUT_FM);
275  if (tmp) set_filtering_timeout_FM(atoi(tmp));
276 
277  tmp = getenv(FLAG_FILTERING_TIMEOUT_CONVEX_HULL);
278  if (tmp) set_filtering_timeout_convex_hull(atoi(tmp));
279 
280  tmp = getenv(FLAG_FILTERING_TIMEOUT_PROJECTION);
281  if (tmp) set_filtering_timeout_projection(atoi(tmp));
282 
283  /* size filtering*/
284  tmp = getenv(FLAG_FILTERING_DIMENSION_FEASIBILITY);
285  if (tmp) set_filtering_dimension_feasibility(atoi(tmp));
286 
287  tmp = getenv(FLAG_FILTERING_NUMBER_CONSTRAINTS_FEASIBILITY);
288  if (tmp) set_filtering_number_constraints_feasibility(atoi(tmp));
289 
290  tmp = getenv(FLAG_FILTERING_DENSITY_FEASIBILITY);
291  if (tmp) set_filtering_density_feasibility(atoi(tmp));
292 
293  tmp = getenv(FLAG_FILTERING_MAGNITUDE_FEASIBILITY);
294  if (tmp) set_filtering_magnitude_feasibility(atol(tmp));
295 
296  tmp = getenv(FLAG_FILTERING_DIMENSION_PROJECTION);
297  if (tmp) set_filtering_dimension_projection(atoi(tmp));
298 
299  tmp = getenv(FLAG_FILTERING_NUMBER_CONSTRAINTS_PROJECTION);
300  if (tmp) set_filtering_number_constraints_projection(atoi(tmp));
301 
302  tmp = getenv(FLAG_FILTERING_DENSITY_PROJECTION);
303  if (tmp) set_filtering_density_projection(atoi(tmp));
304 
305  tmp = getenv(FLAG_FILTERING_MAGNITUDE_PROJECTION);
306  if (tmp) set_filtering_magnitude_projection(atol(tmp));
307 
308  tmp = getenv(FLAG_FILTERING_DIMENSION_CONVEX_HULL);
309  if (tmp) set_filtering_dimension_convex_hull(atoi(tmp));
310 
311  tmp = getenv(FLAG_FILTERING_NUMBER_CONSTRAINTS_CONVEX_HULL);
312  if (tmp) set_filtering_number_constraints_convex_hull(atoi(tmp));
313 
314  tmp = getenv(FLAG_FILTERING_DENSITY_CONVEX_HULL);
315  if (tmp) set_filtering_density_convex_hull(atoi(tmp));
316 
317  tmp = getenv(FLAG_FILTERING_MAGNITUDE_CONVEX_HULL);
318  if (tmp) set_filtering_magnitude_convex_hull(atol(tmp));
319 
320 #endif
321 
322  /* variable name stuff */
324  sc_variable_name_push(var_to_string);
325 
326  ifscdebug(1)
327  fprintf(stderr, "[initialize_sc] Value: " LINEAR_VALUE_STRING "\n");
328 }
#define LINEAR_VALUE_STRING
default: LINEAR_VALUE_IS_INT
int Value
#define SC_SWITCH_HEURISTIC_FLAG
Definition: sc_debug.c:47
void set_sc_debug_level(int l)
SET FUNCTIONS.
Definition: sc_debug.c:121
#define SC_DEBUG_LEVEL
Definition: sc_debug.c:46
static void set_sc_switch_heuristic_flag(int l)
Definition: sc_debug.c:126
void sc_variable_name_push(char *(*fun)(Variable))
Definition: sc_debug.c:217
static void sc_variable_name_init(void)
Definition: sc_debug.c:228
void initialize_sc(char *(*var_to_string)(Variable))
Definition: sc_debug.c:253
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...

References fprintf(), LINEAR_VALUE_STRING, SC_DEBUG_LEVEL, SC_SWITCH_HEURISTIC_FLAG, sc_variable_name_init(), sc_variable_name_push(), set_sc_debug_level(), and set_sc_switch_heuristic_flag().

Referenced by atinit(), gpips_main(), main(), pips_main(), tpips_init(), and wpips_main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sc_variable_name_init()

static void sc_variable_name_init ( void  )
static

Definition at line 228 of file sc_debug.c.

229 {
231 
233  var_name_stack_size = 10;
237 }
void * malloc(YYSIZE_T)
char * variable_default_name(Variable v)
char * variable_default_name(Variable v): returns the name of variable v
Definition: variable.c:81
char *(* var_name_t)(Variable)
Definition: sc_debug.c:211
static int var_name_stack_size
next available chunck
Definition: sc_debug.c:215

References assert, malloc(), sc_variable_name_push(), var_name_stack, var_name_stack_index, var_name_stack_size, and variable_default_name().

Referenced by initialize_sc().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sc_variable_name_pop()

void sc_variable_name_pop ( void  )

Definition at line 239 of file sc_debug.c.

240 {
243 }

References assert, and var_name_stack_index.

Referenced by generic_module_name_to_transformers(), module_name_to_preconditions(), and module_name_to_total_preconditions().

+ Here is the caller graph for this function:

◆ sc_variable_name_push()

void sc_variable_name_push ( char *(*)(Variable fun)

◆ set_sc_debug_level()

void set_sc_debug_level ( int  l)

SET FUNCTIONS.

Let's change variables directly here, except sc_debug_level? or use functions returning values, within private variables? DN

Definition at line 121 of file sc_debug.c.

122 {
123  sc_debug_level = l ;
124 }
int sc_debug_level
Definition: sc_debug.c:89

References sc_debug_level.

Referenced by initialize_sc().

+ Here is the caller graph for this function:

◆ set_sc_switch_heuristic_flag()

static void set_sc_switch_heuristic_flag ( int  l)
static

Definition at line 126 of file sc_debug.c.

127 {
129 }
int sc_switch_heuristic_flag
Definition: sc_debug.c:90

References sc_switch_heuristic_flag.

Referenced by initialize_sc().

+ Here is the caller graph for this function:

Variable Documentation

◆ sc_debug_level

int sc_debug_level = 0

Definition at line 89 of file sc_debug.c.

Referenced by set_sc_debug_level().

◆ sc_switch_heuristic_flag

int sc_switch_heuristic_flag = 0

Definition at line 90 of file sc_debug.c.

Referenced by set_sc_switch_heuristic_flag().

◆ var_name_stack

var_name_t* var_name_stack = NULL
static

◆ var_name_stack_index

int var_name_stack_index = 0
static

◆ var_name_stack_size

int var_name_stack_size = 0
static

next available chunck

Definition at line 215 of file sc_debug.c.

Referenced by sc_variable_name_init(), and sc_variable_name_push().