25 #include "pips_config.h"
50 #define FA(i,j) fa[(i)*n_controls + (j)]
83 int i, j, n_controls = 0;
92 hash_control_to_complexity,
128 float *fa = (
float *)
malloc(n_controls*n_controls*
sizeof(
float));
129 int *indx = (
int *)
malloc(
sizeof(
int) * n_controls);
132 for (i=1; i<=n_controls; i++) {
133 for (j=1; j<=n_controls; j++ ) {
143 fprintf(stderr,
"Before float matrice inversion\n\n");
147 fprintf(stderr,
"(I - P) =\n");
148 for (i=0;i<n_controls;i++) {
149 for (j=0;j<n_controls;j++)
158 fprintf(stderr,
"After float matrice inversion\n\n");
162 fprintf(stderr,
"(I - P)^(-1) =\n");
163 for (i=0;i<n_controls;i++) {
164 for (j=0;j<n_controls;j++)
170 for (i=1; i<=n_controls; i++) {
171 control conti = control_array[i];
173 hash_get(hash_control_to_complexity, (
char *) conti);
177 fprintf(stderr,
"control $%p:f=%f, compl.=", conti,
f);
189 fprintf(stderr,
"cumulated complexity=");
213 hash_control_to_complexity, precond, effects_list)
225 hash_put(hash_control_to_complexity, (
char *) cont, (
char *) comp);
226 control_array[++(*pn_controls)] = cont;
230 fprintf(stderr,
"this control($%p) has:", cont);
236 fprintf(stderr,
"NO successor at all!\n");
237 fprintf(stderr,
". . . . . . . . . . . . . . . . . . . . . .\n");
242 if (
hash_get(hash_control_to_complexity, (
char *) c)
245 hash_control_to_complexity, precond,
260 for (i=1; i<=n_controls; i++)
261 if (cont == control_array[i])
277 int i, j , n_succs, max_n_succs = 0;
288 for (i=1; i<=n_controls; i++)
289 already_examined[i] =
false;
293 control_array, already_examined);
296 for (i=1; i<=n_controls; i++) {
298 for (j=1; j<=n_controls; j++)
303 if (n_succs > max_n_succs)
304 max_n_succs = n_succs;
308 fprintf(stderr,
"n_controls=%d, and max_n_succs=%d\n",
309 n_controls,max_n_succs);
317 for (i=1; i<=n_controls; i++) {
319 for (j=1; j<=n_controls; j++) {
324 for (j=1; j<=n_controls; j++)
334 fprintf(stderr,
"n_controls is %d\n", n_controls);
335 fprintf(stderr,
"average_probability_matrix: P =\n");
352 control_array, already_examined)
357 bool already_examined[];
361 already_examined[i] =
true;
364 fprintf(stderr,
"CONTROL ($%p) CONTROL_NUMBER %d\n", cont, i);
373 fprintf(stderr,
"Control ($%p) %d --> Control ($%p) %d\n",
379 if (!already_examined[j])
381 control_array, already_examined);
384 fprintf(stderr,
"Control Number %d already examined!\n",j);
#define int_to_value(i)
end LINEAR_VALUE_IS_INT
#define VALUE_TO_INT(val)
#define VALUE_TO_FLOAT(val)
#define value_product(v, w)
#define value_div(v1, v2)
void complexity_add(complexity *pcomp1, complexity comp2)
void complexity_add(complexity *pcomp1, comp2) performs *pcomp1 = *pcomp1 + comp2; !...
void complexity_scalar_mult(complexity *pcomp, float f)
multiply a complexity by a floating-point number.
complexity make_zero_complexity()
make a zero complexity "0.0000 * TCST" with null statistics
#define A(i, j)
comp_matrice.c
void float_matrice_inversion(float *a, int n, int *indx, int *pd)
complexity statement_to_complexity(statement stat, transformer precon __attribute__((__unused__)), list eff_list __attribute__((__unused__)))
starting point of Abstract Syntax Tree
hash_table hash_complexity_parameters
hash_table hash_callee_to_complexity
comp_expr_to_pnome.c
complexity unstructured_to_complexity(unstructured unstr, transformer precond, list effects_list)
6th element of instruction
void node_successors_to_matrix(control cont, matrice P, int n_controls, control_array, already_examined)
On return, Pij = 1 <=> there's an edge from control #i to #j It means that every succeccor has the sa...
#define FA(i, j)
comp_unstr.c
void controls_to_hash_table(control cont, int *pn_controls, control_array, hash_table hash_control_to_complexity, transformer precond, list effects_list)
Returns the hash table hash_control_to_complexity filled in with the complexities of the successors o...
matrice average_probability_matrix(unstructured unstr, int n_controls, control_array)
int control_element_position_in_control_array(control cont, control_array, int n_controls)
return the number i, that is i'th element of the control array Note that i begins from 1 instead of 0
void trace_on(char *fmt,...)
void complexity_fprint(FILE *fd, complexity comp, bool print_stats_p, bool print_local_names_p)
void complexity_check_and_warn(char *s, complexity comp) const
void trace_off()
"trace off"
#define MAX_CONTROLS_IN_UNSTRUCTURED
struct _newgen_struct_complexity_ * complexity
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
#define NIL
The empty list (nil in Lisp)
#define CAR(pcons)
Get the value of the first element of a list.
#define MAPL(_map_list_cp, _code, _l)
Apply some code on the addresses of all the elements of a list.
hash_table hash_table_make(hash_key_type key_type, size_t size)
void * hash_get(const hash_table htp, const void *key)
this function retrieves in the hash table pointed to by htp the couple whose key is equal to key.
void hash_put(hash_table htp, const void *key, const void *val)
This functions stores a couple (key,val) in the hash table pointed to by htp.
void hash_table_free(hash_table htp)
this function deletes a hash table that is no longer useful.
#define DENOMINATOR(matrix)
int DENOMINATEUR(matrix): acces au denominateur global d'une matrice matrix La combinaison *(&()) est...
#define ACCESS(matrix, column, i, j)
Macros d'acces aux elements d'une matrice.
#define matrice_new(n, m)
Allocation et desallocation d'une matrice.
Value * matrice
package matrice
void matrice_substract(matrice a, matrice b, matrice c, int n, int m)
void matrice_substract(matrice a, matrice b, matrice c, int n, int m): substract rational matrix c fr...
void matrice_normalize(matrice a, int n, int m)
void matrice_normalize(matrice a, int n, int m)
void matrice_nulle(matrice Z, int n, int m)
void matrice_nulle(matrice Z, int n, int m): Initialisation de la matrice Z a la valeur matrice nulle
void matrice_identite(matrice, int, int)
void matrice_identite(matrice ID, int n, int level) Construction d'une sous-matrice identite dans ID(...
void matrice_fprint(FILE *, matrice, int, int)
matrice_io.c
#define pips_internal_error
int get_debug_level(void)
GET_DEBUG_LEVEL returns the current debugging level.
#define HASH_UNDEFINED_VALUE
value returned by hash_get() when the key is not found; could also be called HASH_KEY_NOT_FOUND,...
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
int f2(int off1, int off2, int w, int n, float r[n], float a[n], float b[n])
int factorielle(int n)
int factorielle (int n) PRIVATE returns n!
#define unstructured_control
After the modification in Newgen: unstructured = entry:control x exit:control we have create a macro ...
#define CONTROL(x)
CONTROL.
#define control_successors(x)
#define control_statement(x)
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
The structure used to build lists in NewGen.