25 #include "pips_config.h"
67 #include "constants.h"
84 #define PIP_BIN "pip4"
85 #define PIP_OPTION "-s"
86 #define PIP_IN_FILE "pip_in"
87 #define PIP_OUT_FILE "pip_out"
341 int q, bigparm, ni, nvar, nq, non_vide, nparm, nc, p, xq;
346 bool not_found =
true;
349 int nb_unknowns, len_big;
352 debug(5,
"pip_solve_min_with_big",
"begin\n");
357 debug(5,
"pip_solve_min_with_big",
"Input Psysteme:\n");
359 debug(5,
"pip_solve_min_with_big",
"Input Context:\n");
361 fprintf(stderr,
"Number of variables : %d\n", nb_unknowns);
372 ps_dep->dimension =
vect_size( ps_dep->base );
376 len_big = strlen(big);
378 while ((not_found) && (lbase !=
NIL))
389 if (not_found) infinite_num = -1;
394 if (ps_context != NULL) {
396 ps_context->dimension =
vect_size( ps_context->base );
406 if (!SC_EMPTY_P(ps_context))
414 nparm = ps_dep->dimension - nb_unknowns;
415 ni = (ps_dep->nb_eq * 2) + ps_dep->nb_ineq;;
416 nc = ((ps_context == NULL)? 0 :
417 (ps_context->nb_eq * 2) + ps_context->nb_ineq );
418 bigparm = infinite_num;
420 debug(5,
"pip_solve_min_with_big",
"%d %d %d %d %d %d\n",\
421 nvar, nparm, ni, nc, bigparm, nq );
430 if (ps_context != NULL)
443 else non_vide =
True;
475 if (pv1 == NULL)
return pv2;
479 for( pv = pv11 ; pv != NULL; pv = pv->
succ) {
481 if (pv->
succ != NULL)
continue;
506 int int_or_rat, min_or_max;
509 int infinite_num, nb_unknowns;
512 int q, bigparm, ni, nvar, nq, non_vide, nparm, nc, p, xq;
519 debug(5,
"pip_solve",
"begin\n");
520 if (ps_dep == NULL) {
521 user_warning(
"new_pip_solve",
"\nInput Psysteme is empty !\n");
528 debug(5,
"pip_solve",
"Input Psysteme:\n");
530 debug(5,
"pip_solve",
"Input Context:\n");
532 fprintf(stderr,
"Number of variables : %d\n", nb_unknowns);
540 ps_dep->dimension =
vect_size( ps_dep->base );
557 if (ps_context != NULL) {
559 ps_context->dimension =
vect_size( ps_context->base );
569 if(! SC_EMPTY_P(ps_context) ) {
576 nparm = ps_dep->dimension - nb_unknowns;
577 ni = (ps_dep->nb_eq * 2) + ps_dep->nb_ineq;;
578 nc = ((ps_context == NULL)? 0 :
579 (ps_context->nb_eq * 2) + ps_context->nb_ineq );
580 bigparm = infinite_num;
582 debug(5,
"pip_solve",
"%d %d %d %d %d %d\n",
583 nvar, nparm, ni, nc, bigparm, nq );
592 if (ps_context != NULL) {
601 traiter( ctxt, NULL, nq,
UN, nparm, 0, nc, 0, -1 );
605 else non_vide =
True;
632 return(
pip_solve( ps_dep, ps_context, pv_unknowns,
641 return(
pip_solve( ps_dep, ps_context, pv_unknowns,
650 return(
pip_solve( ps_dep, ps_context, pv_unknowns,
659 return(
pip_solve( ps_dep, ps_context, pv_unknowns,
707 message_assert(
"variable not in global vector", rank_1>=0 && rank_2>=0);
711 return((rank_1==0 || rank_2==0) ? rank_1-rank_2 : rank_2-rank_1);
733 if(SC_EMPTY_P(ps))
return;
int rank_of_variable(Pbase base, Variable var)
this function returns the rank of the variable var in the base 0 encodes TCST, but I do not know why,...
Pbase base_normalize(Pbase b)
Pbase base_union(Pbase b1, Pbase b2)
Pbase base_union(Pbase b1, Pbase b2): compute a new basis containing all elements of b1 and all eleme...
bdt base
Current expression.
#define NIL
The empty list (nil in Lisp)
#define CAR(pcons)
Get the value of the first element of a list.
#define CDR(pcons)
Get the list less its first element.
list base_to_list(Pbase base)
Most includes are centralized here.
int vect_size(Pvecteur v)
package vecteur - reductions
#define user_warning(fn,...)
int get_debug_level(void)
GET_DEBUG_LEVEL returns the current debugging level.
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
#define message_assert(msg, ex)
void imprime_quast(FILE *, quast)
===========================================================================
void fprint_psysteme(FILE *, Psysteme)
===========================================================================
#define PIP_SOLVE_RATIONAL
#define PIP_SOLVE_INTEGER
Pvecteur vect_add_first(Pvecteur pv1, Pvecteur pv2)
======================================================================
quast pip_integer_min(Psysteme ps_dep, Psysteme ps_context, Pvecteur pv_unknowns)
==================================================================
quast pip_rational_min(Psysteme ps_dep, Psysteme ps_context, Pvecteur pv_unknowns)
==================================================================
Pbase old_base
Base of the parameters.
Pbase base_ref
Base of the unknowns.
static Pbase base_for_sort
==================================================================
quast pip_integer_max(Psysteme ps_dep, Psysteme ps_context, Pvecteur pv_unknowns)
==================================================================
Pbase old_base_var
Base of the unknowns.
quast pip_rational_max(Psysteme ps_dep, Psysteme ps_context, Pvecteur pv_unknowns)
==================================================================
quast quast_act
Global variables
int allocation
External variables for direct call to PIP.
Pbase base_var_ref
Tag for MIN or MAX resolution.
#define INLENGTH
Variables for the direct call to PIP version.
void sort_psysteme(Psysteme ps, Pvecteur pv)
==================================================================
FILE * dump
Should not be used : put here for Pip copatibility.
quast pip_solve_min_with_big(Psysteme ps_dep, Psysteme ps_context, Pvecteur pv_unknowns, char *big)
==========================================================================
static int compare_variables_in_base(Pvecteur *pv1, Pvecteur *pv2)
function for qsort.
quast pip_solve(Psysteme ps_dep, Psysteme ps_context, Pvecteur pv_unknowns, int int_or_rat, int min_or_max)
==========================================================================
int integer_sol_edit(int i)
Useful for the sorting of the variables in the system's Pvecteur.
int rational_sol_edit(int i)
==========================================================================
Tableau * sc_to_tableau(Psysteme in_ps, int nb_var)
==========================================================================
Pvecteur vect_reversal(Pvecteur vect_in)
Pvecteur vect_reversal(Pvecteur vect_in); produces the reversal vector of the vect_in.
Psysteme converti_psysmin_psysmax(Psysteme p_systmin, int nb_var)
Name: converti_psysmin_psysmax
const char * entity_local_name(entity e)
entity_local_name modified so that it does not core when used in vect_fprint, since someone thought t...
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
void sc_vect_sort(Psysteme s, int(*compare)(Pvecteur *, Pvecteur *))
the name is self explanatory, I guess.
void init_new_base()
Name: init_new_base.
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
The structure used to build lists in NewGen.
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
#define base_dimension(b)
Pvecteur vect_dup(Pvecteur v_in)
Pvecteur vect_dup(Pvecteur v_in): duplication du vecteur v_in; allocation de et copie dans v_out;.
Pbase base_dup(Pbase b)
Pbase base_dup(Pbase b) Note: this function changes the value of the pointer.
Pvecteur vect_substract(Pvecteur v1, Pvecteur v2)
Pvecteur vect_substract(Pvecteur v1, Pvecteur v2): allocation d'un vecteur v dont la valeur est la di...
void vect_erase_var(Pvecteur *ppv, Variable v)
void vect_erase_var(Pvecteur * ppv, Variable v): projection du vecteur *ppv selon la direction v (i....