OpenScop  0.9.0
Data Structures | Defines | Typedefs | Functions
relation.h File Reference
#include <stdio.h>
#include <osl/int.h>
#include <osl/names.h>
#include <osl/vector.h>
Include dependency graph for relation.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  osl_relation

Defines

#define OSL_URI_RELATION   "relation"

Typedefs

typedef struct osl_relation osl_relation_t
typedef struct osl_relationosl_relation_p

Functions

void osl_relation_idump (FILE *, osl_relation_p, int)
void osl_relation_dump (FILE *, osl_relation_p)
char * osl_relation_expression (osl_relation_p relation, int row, char **names)
char * osl_relation_spprint_polylib (osl_relation_p, osl_names_p)
char * osl_relation_spprint (osl_relation_p, osl_names_p)
void osl_relation_pprint (FILE *, osl_relation_p, osl_names_p)
char * osl_relation_sprint (osl_relation_p)
void osl_relation_print (FILE *, osl_relation_p)
char * osl_relation_spprint_polylib_scoplib (osl_relation_p, osl_names_p, int, int)
char * osl_relation_spprint_scoplib (osl_relation_p, osl_names_p, int, int)
void osl_relation_pprint_scoplib (FILE *, osl_relation_p, osl_names_p, int, int)
osl_relation_p osl_relation_pread (FILE *, int)
osl_relation_p osl_relation_read (FILE *)
osl_relation_p osl_relation_psread (char **, int)
osl_relation_p osl_relation_sread (char **)
osl_relation_p osl_relation_pmalloc (int, int, int)
osl_relation_p osl_relation_malloc (int, int)
void osl_relation_free_inside (osl_relation_p)
void osl_relation_free (osl_relation_p)
int osl_relation_nb_components (osl_relation_p relation)
osl_relation_p osl_relation_nclone (osl_relation_p, int)
osl_relation_p osl_relation_clone_nconstraints (osl_relation_p, int)
osl_relation_p osl_relation_clone (osl_relation_p)
void osl_relation_add (osl_relation_p *, osl_relation_p)
osl_relation_p osl_relation_union (osl_relation_p, osl_relation_p)
void osl_relation_replace_vector (osl_relation_p, osl_vector_p, int)
void osl_relation_insert_vector (osl_relation_p, osl_vector_p, int)
osl_relation_p osl_relation_concat_vector (osl_relation_p, osl_vector_p)
void osl_relation_insert_blank_row (osl_relation_p, int)
void osl_relation_insert_blank_column (osl_relation_p, int)
void osl_relation_add_vector (osl_relation_p, osl_vector_p, int)
void osl_relation_sub_vector (osl_relation_p, osl_vector_p, int)
osl_relation_p osl_relation_from_vector (osl_vector_p)
void osl_relation_replace_constraints (osl_relation_p, osl_relation_p, int)
void osl_relation_insert_constraints (osl_relation_p, osl_relation_p, int)
void osl_relation_swap_constraints (osl_relation_p, int, int)
void osl_relation_remove_row (osl_relation_p, int)
void osl_relation_remove_column (osl_relation_p, int)
void osl_relation_insert_columns (osl_relation_p, osl_relation_p, int)
osl_relation_p osl_relation_concat_constraints (osl_relation_p, osl_relation_p)
int osl_relation_part_equal (osl_relation_p, osl_relation_p)
int osl_relation_equal (osl_relation_p, osl_relation_p)
int osl_relation_integrity_check (osl_relation_p, int, int, int, int)
void osl_relation_set_attributes_one (osl_relation_p, int, int, int, int)
void osl_relation_set_attributes (osl_relation_p, int, int, int, int)
void osl_relation_set_type (osl_relation_p, int)
int osl_relation_get_array_id (osl_relation_p)
int osl_relation_is_access (osl_relation_p)
void osl_relation_get_attributes (osl_relation_p, int *, int *, int *, int *, int *)
osl_relation_p osl_relation_extend_output (osl_relation_p, int)
osl_interface_p osl_relation_interface ()

Define Documentation

#define OSL_URI_RELATION   "relation"

Definition at line 77 of file relation.h.

Referenced by osl_relation_interface().


Typedef Documentation

typedef struct osl_relation* osl_relation_p

Definition at line 121 of file relation.h.

typedef struct osl_relation osl_relation_t

Definition at line 120 of file relation.h.


Function Documentation

osl_relation_add function: this function adds a relation (union) at the end of the relation (union) pointed by r1. No new relation is created: this functions links the two input unions. If the first relation is NULL, it is set to the second relation.

Parameters:
[in,out]r1Pointer to the first relation (union).
[in]r2The second relation (union).

Definition at line 1850 of file relation.c.

Referenced by osl_relation_union().

void osl_relation_add_vector ( osl_relation_p  relation,
osl_vector_p  vector,
int  row 
)

osl_relation_add_vector function: this function adds (meaning, +) a vector to the "row"^th row of a relation "relation". It directly updates the relation union part pointed by "relation" and this part only.

Parameters:
[in,out]relationThe relation we want to add a vector to a row.
[in]vectorThe vector that will replace a row of the relation.
[in]rowThe row of the relation to add the vector.

Definition at line 1915 of file relation.c.

References osl_relation::m, osl_relation::nb_columns, osl_relation::nb_rows, OSL_error, osl_int_add(), osl_int_assign(), osl_int_get_si(), osl_vector::precision, osl_relation::precision, osl_vector::size, and osl_vector::v.

osl_relation_clone function: this function builds and returns a "hard copy" (not a pointer copy) of an osl_relation_t data structure (the full union of relation).

Parameters:
[in]relationThe pointer to the relation we want to clone.
Returns:
A pointer to the clone of the union of relations.

Definition at line 1833 of file relation.c.

References osl_relation_nclone().

Referenced by osl_dependence_nclone(), osl_relation_concat_constraints(), osl_relation_interface(), osl_relation_list_clone(), osl_relation_list_node(), osl_relation_union(), osl_scop_clone(), and osl_statement_nclone().

osl_relation_clone_nconstraints function: this functions builds and returns a "hard copy" (not a pointer copy) of a osl_relation_t data structure such that the clone is restricted to the "n" first rows of the relation. This applies to all the parts in the case of a relation union.

Parameters:
[in]relationThe pointer to the relation we want to clone.
[in]nThe number of row of the relation we want to clone (the special value -1 means "all the rows").
Returns:
A pointer to the clone of the relation union restricted to the first n rows of constraint matrix for each part of the union.

Definition at line 1781 of file relation.c.

References osl_relation::m, osl_relation::nb_columns, osl_relation::nb_input_dims, osl_relation::nb_local_dims, osl_relation::nb_output_dims, osl_relation::nb_parameters, osl_relation::nb_rows, osl_relation::next, OSL_error, osl_int_assign(), osl_relation_pmalloc(), osl_relation::precision, and osl_relation::type.

osl_relation_concat_constraints function: this function builds a new relation from two relations sent as parameters. The new set of constraints is built as the concatenation of the rows of the first elements of the two relation unions r1 and r2. This means, there is no next field in the result.

Parameters:
[in]r1The first relation.
[in]r2The second relation.
Returns:
A pointer to the relation resulting from the concatenation of the first elements of r1 and r2.

Definition at line 2332 of file relation.c.

References osl_relation::nb_columns, osl_relation::nb_rows, osl_relation::next, OSL_error, osl_relation_clone(), osl_relation_pmalloc(), osl_relation_replace_constraints(), OSL_warning, and osl_relation::precision.

Referenced by osl_relation_concat_vector().

osl_relation_concat_vector function: this function builds a new relation from one relation and a vector sent as parameters. The new set of constraints is built as the concatenation of the rows of the first part of the relation and of the vector constraint. This means, there is no next field in the result.

Parameters:
[in]rThe input relation.
[in]vThe input vector.
Returns:
A pointer to the relation resulting from the concatenation of the constraints of the relation and of the vector.

Definition at line 1996 of file relation.c.

References osl_relation_concat_constraints(), osl_relation_free(), and osl_relation_from_vector().

void osl_relation_dump ( FILE *  file,
osl_relation_p  relation 
)

osl_relation_dump function: this function prints the content of a osl_relation_t structure (*relation) into a file (file, possibly stdout).

Parameters:
[in]fileFile where informations are printed.
[in]relationThe relation whose information have to be printed.

Definition at line 246 of file relation.c.

References osl_relation_idump().

Referenced by osl_relation_integrity_check().

osl_relation_equal function: this function returns true if the two relations provided as parameters are the same, false otherwise.

Parameters:
[in]r1The first relation.
[in]r2The second relation.
Returns:
1 if r1 and r2 are the same (content-wise), 0 otherwise.

Definition at line 2405 of file relation.c.

References osl_relation::next, and osl_relation_part_equal().

Referenced by osl_dependence_equal(), osl_relation_interface(), osl_relation_list_equal(), osl_scop_equal(), and osl_statement_equal().

char* osl_relation_expression ( osl_relation_p  relation,
int  row,
char **  strings 
)

osl_relation_expression function: this function returns a string corresponding to an affine expression stored at the "row"^th row of the relation pointed by "relation".

Parameters:
[in]relationA set of linear expressions.
[in]rowThe row corresponding to the expression.
[in]stringsArray of textual names of the various elements.
Returns:
A string that contains the printing of an affine expression.

Definition at line 466 of file relation.c.

References osl_relation::nb_columns, and osl_relation_subexpression().

Referenced by osl_relation_sprint_comment().

osl_relation_extend_output function: this function extends the number of output dimensions of a given relation. It returns a copy of the input relation with a number of output dimensions extended to "dim" for all its union components. The new output dimensions are simply set equal to 0. The extended number of dimensions must be higher than or equal to the original one (an error will be raised otherwise).

Parameters:
[in]relationThe input relation to extend.
[in]dimThe number of output dimension to reach.
Returns:
A new relation: "relation" extended to "dim" output dims.

Definition at line 2906 of file relation.c.

References osl_relation::m, osl_relation::nb_columns, osl_relation::nb_input_dims, osl_relation::nb_local_dims, osl_relation::nb_output_dims, osl_relation::nb_parameters, osl_relation::nb_rows, osl_relation::next, OSL_error, osl_int_assign(), osl_int_set_si(), OSL_max, osl_relation_pmalloc(), osl_relation::precision, and osl_relation::type.

Referenced by osl_scop_normalize_scattering().

void osl_relation_free ( osl_relation_p  relation)

osl_relation_free function: this function frees the allocated memory for an osl_relation_t structure.

Parameters:
[in]relationThe pointer to the relation we want to free.

Definition at line 1701 of file relation.c.

References osl_relation::next, and osl_relation_free_inside().

Referenced by osl_dependence_free(), osl_relation_concat_vector(), osl_relation_insert_vector(), osl_relation_interface(), osl_relation_list_free(), osl_scop_free(), osl_scop_normalize_scattering(), and osl_statement_free().

osl_relation_free_inside function: this function frees the allocated memory for the inside of a osl_relation_t structure, i.e. only m.

Parameters:
[in]relationThe pointer to the relation we want to free internals.

Definition at line 1676 of file relation.c.

References osl_relation::m, osl_relation::nb_columns, osl_relation::nb_rows, osl_int_clear(), and osl_relation::precision.

Referenced by osl_relation_free(), osl_relation_insert_blank_column(), osl_relation_insert_columns(), osl_relation_insert_constraints(), osl_relation_remove_column(), and osl_relation_remove_row().

osl_relation_from_vector function: this function converts a vector "vector" to a relation with a single row and returns a pointer to that relation.

Parameters:
[in]vectorThe vector to convert to a relation.
Returns:
A pointer to a relation resulting from the vector conversion.

Definition at line 2074 of file relation.c.

References osl_relation_pmalloc(), osl_relation_replace_vector(), osl_vector::precision, and osl_vector::size.

Referenced by osl_relation_concat_vector(), and osl_relation_insert_vector().

osl_relation_get_array_id function: this function returns the array identifier in a relation with access type It returns OSL_UNDEFINED if it is not able to find it (in particular if there are irregularities in the relation).

Parameters:
[in]relationThe relation where to find an array identifier.
Returns:
The array identifier in the relation or OSL_UNDEFINED.

Definition at line 2695 of file relation.c.

References osl_relation::m, osl_relation::nb_columns, osl_relation::nb_rows, osl_relation::next, osl_int_divisible(), osl_int_get_si(), osl_int_zero(), osl_relation_is_access(), OSL_UNDEFINED, OSL_warning, and osl_relation::precision.

Referenced by osl_relation_get_attributes(), osl_relation_integrity_check(), and osl_relation_sprint_comment().

void osl_relation_get_attributes ( osl_relation_p  relation,
int *  nb_parameters,
int *  nb_iterators,
int *  nb_scattdims,
int *  nb_localdims,
int *  array_id 
)

osl_relation_get_attributes function: this function returns, through its parameters, the maximum values of the relation attributes (nb_iterators, nb_parameters etc), depending on its type. HOWEVER, it updates the parameter value iff the attribute is greater than the input parameter value. Hence it may be used to get the attributes as well as to find the maximum attributes for several relations. The array identifier 0 is used when there is no array identifier (AND this is OK), OSL_UNDEFINED is used to report it is impossible to provide the property while it should. This function is not intended for checking, the input relation should be correct.

Parameters:
[in]relationThe relation to extract attribute values.
[in,out]nb_parametersNumber of parameter attribute.
[in,out]nb_iteratorsNumber of iterators attribute.
[in,out]nb_scattdimsNumber of scattering dimensions attribute.
[in,out]nb_localdimsNumber of local dimensions attribute.
[in,out]array_idMaximum array identifier attribute.

Definition at line 2823 of file relation.c.

References osl_relation::nb_input_dims, osl_relation::nb_local_dims, osl_relation::nb_output_dims, osl_relation::nb_parameters, osl_relation::next, OSL_max, osl_relation_get_array_id(), osl_relation_is_access(), OSL_TYPE_ACCESS, OSL_TYPE_CONTEXT, OSL_TYPE_DOMAIN, OSL_TYPE_SCATTERING, OSL_UNDEFINED, and osl_relation::type.

Referenced by osl_relation_list_get_attributes(), osl_relation_names(), osl_scop_get_attributes(), and osl_statement_get_attributes().

void osl_relation_idump ( FILE *  file,
osl_relation_p  relation,
int  level 
)

osl_relation_idump function: this function displays a osl_relation_t structure (*relation) into a file (file, possibly stdout) in a way that trends to be understandable. It includes an indentation level (level) in order to work with others idump functions.

Parameters:
[in]fileFile where informations are printed.
[in]relationThe relation whose information has to be printed.
[in]levelNumber of spaces before printing, for each line.

Definition at line 164 of file relation.c.

References osl_relation::m, osl_relation::nb_columns, osl_relation::nb_input_dims, osl_relation::nb_local_dims, osl_relation::nb_output_dims, osl_relation::nb_parameters, osl_relation::nb_rows, osl_relation::next, osl_int_dump_precision(), osl_int_print(), osl_relation_print_type(), and osl_relation::precision.

Referenced by osl_dependence_idump(), osl_relation_dump(), osl_relation_interface(), osl_relation_list_idump(), osl_scop_idump(), and osl_statement_idump().

void osl_relation_insert_blank_column ( osl_relation_p  relation,
int  column 
)

osl_relation_insert_blank_column function: this function inserts a new column filled with zeros to an existing relation union part (it only affects the first union part). WARNING: this function does not update the relation attributes.

Parameters:
[in,out]relationThe relation to add a column in.
[in]columnThe column where to insert the blank column.

Definition at line 2033 of file relation.c.

References osl_relation::m, osl_relation::nb_columns, osl_relation::nb_rows, OSL_error, osl_int_assign(), osl_relation_free_inside(), osl_relation_pmalloc(), and osl_relation::precision.

void osl_relation_insert_blank_row ( osl_relation_p  relation,
int  row 
)

osl_relation_insert_blank_row function: this function inserts a new row filled with zeros o an existing relation union part (it only affects the first union part).

Parameters:
[in,out]relationThe relation to add a row in.
[in]rowThe row where to insert the blank row.

Definition at line 2014 of file relation.c.

References osl_relation::nb_columns, osl_relation_insert_vector(), osl_vector_free(), osl_vector_pmalloc(), and osl_relation::precision.

void osl_relation_insert_columns ( osl_relation_p  relation,
osl_relation_p  insert,
int  column 
)

osl_relation_insert_columns function: this function inserts new columns to an existing relation union part (it only affects the first union part). The columns are copied out from the matrix of an input relation which must have the convenient number of rows. All columns of the input matrix are copied. WARNING: this function does not update the relation attributes of the modified matrix.

Parameters:
[in,out]relationThe relation to add columns in.
[in]insertThe relation containing the columns to add.
[in]columnThe column where to insert the new columns.

Definition at line 2279 of file relation.c.

References osl_relation::m, osl_relation::nb_columns, osl_relation::nb_rows, OSL_error, osl_int_assign(), osl_relation_free_inside(), osl_relation_pmalloc(), and osl_relation::precision.

osl_relation_insert_constraints function: this function inserts the rows of the relation "r2" to the relation "r1", starting from the "row"^th row of "r1" (-1 is a shortcut to insert the "r2" constraints after the constraints of r1). It directly updates the relation union part pointed by "r1" and this part only. If "r2" (or "r1") is NULL, the relation is left unmodified.

Parameters:
[in,out]r1The relation we want to extend.
[in]r2The relation to be inserted.
[in]rowThe row where to insert the constraints (-1 to insert them after those of "r1").

Definition at line 2123 of file relation.c.

References osl_relation::m, osl_relation::nb_columns, osl_relation::nb_rows, OSL_error, osl_int_assign(), osl_relation_free_inside(), osl_relation_pmalloc(), osl_relation_replace_constraints(), and osl_relation::precision.

Referenced by osl_relation_insert_vector().

void osl_relation_insert_vector ( osl_relation_p  relation,
osl_vector_p  vector,
int  row 
)

osl_relation_insert_vector function: this function inserts a new row corresponding to the vector "vector" to the relation "relation" by inserting it at the "row"^th row of "relation" (-1 is a shortcut to insert the vector after the constraints of the relation). It directly updates the relation union part pointed by "relation" and this part only. If "vector" (or "relation") is NULL, the relation is left unmodified.

Parameters:
[in,out]relationThe relation we want to extend.
[in]vectorThe vector that will be added relation.
[in]rowThe row where to insert the vector (-1 to insert it after the relation constraints).

Definition at line 1975 of file relation.c.

References osl_relation_free(), osl_relation_from_vector(), and osl_relation_insert_constraints().

Referenced by osl_relation_insert_blank_row().

int osl_relation_integrity_check ( osl_relation_p  relation,
int  expected_type,
int  expected_nb_output_dims,
int  expected_nb_input_dims,
int  expected_nb_parameters 
)

osl_relation_integrity_check function: this function checks that a relation is "well formed" according to some expected properties (setting an expected value to OSL_UNDEFINED means that we do not expect a specific value) and what the relation is supposed to represent. It returns 0 if the check failed or 1 if no problem has been detected.

Parameters:
[in]relationThe relation we want to check.
[in]expected_typeSemantics about this relation (domain, access...).
[in]expected_nb_output_dimsExpected number of output dimensions.
[in]expected_nb_input_dimsExpected number of input dimensions.
[in]expected_nb_parametersExpected number of parameters.
Returns:
0 if the integrity check fails, 1 otherwise.

Definition at line 2510 of file relation.c.

References osl_relation::m, osl_relation::nb_columns, osl_relation::nb_input_dims, osl_relation::nb_local_dims, osl_relation::nb_output_dims, osl_relation::nb_parameters, osl_relation::nb_rows, osl_relation::next, OSL_debug, osl_int_one(), osl_int_zero(), osl_relation_check_attribute(), osl_relation_check_nb_columns(), osl_relation_dump(), osl_relation_get_array_id(), osl_relation_is_access(), OSL_TYPE_ACCESS, OSL_TYPE_CONTEXT, OSL_TYPE_DOMAIN, OSL_UNDEFINED, OSL_warning, osl_relation::precision, and osl_relation::type.

Referenced by osl_relation_list_integrity_check(), osl_scop_integrity_check(), and osl_statement_integrity_check().

osl_relation_interface function: this function creates an interface structure corresponding to the relation and returns it.

Returns:
An interface structure for the relation structure.

Definition at line 2970 of file relation.c.

References osl_interface_malloc(), osl_relation_clone(), osl_relation_equal(), osl_relation_free(), osl_relation_idump(), osl_relation_malloc(), osl_relation_sprint(), osl_relation_sread(), OSL_strdup, and OSL_URI_RELATION.

Referenced by osl_interface_get_default_registry().

osl_relation_is_access function: this function returns 1 if the relation corresponds to an access relation, whatever its precise type (read, write etc.), 0 otherwise.

Parameters:
relationThe relation to check wheter it is an access relation or not.
Returns:
1 if the relation is an access relation, 0 otherwise.

Definition at line 2790 of file relation.c.

References OSL_TYPE_ACCESS, OSL_TYPE_MAY_WRITE, OSL_TYPE_READ, OSL_TYPE_WRITE, and osl_relation::type.

Referenced by osl_relation_get_array_id(), osl_relation_get_attributes(), osl_relation_integrity_check(), osl_relation_list_filter(), osl_relation_sprint_comment(), and osl_relation_strings().

osl_relation_p osl_relation_malloc ( int  nb_rows,
int  nb_columns 
)

osl_relation_malloc function: this function is equivalent to osl_relation_pmalloc() except that the precision corresponds to the precision environment variable or to the highest available precision if it is not defined.

See also:
{osl_relation_pmalloc}

Definition at line 1664 of file relation.c.

References osl_relation_pmalloc(), and osl_util_get_precision().

Referenced by osl_relation_interface().

osl_relation_nb_components function: this function returns the number of component in the union of relations provided as parameter.

Parameters:
[in]relationThe input union of relations.
Returns:
The number of components in the input union of relations.

Definition at line 797 of file relation.c.

References osl_relation::next.

Referenced by osl_relation_nclone(), osl_relation_spprint(), osl_relation_spprint_polylib(), and osl_relation_spprint_polylib_scoplib().

osl_relation_nclone function: this functions builds and returns a "hard copy" (not a pointer copy) of the first n parts of a relation union.

Parameters:
[in]relationThe pointer to the relation we want to clone.
[in]nThe number of union parts of the relation we want to clone (the special value -1 means "all the parts").
Returns:
A pointer to the clone of the relation union restricted to the first n parts of the relation union.

Definition at line 1728 of file relation.c.

References osl_relation::m, osl_relation::nb_columns, osl_relation::nb_input_dims, osl_relation::nb_local_dims, osl_relation::nb_output_dims, osl_relation::nb_parameters, osl_relation::nb_rows, osl_relation::next, OSL_error, osl_int_assign(), osl_relation_nb_components(), osl_relation_pmalloc(), osl_relation::precision, and osl_relation::type.

Referenced by osl_relation_clone().

osl_relation_part_equal function: this function returns true if the two relations parts provided as parameters are the same, false otherwise. In the case of relation unions, only the first part of the two relations are tested.

Parameters:
[in]r1The first relation.
[in]r2The second relation.
Returns:
1 if r1 and r2 are the same (content-wise), 0 otherwise.

Definition at line 2368 of file relation.c.

References osl_relation::m, osl_relation::nb_columns, osl_relation::nb_input_dims, osl_relation::nb_local_dims, osl_relation::nb_output_dims, osl_relation::nb_parameters, osl_relation::nb_rows, osl_int_ne(), osl_relation::precision, and osl_relation::type.

Referenced by osl_relation_equal().

osl_relation_p osl_relation_pmalloc ( int  precision,
int  nb_rows,
int  nb_columns 
)

osl_relation_pmalloc function: (precision malloc) this function allocates the memory space for an osl_relation_t structure and sets its fields with default values. Then it returns a pointer to the allocated space.

Parameters:
[in]precisionThe precision of the constraint matrix.
[in]nb_rowsThe number of row of the relation to allocate.
[in]nb_columnsThe number of columns of the relation to allocate.
Returns:
A pointer to an empty relation with fields set to default values and a ready-to-use constraint matrix.

Definition at line 1612 of file relation.c.

References osl_relation::m, osl_relation::nb_columns, osl_relation::nb_input_dims, osl_relation::nb_local_dims, osl_relation::nb_output_dims, osl_relation::nb_parameters, osl_relation::nb_rows, osl_relation::next, OSL_error, osl_int_init_set_si(), OSL_malloc, OSL_PRECISION_DP, OSL_PRECISION_MP, OSL_PRECISION_SP, OSL_UNDEFINED, osl_relation::precision, and osl_relation::type.

Referenced by osl_relation_clone_nconstraints(), osl_relation_concat_constraints(), osl_relation_extend_output(), osl_relation_from_vector(), osl_relation_insert_blank_column(), osl_relation_insert_columns(), osl_relation_insert_constraints(), osl_relation_malloc(), osl_relation_nclone(), osl_relation_pread(), osl_relation_psread(), osl_relation_remove_column(), and osl_relation_remove_row().

void osl_relation_pprint ( FILE *  file,
osl_relation_p  relation,
osl_names_p  names 
)

osl_relation_pprint function: this function pretty-prints the content of an osl_relation_t structure (*relation) into a file (file, possibly stdout) in the OpenScop format.

Parameters:
[in]fileFile where informations are printed.
[in]relationThe relation whose information has to be printed.
[in]namesThe names of the constraint columns for comments.

Definition at line 1242 of file relation.c.

References osl_relation_spprint().

Referenced by osl_relation_list_pprint_elts(), osl_relation_print(), osl_scop_print(), and osl_statement_pprint().

void osl_relation_pprint_scoplib ( FILE *  file,
osl_relation_p  relation,
osl_names_p  names,
int  print_nth_part,
int  add_fakeiter 
)

osl_relation_pprint_scoplib function: this function pretty-prints the content of an osl_relation_t structure (*relation) into a file (file, possibly stdout) in the SCoPLibformat.

Parameters:
[in]fileFile where informations are printed.
[in]relationThe relation whose information has to be printed.
[in]namesThe names of the constraint columns for comments.
[in]print_nth_part
[in]add_fakeiter

Definition at line 1260 of file relation.c.

References osl_relation_spprint_scoplib().

Referenced by osl_relation_list_pprint_access_array_scoplib(), osl_scop_print_scoplib(), and osl_statement_pprint_scoplib().

osl_relation_p osl_relation_pread ( FILE *  foo,
int  precision 
)

osl_relation_pread function ("precision read"): this function reads a relation into a file (foo, posibly stdin) and returns a pointer this relation.

Parameters:
[in]fooThe input stream.
[in]precisionThe precision of the relation elements.
Returns:
A pointer to the relation structure that has been read.

Definition at line 1382 of file relation.c.

References osl_relation::m, osl_relation::nb_columns, osl_relation::nb_input_dims, osl_relation::nb_local_dims, osl_relation::nb_output_dims, osl_relation::nb_parameters, osl_relation::nb_rows, osl_relation::next, OSL_error, osl_int_sread(), OSL_MAX_STRING, osl_relation_pmalloc(), osl_relation_read_type(), osl_util_skip_blank_and_comments(), and osl_relation::type.

Referenced by osl_relation_list_pread(), osl_relation_read(), and osl_scop_pread().

void osl_relation_print ( FILE *  file,
osl_relation_p  relation 
)

osl_relation_print function: this function prints the content of an osl_relation_t structure (*relation) into a file (file, possibly stdout) in the OpenScop format.

Parameters:
[in]fileFile where informations are printed.
[in]relationThe relation whose information has to be printed.

Definition at line 1290 of file relation.c.

References osl_relation_pprint().

osl_relation_p osl_relation_psread ( char **  input,
int  precision 
)

osl_relation_psread function ("precision read"): this function reads a relation from a string complying to the OpenScop textual format and returns a pointer this relation. The input parameter is updated to the position in the input string this function reach right after reading the generic structure.

Parameters:
[in,out]inputThe input string where to find a relation. Updated to the position after what has been read.
[in]precisionThe precision of the relation elements.
Returns:
A pointer to the relation structure that has been read.

Definition at line 1480 of file relation.c.

References osl_relation::m, osl_relation::nb_columns, osl_relation::nb_input_dims, osl_relation::nb_local_dims, osl_relation::nb_output_dims, osl_relation::nb_parameters, osl_relation::nb_rows, osl_relation::next, OSL_error, osl_int_sread(), OSL_MAX_STRING, osl_relation_pmalloc(), osl_relation_read_type(), osl_util_sskip_blank_and_comments(), and osl_relation::type.

Referenced by osl_dependence_read_one_dep(), and osl_relation_sread().

osl_relation_read function: this function is equivalent to osl_relation_pread() except that the precision corresponds to the precision environment variable or to the highest available precision if it is not defined.

See also:
{osl_relation_pread}

Definition at line 1590 of file relation.c.

References osl_relation_pread(), and osl_util_get_precision().

void osl_relation_remove_column ( osl_relation_p  r,
int  column 
)

osl_relation_remove_column function: this function removes a given column to the relation "r". It directly updates the relation union part pointed by "r" and this part only.

Parameters:
[in,out]rThe relation to remove a column.
[in]columnThe column number to remove.

Definition at line 2235 of file relation.c.

References osl_relation::m, osl_relation::nb_columns, osl_relation::nb_rows, OSL_error, osl_int_assign(), osl_relation_free_inside(), osl_relation_pmalloc(), and osl_relation::precision.

void osl_relation_remove_row ( osl_relation_p  r,
int  row 
)

osl_relation_remove_row function: this function removes a given row to the relation "r". It directly updates the relation union part pointed by "r" and this part only.

Parameters:
[in,out]rThe relation to remove a row.
[in]rowThe row number to remove.

Definition at line 2195 of file relation.c.

References osl_relation::m, osl_relation::nb_columns, osl_relation::nb_rows, OSL_error, osl_int_assign(), osl_relation_free_inside(), osl_relation_pmalloc(), and osl_relation::precision.

osl_relation_replace_constraints function: this function replaces some rows of a relation "r1" with the rows of the relation "r2". It begins at the "row"^th row of "r1". It directly updates the relation union part pointed by "r1" and this part only.

Parameters:
[in,out]r1The relation we want to change some rows.
[in]r2The relation containing the new rows.
[in]rowThe first row of the relation r1 to be replaced.

Definition at line 2095 of file relation.c.

References osl_relation::m, osl_relation::nb_columns, osl_relation::nb_rows, OSL_error, osl_int_assign(), and osl_relation::precision.

Referenced by osl_relation_concat_constraints(), and osl_relation_insert_constraints().

void osl_relation_replace_vector ( osl_relation_p  relation,
osl_vector_p  vector,
int  row 
)

osl_relation_replace_vector function: this function replaces the "row"^th row of a relation "relation" with the vector "vector". It directly updates the relation union part pointed by "relation" and this part only.

Parameters:
[in,out]relationThe relation we want to replace a row.
[in]vectorThe vector that will replace a row of the relation.
[in]rowThe row of the relation to be replaced.

Definition at line 1891 of file relation.c.

References osl_relation::m, osl_relation::nb_columns, osl_relation::nb_rows, OSL_error, osl_int_assign(), osl_vector::precision, osl_relation::precision, osl_vector::size, and osl_vector::v.

Referenced by osl_relation_from_vector().

void osl_relation_set_attributes ( osl_relation_p  relation,
int  nb_output_dims,
int  nb_input_dims,
int  nb_local_dims,
int  nb_parameters 
)

osl_relation_set_attributes function: this functions sets the attributes of a relation (union) provided as a parameter. It updates the relation directly.

Parameters:
[in,out]relationThe relation (union) to set the attributes.
[in]nb_output_dimsNumber of output dimensions.
[in]nb_input_dimsNumber of input dimensions.
[in]nb_local_dimsNumber of local dimensions.
[in]nb_parametersNumber of parameters.

Definition at line 2659 of file relation.c.

References osl_relation::next, and osl_relation_set_attributes_one().

void osl_relation_set_attributes_one ( osl_relation_p  relation,
int  nb_output_dims,
int  nb_input_dims,
int  nb_local_dims,
int  nb_parameters 
)

osl_relation_set_attributes_one function: this functions sets the attributes of a relation part provided as a parameter. It updates the relation directly.

Parameters:
[in,out]relationThe relation (union part) to set the attributes.
[in]nb_output_dimsNumber of output dimensions.
[in]nb_input_dimsNumber of input dimensions.
[in]nb_local_dimsNumber of local dimensions.
[in]nb_parametersNumber of parameters.

Definition at line 2637 of file relation.c.

References osl_relation::nb_input_dims, osl_relation::nb_local_dims, osl_relation::nb_output_dims, and osl_relation::nb_parameters.

Referenced by osl_relation_set_attributes().

void osl_relation_set_type ( osl_relation_p  relation,
int  type 
)

osl_relation_set_type function: this function sets the type of each relation union part in the relation to the one provided as parameter.

Parameters:
relationThe relation to set the type.
typeThe type.

Definition at line 2678 of file relation.c.

References osl_relation::next, and osl_relation::type.

char* osl_relation_spprint ( osl_relation_p  relation,
osl_names_p  names 
)

osl_relation_spprint function: this function pretty-prints the content of an osl_relation_t structure (*relation) into a string in the OpenScop format, and returns this string.

Parameters:
[in]relationThe relation whose information has to be printed.
[in]namesThe names of the constraint columns for comments.
Returns:
A string

Definition at line 1180 of file relation.c.

References OSL_malloc, OSL_MAX_STRING, osl_relation_nb_components(), osl_relation_spprint_polylib(), osl_relation_sprint_type(), and osl_util_safe_strcat().

Referenced by osl_relation_pprint(), and osl_relation_sprint().

char* osl_relation_spprint_polylib ( osl_relation_p  relation,
osl_names_p  names 
)

osl_relation_spprint_polylib function: this function pretty-prints the content of an osl_relation_t structure (*relation) into a string in the extended polylib format, and returns this string. This format is the same as OpenScop's, minus the type.

Parameters:
[in]relationThe relation whose information has to be printed.
[in]namesThe names of the constraint columns for comments.
Returns:
A string containing the relation pretty-printing.

Definition at line 818 of file relation.c.

References osl_names::arrays, osl_relation::m, osl_relation::nb_columns, osl_relation::nb_input_dims, osl_relation::nb_local_dims, osl_relation::nb_output_dims, osl_relation::nb_parameters, osl_relation::nb_rows, osl_relation::next, osl_int_sprint(), OSL_malloc, OSL_MAX_STRING, osl_names_free(), osl_relation_column_string(), osl_relation_names(), osl_relation_nb_components(), osl_relation_sprint_comment(), osl_relation_strings(), osl_util_safe_strcat(), osl_util_strdup(), osl_relation::precision, and osl_strings::string.

Referenced by osl_relation_spprint().

char* osl_relation_spprint_polylib_scoplib ( osl_relation_p  relation,
osl_names_p  names,
int  print_nth_part,
int  add_fakeiter 
)

osl_relation_spprint_polylib_scoplib function: this function pretty-prints the content of an osl_relation_t structure (*relation) into a string in the extended polylib format, and returns this string.

Parameters:
[in]relationThe relation whose information has to be printed.
[in]namesThe names of the constraint columns for comments.
[in]print_nth_partPrint the value of `n' (used for domain union)
[in]add_fakeiter
Returns:
A string containing the relation pretty-printing.

Definition at line 919 of file relation.c.

References osl_names::arrays, osl_relation::m, osl_relation::nb_columns, osl_relation::nb_input_dims, osl_relation::nb_output_dims, osl_relation::nb_parameters, osl_relation::nb_rows, osl_relation::next, osl_int_sprint(), OSL_malloc, OSL_MAX_STRING, osl_names_free(), osl_relation_column_string_scoplib(), osl_relation_names(), osl_relation_nb_components(), osl_relation_sprint_comment(), osl_relation_strings(), OSL_TYPE_DOMAIN, OSL_TYPE_READ, OSL_TYPE_SCATTERING, OSL_TYPE_WRITE, osl_util_safe_strcat(), osl_util_strdup(), osl_relation::precision, osl_strings::string, and osl_relation::type.

Referenced by osl_relation_spprint_scoplib().

char* osl_relation_spprint_scoplib ( osl_relation_p  relation,
osl_names_p  names,
int  print_nth_part,
int  add_fakeiter 
)

osl_relation_spprint_scoplib function: this function pretty-prints the content of an osl_relation_t structure (*relation) into a string in the SCoPLib format, and returns this string.

Parameters:
[in]relationThe relation whose information has to be printed.
[in]namesThe names of the constraint columns for comments.
[in]print_nth_partPrint the value of `n' (used for domain union)
[in]add_fakeiter
Returns:
A string

Definition at line 1215 of file relation.c.

References OSL_malloc, OSL_MAX_STRING, osl_relation_spprint_polylib_scoplib(), and osl_util_safe_strcat().

Referenced by osl_relation_pprint_scoplib().

char* osl_relation_sprint ( osl_relation_p  relation)

osl_relation_sprint function: this function prints the content of an osl_relation_t structure (*relation) into a string (returned) in the OpenScop textual format.

Parameters:
[in]relationThe relation structure to print.
Returns:
A string containing the OpenScop dump of the relation structure.

Definition at line 1277 of file relation.c.

References osl_relation_spprint().

Referenced by osl_dependence_sprint(), and osl_relation_interface().

osl_relation_p osl_relation_sread ( char **  input)

osl_relation_sread function: this function is equivalent to osl_relation_psread() except that the precision corresponds to the precision environment variable or to the highest available precision if it is not defined.

See also:
{osl_relation_psread}

Definition at line 1577 of file relation.c.

References osl_relation_psread(), and osl_util_get_precision().

Referenced by osl_relation_interface().

void osl_relation_sub_vector ( osl_relation_p  relation,
osl_vector_p  vector,
int  row 
)

osl_relation_sub_vector function: this function subtracts the vector "vector" to the "row"^th row of a relation "relation. It directly updates the relation union part pointed by "relation" and this part only.

Parameters:
[in,out]relationThe relation where to subtract a vector to a row.
[in]vectorThe vector to subtract to a relation row.
[in]rowThe row of the relation to subtract the vector.

Definition at line 1943 of file relation.c.

References osl_relation::m, osl_relation::nb_columns, osl_relation::nb_rows, OSL_error, osl_int_assign(), osl_int_get_si(), osl_int_sub(), osl_vector::precision, osl_relation::precision, osl_vector::size, and osl_vector::v.

void osl_relation_swap_constraints ( osl_relation_p  relation,
int  c1,
int  c2 
)

osl_relation_swap_constraints function: this function swaps two constraints (i.e., rows) of the relation matrix. This function updates the relation directly.

Parameters:
[in,out]relationThe relation to swap two rows (modified).
[in]c1The row corresponding to the first constraint.
[in]c2The row corresponding to the second constraint.

Definition at line 2172 of file relation.c.

References osl_relation::m, osl_relation::nb_columns, osl_relation::nb_rows, OSL_error, osl_int_swap(), and osl_relation::precision.

osl_relation_union function: this function builds a new relation from two relations provided as parameters. The new relation is built as an union of the two relations: the list of constraint sets are linked together.

Parameters:
[in]r1The first relation.
[in]r2The second relation.
Returns:
A new relation corresponding to the union of r1 and r2.

Definition at line 1867 of file relation.c.

References osl_relation_add(), and osl_relation_clone().