PIPS
|
#include <stdlib.h>
#include <stdio.h>
#include "linear_assert.h"
#include "arithmetique.h"
#include "boolean.h"
#include "vecteur.h"
#include "contrainte.h"
#include "sc.h"
Go to the source code of this file.
Functions | |
void | norm_syst (Psysteme sc) |
norm_syst(Psysteme): division des contraintes, egalites ou inegalites, par le PGCD des coefficients de chaque contrainte; More... | |
Psysteme | sc_make (Pcontrainte leg, Pcontrainte lineg) |
Psysteme sc_make(Pcontrainte leg, Pcontrainte lineg): allocation et initialisation d'un systeme d'equations et inequations lineaires a partir de deux listes de contraintes, une liste d'egalites et une liste d'inegalites. More... | |
Psysteme | sc_translate (Psysteme s, Pbase b, char *(*variable_name)()) |
Psysteme sc_translate(Psysteme s, Pbase b, char * (*variable_name)()): reecriture du systeme s dans la base b basee sur les noms des vecteurs de base; tous les vecteurs de base utilises dans s doivent avoir un vecteur de base de meme nom dans b. More... | |
Psysteme | sc_substitute_dimension (Psysteme s, Variable i, Pvecteur v) |
Psysteme sc_substitute_dimension(Psysteme s, Variable i, Pvecteur v): The ith dimension of all constraints c is updated: More... | |
Psysteme | sc_variable_rename (Psysteme s, Variable v_old, Variable v_new) |
Psysteme sc_variable_rename(Psysteme s, Variable v_old, Variable v_new): reecriture du systeme s remplacant toutes les occurences de la coordonnees v_old par des occurences de v_new. More... | |
Psysteme | sc_rename_variables (Psysteme s, bool(*renamed_p)(), Variable(*new_variable)()) |
Psysteme sc_rename_variables(s, renamed_p, new_variable) Psysteme s; bool (*renamed_p)(Variable); Variable (*new_variable)(Variable);. More... | |
Psysteme | sc_variables_rename (Psysteme s, Pvecteur pv_old, Pvecteur pv_new, get_variable_name_t variable_name) |
Psysteme sc_variables_rename(Psysteme s, Pvecteur pv_old, Pvecteur pv_new): reecriture du systeme s remplacant toutes les occurences des coordonnees de pv_old par des occurences de pv_new. More... | |
void | sc_base_remove_variable (Psysteme sc, Variable v) |
void | sc_base_add_variable (Psysteme sc, Variable var) |
bool | sc_consistent_p (Psysteme sc) |
bool sc_consistent_p(Psysteme sc): check that sc is well defined, that the numbers of equalities and inequalities are consistent with the lists of equalities and inequalities, and that every variable in the constraints is in the base More... | |
bool | sc_weak_consistent_p (Psysteme sc) |
check that sc is well defined, that the numbers of equalities and inequalities are consistent with the lists of equalities and inequalities, that the dimension is consistent with the basis, that the basis itself is consistent (all coefficients must be 1), and that every variable in the constraints is in the basis. More... | |
void | sc_separate_on_vars (Psysteme s, Pbase b, Psysteme *pwith, Psysteme *pwithout) |
void norm_syst | ( | Psysteme | sc | ) |
norm_syst(Psysteme): division des contraintes, egalites ou inegalites, par le PGCD des coefficients de chaque contrainte;
la faisabilite ou la non-faisabilite n'est pas testee: le terme constant ne devrait pas etre pris en compte dans norm_eq().
Definition at line 53 of file sc.c.
References eq, norm_eq(), and Scontrainte::succ.
Definition at line 248 of file sc.c.
References b1, VALUE_ONE, variable_equal(), vect_new(), VECTEUR_NUL_P, and vecteur_var.
Referenced by add_value_to_transformer_space(), fortran_user_call_to_transformer(), and sc_restricted_to_variables_transitive_closure().
Definition at line 239 of file sc.c.
References base_remove_variable().
Referenced by cell_reference_sc_exact_projection_along_variable(), loop_regions_normalize(), new_system_with_only_live_variable(), parametric_transformer_empty_p(), region_exact_projection_along_variable(), region_sc_projection_along_variables_ofl_ctrl(), region_sc_projection_ofl_along_parameters(), sc_projection_optim_along_vecteur_ofl(), transformer_combine(), transformer_filter(), and transformer_projection_with_redundancy_elimination_and_check().
bool sc_consistent_p(Psysteme sc): check that sc is well defined, that the numbers of equalities and inequalities are consistent with the lists of equalities and inequalities, and that every variable in the constraints is in the base
Francois Irigoin, 7 July 1993
Note:
This assert is too bad ! I remove it.
Alexis Platonoff, 31 january 1995
Definition at line 282 of file sc.c.
References base_difference(), base_dimension, base_normalized_p(), BASE_NULLE_P, BASE_UNDEFINED, CONTRAINTE_UNDEFINED, Ssysteme::egalites, eq, fprintf(), Ssysteme::inegalites, Ssysteme::nb_eq, Ssysteme::nb_ineq, safe_nb_elems_list(), Scontrainte::succ, Svecteur::succ, TCST, VALUE_ONE, Svecteur::var, vect_chg_coeff(), vect_dump(), Scontrainte::vecteur, and VECTEUR_UNDEFINED.
Referenced by add_bounding_box_constraints(), build_third_comb(), gcd_and_constant_dependence_test(), prepare_reindexing(), sc_bounded_normalization(), sc_proj_optim_on_di_ofl(), sc_projection_optim_along_vecteur_ofl(), simplify_float_constraint_system(), and TestDependence().
Psysteme sc_make | ( | Pcontrainte | leg, |
Pcontrainte | lineg | ||
) |
Psysteme sc_make(Pcontrainte leg, Pcontrainte lineg): allocation et initialisation d'un systeme d'equations et inequations lineaires a partir de deux listes de contraintes, une liste d'egalites et une liste d'inegalites.
ATTENTION: les deux listes leg et lineq ne sont pas dupliquees; un appel a cette fonction peut donc creer du sharing entre structures de donnees
Ancien nom: mk_syst()
Modifications:
Definition at line 78 of file sc.c.
References Ssysteme::base, Ssysteme::egalites, Ssysteme::inegalites, MALLOC, nb_elems_list(), Ssysteme::nb_eq, Ssysteme::nb_ineq, sc_creer_base(), SYSTEME, and VECTEUR_UNDEFINED.
Referenced by adg_dataflowgraph(), adg_dataflowgraph_with_extremities(), adg_max_of_leaves(), adg_suppress_2nd_in_1st_ps(), affine_to_transformer(), algorithm_row_echelon_generic(), broadcast_conditions(), build_third_comb(), check_range_wrt_precondition(), constraint_to_bound(), constraints_to_loop_bound(), dj_simple_inegs_to_eg(), dj_system_complement(), expression_and_precondition_to_integer_interval(), extract_common_syst(), extract_nredund_subsystem(), fortran_user_function_call_to_transformer(), generic_equality_to_transformer(), generic_minmax_to_transformer(), get_other_constraints(), include_trans_on_LC_in_ref(), include_trans_on_LC_in_sc(), include_trans_on_LC_in_sc2(), integer_divide_to_transformer(), integer_expression_and_precondition_to_integer_interval(), integer_power_to_transformer(), integer_right_shift_to_transformer(), integer_value_and_precondition_to_integer_interval(), logical_binary_function_to_transformer(), logical_constant_to_transformer(), make_primal(), pa_path_to_few_disjunct_ofl_ctrl(), partial_broadcast_coefficients(), prepare_reindexing(), relation_to_transformer(), sc_empty(), sc_gen_write(), sc_separate_on_vars(), sc_strong_normalize2(), sc_strong_normalize_and_check_feasibility(), sc_strong_normalize_and_check_feasibility2(), sc_supress_parallel_redund_constraints(), sc_supress_same_constraints(), simple_addition_to_transformer(), simple_affine_to_transformer(), suppress_sc_in_sc(), system_inversion_restrict(), transformer_add_loop_index_initialization(), transformer_identity(), and transitive_closure_system().
Psysteme sc_rename_variables(s, renamed_p, new_variable) Psysteme s; bool (*renamed_p)(Variable); Variable (*new_variable)(Variable);.
what: driven renaming of variables in s. how: scans, decides and replaces. input: Psysteme s, plus the decision and replacement functions output: s is returned. side effects:
renamed_p | what: driven renaming of variables in s. how: scans, decides and replaces. input: Psysteme s, plus the decision and replacement functions output: s is returned. side effects:
|
new_variable | what: driven renaming of variables in s. how: scans, decides and replaces. input: Psysteme s, plus the decision and replacement functions output: s is returned. side effects:
|
Definition at line 198 of file sc.c.
References contrainte_vecteur, new_variable, Scontrainte::succ, and vect_rename_variables().
Referenced by shift_system_to_prime_variables().
Definition at line 418 of file sc.c.
References Pcontrainte_separate_on_vars(), and sc_make().
Referenced by generate_remapping_code().
Psysteme sc_substitute_dimension(Psysteme s, Variable i, Pvecteur v): The ith dimension of all constraints c is updated:
c = c + c_i v
Vector v is untouched
translate all equations
translate all inequalities
update basis in s
Definition at line 130 of file sc.c.
References Ssysteme::base, contrainte_substitute_dimension(), CONTRAINTE_UNDEFINED_P, Ssysteme::egalites, Ssysteme::inegalites, sc_creer_base(), Scontrainte::succ, and vect_rm().
Psysteme sc_translate(Psysteme s, Pbase b, char * (*variable_name)()): reecriture du systeme s dans la base b basee sur les noms des vecteurs de base; tous les vecteurs de base utilises dans s doivent avoir un vecteur de base de meme nom dans b.
translate all equations
translate all inequalities
update basis in s; its dimension should not change
Definition at line 99 of file sc.c.
References contrainte_translate(), CONTRAINTE_UNDEFINED_P, Scontrainte::succ, variable_name(), and vect_translate().
Referenced by main().
Psysteme sc_variable_rename(Psysteme s, Variable v_old, Variable v_new): reecriture du systeme s remplacant toutes les occurences de la coordonnees v_old par des occurences de v_new.
v_new MUST NOT already be in the base.
rename all equations
rename all inequalities
update basis in s; its dimension should not change
Definition at line 157 of file sc.c.
References assert, CONTRAINTE_UNDEFINED_P, contrainte_variable_rename(), Scontrainte::succ, VALUE_ZERO, vect_coeff(), and vect_variable_rename().
Referenced by adg_dataflowgraph(), c_convex_effects_on_actual_parameter_forward_translation(), copy_write_statement_with_cumulated_regions(), dj_variable_rename(), interlaced_basic_workchunk_regions_p(), sc_change_baseindex(), sc_variables_rename(), transformer_combine(), transformer_domain_intersection(), and transformer_value_substitute().
Psysteme sc_variables_rename | ( | Psysteme | s, |
Pvecteur | pv_old, | ||
Pvecteur | pv_new, | ||
get_variable_name_t | variable_name | ||
) |
Psysteme sc_variables_rename(Psysteme s, Pvecteur pv_old, Pvecteur pv_new): reecriture du systeme s remplacant toutes les occurences des coordonnees de pv_old par des occurences de pv_new.
Definition at line 224 of file sc.c.
References base_find_variable_name(), sc_variable_rename(), Svecteur::succ, Svecteur::var, variable_name(), VARIABLE_UNDEFINED_P, VECTEUR_UNDEFINED_P, and vecteur_var.
Referenced by loop_nest_movement_generation(), loop_nest_to_wp65_code(), and movement_computation().
check that sc is well defined, that the numbers of equalities and inequalities are consistent with the lists of equalities and inequalities, that the dimension is consistent with the basis, that the basis itself is consistent (all coefficients must be 1), and that every variable in the constraints is in the basis.
Each component in the basis should only appear once thanks to the specifications of Pvecteur (this is not checked).
Francois Irigoin, 13 November 1995
Note:
The test is broken down into three lines to increase the information available when Valgrind detects a memory access error.
Definition at line 362 of file sc.c.
References base_dimension, base_included_p(), base_normalized_p(), BASE_NULLE, base_rm, Ssysteme::egalites, eq, Ssysteme::inegalites, nb_elems_list(), Ssysteme::nb_eq, Ssysteme::nb_ineq, Scontrainte::succ, Svecteur::succ, TCST, VALUE_ONE, Svecteur::var, vect_chg_coeff(), and Scontrainte::vecteur.
Referenced by main(), region_consistent_p(), sc_elim_redund_with_first_ofl_ctrl(), sc_simplex_feasibility_ofl_ctrl_fixprec(), sc_strong_normalize2(), sc_strong_normalize_and_check_feasibility(), sc_strong_normalize_and_check_feasibility2(), TestDependence(), transformer_formal_parameter_projection(), transformer_general_consistency_p(), and transformer_return_value_projection().