PIPS
|
#include <stdlib.h>
#include <stdio.h>
#include "linear_assert.h"
#include <string.h>
#include "boolean.h"
#include "arithmetique.h"
#include "vecteur.h"
Go to the source code of this file.
Functions | |
Pvecteur | vect_read (Pbase *b) |
INTLIBRARY. More... | |
void | vect_fprint (FILE *f, Pvecteur v, get_variable_name_t variable_name) |
void vect_fprint(FILE * f, Pvecteur v, char * (*variable_name)()): impression d'un vecteur creux v sur le fichier f; le nom de chaque coordonnee est donne par la fonction variable_name() More... | |
void | vect_fprint_as_dense (FILE *f, Pvecteur v, Pbase b) |
void vect_fprint_as_dense(FILE * f, Pvecteur v, Pbase b): More... | |
void | vect_fprint_as_monome (FILE *f, Pvecteur v, Pbase b, get_variable_name_t variable_name, char *mult_symbol) |
void vect_fprint_as_monome(FILE * f, Pvecteur v, Pbase b, char * (*variable_name)(), char *mult_symbol): impression d'un vecteur creux considere comme un monome sans coefficient. More... | |
char * | vect_sprint_as_monome (Pvecteur v, Pbase b, get_variable_name_t variable_name, char *mult_symbol) |
char *vect_sprint_as_monome(Pvecteur v, Pbase b, char * (*variable_name)(), char *mult_symbol): Retourne dans une chaine le Pvecteur considere comme un monome sans coefficient. More... | |
void | vect_dump (Pvecteur v) |
void vect_dump(Pvecteur v): print sparse vector v on stderr. More... | |
void | vect_print (Pvecteur v, get_variable_name_t variable_name) |
void vect_print(Pvecteur v, char * (*variable_name)()): impression d'un vecteur creux v sur stdout; le nom de chaque coordonnee est donne par la fonction variable_name(); voir vect_fprint() More... | |
void | vect_fdump (FILE *f, Pvecteur v) |
void vect_fdump(FILE * f, Pvecteur v): impression d'un vecteur creux par vect_fprint() avec passage de la fonction variable_debug_name() More... | |
void | base_fprint (FILE *f, Pbase b, get_variable_name_t variable_name) |
void base_fprint(FILE * f, Pbase b, char * (*variable_name)()): impression d'une base sur le fichier f; le nom de chaque coordonnee est donne par la fonction variable_name() More... | |
void base_fprint | ( | FILE * | f, |
Pbase | b, | ||
get_variable_name_t | variable_name | ||
) |
void base_fprint(FILE * f, Pbase b, char * (*variable_name)()): impression d'une base sur le fichier f; le nom de chaque coordonnee est donne par la fonction variable_name()
Par exemple, la base b -> -> -> -> b == ( i j k ) est imprime sous la forme i j k LF ou les symboles i, j et k sont obtenus via la fonction pointee par variable_name()
Le base vide est represente par base vide LF
Note: attention au linefeed final il n'existe pas de fonction relisant une base sous cette forme
variable_name | ariable_name |
Definition at line 342 of file io.c.
References f(), fprintf(), Svecteur::succ, Svecteur::var, variable_name(), and VECTEUR_NUL_P.
Referenced by build_transfer_equations(), create_tile_basis(), hyperplane(), loop_nest_to_wp65_code(), print_dependence_cone(), print_loopnest_dependence_cone(), sc_default_dump(), sc_default_dump_to_files(), sc_dump(), sc_fprint_for_sc_fscan(), and sc_image_computation().
void vect_dump | ( | Pvecteur | v | ) |
void vect_dump(Pvecteur v): print sparse vector v on stderr.
By default, each dimension/variable is represented by an X followed by its hexadeximal address.
Intended for debug purposes. Its behavior depends on the setting of pointer variable_debug_name by init_variable_debug_name(). Different names can be returned for each variable, more useful than a pointer value.
Definition at line 304 of file io.c.
References variable_debug_name, and vect_fprint().
Referenced by affine_to_transformer(), check_coefficient_reduction(), compute_x_and_y_bounds(), find_first_integer_point_in_between(), make_loop_indice_equation(), new_constraint_for_coefficient_reduction_with_bounding_box(), sc_bounded_normalization(), sc_consistent_p(), sc_projection_optim_along_vecteur_ofl(), simple_affine_to_transformer(), simplify_constraint_with_bounding_box(), and Tiling_buffer_allocation().
void vect_fdump | ( | FILE * | f, |
Pvecteur | v | ||
) |
void vect_fdump(FILE * f, Pvecteur v): impression d'un vecteur creux par vect_fprint() avec passage de la fonction variable_debug_name()
Definition at line 320 of file io.c.
References f(), variable_debug_name, and vect_fprint().
void vect_fprint | ( | FILE * | f, |
Pvecteur | v, | ||
get_variable_name_t | variable_name | ||
) |
void vect_fprint(FILE * f, Pvecteur v, char * (*variable_name)()): impression d'un vecteur creux v sur le fichier f; le nom de chaque coordonnee est donne par la fonction variable_name()
Par exemple, le vecteur v -> -> -> -> v == 2 i - 3 j + k est imprime sous la forme 2 * i - 3 * j + k LF ou les symboles i, j et k sont obtenus via la fonction pointee par variable_name()
Le vecteur nul est represente par vecteur nul LF
Note: attention au linefeed final il n'existe pas de fonction relisant des vecteurs sous cette forme (pour le moment...)
Modifications:
variable_name | ariable_name |
Definition at line 124 of file io.c.
References f(), fprint_Value(), fprintf(), Svecteur::succ, TCST, Svecteur::val, Svecteur::var, and variable_name().
Referenced by add_loop_skip_condition(), chose_variable_to_project_for_feasability(), compute_iteration_domain(), create_tile_basis(), dbg_ray_dte_rm(), dj_variable_substitution_with_eqs_ofl_ctrl(), eval_var(), find_iteration_domain(), fprint_message(), invariant_vector_p(), loop_iteration_domaine_to_sc(), loop_nest_to_wp65_code(), module_to_wp65_modules(), movement_computation(), new_system_with_only_live_variable(), pa_path_to_few_disjunct_ofl_ctrl(), parallel_tiling(), pvecteur_to_polynome(), ray_dte_fprint(), reduce_coefficients_with_bounding_box(), reg_v_debug(), sc_elim_redund_with_first_ofl_ctrl(), small_positive_slope_reduce_coefficients_with_bounding_box(), sommet_fprint(), tiling_transformation(), transformer_pattern_fix_point(), vect_debug(), vect_dump(), vect_fdump(), and vect_print().
void vect_fprint_as_dense(FILE * f, Pvecteur v, Pbase b):
Par exemple, le vecteur v -> -> -> -> v == 2 i - 3 j + k est imprime sous la forme ( 2 -3 1) dans la base (i j k)
No constant term TCST is expected.
I do not know what should be done for constant terms...
Definition at line 159 of file io.c.
References abort, f(), fprint_Value(), Svecteur::succ, VARIABLE_DEFINED_P, vect_coeff(), vect_in_basis_p(), VECTEUR_NUL_P, and vecteur_var.
Referenced by ray_dte_fprint_as_dense(), and sommet_fprint_as_dense().
void vect_fprint_as_monome | ( | FILE * | f, |
Pvecteur | v, | ||
Pbase | b, | ||
get_variable_name_t | variable_name, | ||
char * | mult_symbol | ||
) |
void vect_fprint_as_monome(FILE * f, Pvecteur v, Pbase b, char * (*variable_name)(), char *mult_symbol): impression d'un vecteur creux considere comme un monome sans coefficient.
Par ex.: le vecteur 2 * i - 3 * j + k est ecrit: "i^2 * j^(-3) * k". Le nom de chaque variable est donne par la fonction variable_name(). L'ordre dans lequel sont ecrites les inconnues du monome est fixe par la base b. Le symbole "multiplication" est passe dans (char *) mult_symbol: " * ", ".", "x", "", ... le vecteur de base special TCST n'est pas affiche: seulement son coefficient. Pas de
a la fin de l'affichage.
variable_name | ariable_name |
mult_symbol | ult_symbol |
Definition at line 201 of file io.c.
References f(), fprintf(), free(), variable_name(), and vect_sprint_as_monome().
Referenced by prv().
void vect_print | ( | Pvecteur | v, |
get_variable_name_t | variable_name | ||
) |
void vect_print(Pvecteur v, char * (*variable_name)()): impression d'un vecteur creux v sur stdout; le nom de chaque coordonnee est donne par la fonction variable_name(); voir vect_fprint()
variable_name | ariable_name |
Definition at line 312 of file io.c.
References variable_name(), and vect_fprint().
INTLIBRARY.
io.c
Pvecteur vect_read(Pbase * b): lecture interactive d'un vecteur sur stdin; la base b est modifiee de maniere a ce que chaque composante y figure bien;
La representation d'un vecteur dont la troisieme composante vaut 2, la dixieme 6 et les autres 0 peut etre: 3 2 1 10 6 0 ou x3 2 1 x10 6 0 Le 1 veut dire qu'il faut continuer les lectures, le zero, qu'il faut arreter
Ce format est malheureusement incompatible avec celui de vect_fprint()
Definition at line 65 of file io.c.
References assert, base_contains_variable_p(), base_find_variable(), buffer, printf(), scan_Value(), Svecteur::succ, variable_make(), vect_add_variable(), vect_new(), and VECTEUR_NUL.
char* vect_sprint_as_monome | ( | Pvecteur | v, |
Pbase | b, | ||
get_variable_name_t | variable_name, | ||
char * | mult_symbol | ||
) |
char *vect_sprint_as_monome(Pvecteur v, Pbase b, char * (*variable_name)(), char *mult_symbol): Retourne dans une chaine le Pvecteur considere comme un monome sans coefficient.
(voir ci-dessus)
si la base est vide: affiche comme ca vient
si la base n'est pas vide, affiche selon l'ordre qu'elle definit
exp < 0
inutile pour les polynomes
(un peu tard:-)
variable_name | ariable_name |
mult_symbol | ult_symbol |
Definition at line 217 of file io.c.
References assert, exp, sprint_Value(), strdup(), Svecteur::succ, Svecteur::val, value_one_p, value_pos_p, Svecteur::var, variable_name(), vect_coeff(), and VECTEUR_NUL_P.
Referenced by monome_sprint(), and vect_fprint_as_monome().