OpenScop  0.9.0
Functions
relation.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <osl/macros.h>
#include <osl/int.h>
#include <osl/util.h>
#include <osl/vector.h>
#include <osl/strings.h>
#include <osl/names.h>
#include <osl/relation.h>
Include dependency graph for relation.c:

Go to the source code of this file.

Functions

static char * osl_relation_sprint_type (osl_relation_p relation)
static void osl_relation_print_type (FILE *file, osl_relation_p relation)
void osl_relation_idump (FILE *file, osl_relation_p relation, int level)
void osl_relation_dump (FILE *file, osl_relation_p relation)
static char * osl_relation_expression_element (osl_int_t val, int precision, int *first, int cst, char *name)
static char ** osl_relation_strings (osl_relation_p relation, osl_names_p names)
static char * osl_relation_subexpression (osl_relation_p relation, int row, int start, int stop, int oppose, char **strings)
char * osl_relation_expression (osl_relation_p relation, int row, char **strings)
static int osl_relation_is_simple_output (osl_relation_p relation, int row)
static char * osl_relation_sprint_comment (osl_relation_p relation, int row, char **strings, char **arrays)
static char * osl_relation_column_string (osl_relation_p relation, char **strings)
static char * osl_relation_column_string_scoplib (osl_relation_p relation, char **strings)
static osl_names_p osl_relation_names (osl_relation_p relation)
int osl_relation_nb_components (osl_relation_p relation)
char * osl_relation_spprint_polylib (osl_relation_p relation, osl_names_p names)
char * osl_relation_spprint_polylib_scoplib (osl_relation_p relation, osl_names_p names, int print_nth_part, int add_fakeiter)
char * osl_relation_spprint (osl_relation_p relation, osl_names_p names)
char * osl_relation_spprint_scoplib (osl_relation_p relation, osl_names_p names, int print_nth_part, int add_fakeiter)
void osl_relation_pprint (FILE *file, osl_relation_p relation, osl_names_p names)
void osl_relation_pprint_scoplib (FILE *file, osl_relation_p relation, osl_names_p names, int print_nth_part, int add_fakeiter)
char * osl_relation_sprint (osl_relation_p relation)
void osl_relation_print (FILE *file, osl_relation_p relation)
static int osl_relation_read_type (FILE *file, char **str)
osl_relation_p osl_relation_pread (FILE *foo, int precision)
osl_relation_p osl_relation_psread (char **input, int precision)
osl_relation_p osl_relation_sread (char **input)
osl_relation_p osl_relation_read (FILE *foo)
osl_relation_p osl_relation_pmalloc (int precision, int nb_rows, int nb_columns)
osl_relation_p osl_relation_malloc (int nb_rows, int nb_columns)
void osl_relation_free_inside (osl_relation_p relation)
void osl_relation_free (osl_relation_p relation)
osl_relation_p osl_relation_nclone (osl_relation_p relation, int n)
osl_relation_p osl_relation_clone_nconstraints (osl_relation_p relation, int n)
osl_relation_p osl_relation_clone (osl_relation_p relation)
void osl_relation_add (osl_relation_p *r1, osl_relation_p r2)
osl_relation_p osl_relation_union (osl_relation_p r1, osl_relation_p r2)
void osl_relation_replace_vector (osl_relation_p relation, osl_vector_p vector, int row)
void osl_relation_add_vector (osl_relation_p relation, osl_vector_p vector, int row)
void osl_relation_sub_vector (osl_relation_p relation, osl_vector_p vector, int row)
void osl_relation_insert_vector (osl_relation_p relation, osl_vector_p vector, int row)
osl_relation_p osl_relation_concat_vector (osl_relation_p relation, osl_vector_p vector)
void osl_relation_insert_blank_row (osl_relation_p relation, int row)
void osl_relation_insert_blank_column (osl_relation_p relation, int column)
osl_relation_p osl_relation_from_vector (osl_vector_p vector)
void osl_relation_replace_constraints (osl_relation_p r1, osl_relation_p r2, int row)
void osl_relation_insert_constraints (osl_relation_p r1, osl_relation_p r2, int row)
void osl_relation_swap_constraints (osl_relation_p relation, int c1, int c2)
void osl_relation_remove_row (osl_relation_p r, int row)
void osl_relation_remove_column (osl_relation_p r, int column)
void osl_relation_insert_columns (osl_relation_p relation, osl_relation_p insert, int column)
osl_relation_p osl_relation_concat_constraints (osl_relation_p r1, osl_relation_p r2)
int osl_relation_part_equal (osl_relation_p r1, osl_relation_p r2)
int osl_relation_equal (osl_relation_p r1, osl_relation_p r2)
static int osl_relation_check_attribute (int *expected, int actual)
static int osl_relation_check_nb_columns (osl_relation_p relation, int expected_nb_output_dims, int expected_nb_input_dims, int expected_nb_parameters)
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)
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)
void osl_relation_set_attributes (osl_relation_p relation, int nb_output_dims, int nb_input_dims, int nb_local_dims, int nb_parameters)
void osl_relation_set_type (osl_relation_p relation, int type)
int osl_relation_get_array_id (osl_relation_p relation)
int osl_relation_is_access (osl_relation_p relation)
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_p osl_relation_extend_output (osl_relation_p relation, int dim)
osl_interface_p osl_relation_interface ()

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.

static int osl_relation_check_attribute ( int *  expected,
int  actual 
) [static]

osl_relation_check_attribute internal function: This function checks whether an "actual" value is the same as an "expected" value or not. If the expected value is set to OSL_UNDEFINED, this function sets it to the "actual" value and do not report a difference has been detected. It returns 0 if a difference has been detected, 1 otherwise.

Parameters:
[in,out]expectedPointer to the expected value (the value is modified if it was set to OSL_UNDEFINED).
[in]actualValue we want to check.
Returns:
0 if the values are not the same while the expected value was not OSL_UNDEFINED, 1 otherwise.

Definition at line 2435 of file relation.c.

References OSL_UNDEFINED, and OSL_warning.

Referenced by osl_relation_integrity_check().

static int osl_relation_check_nb_columns ( osl_relation_p  relation,
int  expected_nb_output_dims,
int  expected_nb_input_dims,
int  expected_nb_parameters 
) [static]

osl_relation_check_nb_columns internal function: This function checks that the number of columns of a relation corresponds to some expected properties (setting an expected property to OSL_UNDEFINED makes this function unable to detect a problem). It returns 0 if the number of columns seems incorrect or 1 if no problem has been detected.

Parameters:
[in]relationThe relation we want to check the number of columns.
[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 number of columns seems incorrect, 1 otherwise.

Definition at line 2465 of file relation.c.

References osl_relation::nb_columns, osl_relation::nb_local_dims, OSL_UNDEFINED, and OSL_warning.

Referenced by osl_relation_integrity_check().

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.

static char* osl_relation_column_string ( osl_relation_p  relation,
char **  strings 
) [static]

osl_relation_column_string function: this function returns an OpenScop comment string showing all column names. It is designed to nicely fit a constraint matrix that would be printed just below this line.

Parameters:
[in]relationThe relation related to the comment line to build.
[in]stringsArray of textual names of the various elements.
Returns:
A fancy comment string with all the dimension names.

Definition at line 614 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_FMT_LENGTH, OSL_malloc, and OSL_MAX_STRING.

Referenced by osl_relation_spprint_polylib().

static char* osl_relation_column_string_scoplib ( osl_relation_p  relation,
char **  strings 
) [static]

osl_relation_column_string_scoplib function: this function returns an OpenScop comment string showing all column names. It is designed to nicely fit a constraint matrix that would be printed just below this line.

Parameters:
[in]relationThe relation related to the comment line to build.
[in]stringsArray of textual names of the various elements.
Returns:
A fancy comment string with all the dimension names.

Definition at line 690 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_FMT_LENGTH, OSL_malloc, OSL_MAX_STRING, OSL_TYPE_DOMAIN, and osl_relation::type.

Referenced by osl_relation_spprint_polylib_scoplib().

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().

static char* osl_relation_expression_element ( osl_int_t  val,
int  precision,
int *  first,
int  cst,
char *  name 
) [static]

osl_relation_expression_element function: this function returns a string containing the printing of a value (e.g., an iterator with its coefficient or a constant).

Parameters:
[in]valCoefficient or constant value.
[in]precisionThe precision of the value.
[in,out]firstPointer to a boolean set to 1 if the current value is the first of an expresion, 0 otherwise (maybe updated).
[in]cstA boolean set to 1 if the value is a constant, 0 otherwise.
[in]nameString containing the name of the element.
Returns:
A string that contains the printing of a value.

Definition at line 266 of file relation.c.

References osl_int_mone(), osl_int_neg(), osl_int_one(), osl_int_pos(), osl_int_sprint_txt(), osl_int_zero(), OSL_malloc, and OSL_MAX_STRING.

Referenced by osl_relation_subexpression().

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().

static int osl_relation_is_simple_output ( osl_relation_p  relation,
int  row 
) [static]

osl_relation_is_simple_output function: this function returns 1 or -1 if a given constraint row of a relation corresponds to an output, 0 otherwise. We call a simple output an equality constraint where exactly one output coefficient is not 0 and is either 1 (in this case the function returns 1) or -1 (in this case the function returns -1).

Parameters:
[in]relationThe relation to test for simple output.
[in]rowThe row corresponding to the constraint to test.
Returns:
1 or -1 if the row is a simple output, 0 otherwise.

Definition at line 487 of file relation.c.

References osl_relation::m, osl_relation::nb_output_dims, osl_relation::nb_rows, OSL_error, osl_int_mone(), osl_int_one(), osl_int_zero(), and osl_relation::precision.

Referenced by osl_relation_sprint_comment().

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().

static osl_names_p osl_relation_names ( osl_relation_p  relation) [static]

osl_relation_names function: this function generates as set of names for all the dimensions involved in a given relation.

Parameters:
[in]relationThe relation we have to generate names for.
Returns:
A set of generated names for the input relation dimensions.

Definition at line 772 of file relation.c.

References osl_names_generate(), osl_relation_get_attributes(), and OSL_UNDEFINED.

Referenced by osl_relation_spprint_polylib(), and osl_relation_spprint_polylib_scoplib().

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().

static void osl_relation_print_type ( FILE *  file,
osl_relation_p  relation 
) [static]

osl_relation_print_type function: this function displays the textual type of an osl_relation_t structure into a file (file, possibly stdout), according to the OpenScop specification.

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

Definition at line 147 of file relation.c.

References osl_relation_sprint_type().

Referenced by osl_relation_idump().

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().

static int osl_relation_read_type ( FILE *  file,
char **  str 
) [static]

osl_relation_read_type function: this function reads a textual relation type on the input 'file' or the input string 'str' depending on which one is not NULL (exactly one of them must not be NULL). It returns its integer counterpart.

Parameters:
[in]fileThe file where to read a relation type (if not NULL).
[in,out]strThe string where to read a relation type (if not NULL). This pointer is updated to reflect the read and points after the tag in the input string.
Returns:
The relation type.

Definition at line 1313 of file relation.c.

References OSL_error, OSL_STRING_CONTEXT, OSL_STRING_DOMAIN, OSL_STRING_MAY_WRITE, OSL_STRING_READ, OSL_STRING_SCATTERING, OSL_STRING_UNDEFINED, OSL_STRING_WRITE, osl_strings_free(), osl_strings_read(), osl_strings_size(), osl_strings_sread(), OSL_TYPE_CONTEXT, OSL_TYPE_DOMAIN, OSL_TYPE_MAY_WRITE, OSL_TYPE_READ, OSL_TYPE_SCATTERING, OSL_TYPE_WRITE, OSL_UNDEFINED, OSL_warning, and osl_strings::string.

Referenced by osl_relation_pread(), and osl_relation_psread().

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().

static char* osl_relation_sprint_comment ( osl_relation_p  relation,
int  row,
char **  strings,
char **  arrays 
) [static]

osl_relation_sprint_comment function: this function prints into a string a comment corresponding to a constraint of a relation, according to its type, then it returns this string. This function does not check that printing the comment is possible (i.e., are there enough names ?), hence it is the responsibility of the user to ensure he/she can call this function safely.

Parameters:
[in]relationThe relation for which a comment has to be printed.
[in]rowThe constrain row for which a comment has to be printed.
[in]stringsArray of textual names of the various elements.
[in]arraysArray of textual identifiers of the arrays.
Returns:
A string which contains the comment for the row.

Definition at line 540 of file relation.c.

References osl_relation::m, osl_relation::nb_columns, osl_relation::nb_output_dims, OSL_debug, osl_int_zero(), OSL_malloc, OSL_MAX_STRING, osl_relation_expression(), osl_relation_get_array_id(), osl_relation_is_access(), osl_relation_is_simple_output(), osl_relation_subexpression(), osl_util_safe_strcat(), and osl_relation::precision.

Referenced by osl_relation_spprint_polylib(), and osl_relation_spprint_polylib_scoplib().

static char* osl_relation_sprint_type ( osl_relation_p  relation) [static]

osl_relation_sprint_type function: this function prints the textual type of an osl_relation_t structure into a string, according to the OpenScop specification, and returns that string.

Parameters:
[in]relationThe relation whose type has to be printed.
Returns:
A string containing the relation type.

Definition at line 91 of file relation.c.

References OSL_malloc, OSL_MAX_STRING, OSL_STRING_CONTEXT, OSL_STRING_DOMAIN, OSL_STRING_MAY_WRITE, OSL_STRING_READ, OSL_STRING_SCATTERING, OSL_STRING_UNDEFINED, OSL_STRING_WRITE, OSL_TYPE_CONTEXT, OSL_TYPE_DOMAIN, OSL_TYPE_MAY_WRITE, OSL_TYPE_READ, OSL_TYPE_SCATTERING, OSL_TYPE_WRITE, OSL_UNDEFINED, OSL_warning, and osl_relation::type.

Referenced by osl_relation_print_type(), and osl_relation_spprint().

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().

static char** osl_relation_strings ( osl_relation_p  relation,
osl_names_p  names 
) [static]

osl_relation_strings function: this function creates a NULL-terminated array of strings from an osl_names_t structure in such a way that the ith string is the "name" corresponding to the ith column of the constraint matrix.

Parameters:
[in]relationThe relation for which we need an array of names.
[in]namesThe set of names for each element.
Returns:
An array of strings with one string per constraint matrix column.

Definition at line 343 of file relation.c.

References osl_names::iterators, osl_names::local_dims, osl_relation::nb_columns, osl_relation::nb_input_dims, osl_relation::nb_local_dims, osl_relation::nb_output_dims, osl_relation::nb_parameters, OSL_debug, OSL_malloc, OSL_MAX_STRING, osl_relation_is_access(), OSL_strdup, OSL_TYPE_CONTEXT, OSL_TYPE_DOMAIN, osl_names::parameters, osl_names::scatt_dims, osl_strings::string, and osl_relation::type.

Referenced by osl_relation_spprint_polylib(), and osl_relation_spprint_polylib_scoplib().

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.

static char* osl_relation_subexpression ( osl_relation_p  relation,
int  row,
int  start,
int  stop,
int  oppose,
char **  strings 
) [static]

osl_relation_subexpression function: this function returns a string corresponding to an affine (sub-)expression stored at the "row"^th row of the relation pointed by "relation" between the start and stop columns. Optionally it may oppose the whole expression.

Parameters:
[in]relationA set of linear expressions.
[in]rowThe row corresponding to the expression.
[in]startThe first column for the expression (inclusive).
[in]stopThe last column for the expression (inclusive).
[in]opposeBoolean set to 1 to negate the expression, 0 otherwise.
[in]stringsArray of textual names of the various elements.
Returns:
A string that contains the printing of an affine (sub-)expression.

Definition at line 420 of file relation.c.

References osl_relation::m, osl_relation::nb_columns, osl_int_oppose(), OSL_malloc, OSL_MAX_STRING, osl_relation_expression_element(), and osl_relation::precision.

Referenced by osl_relation_expression(), and osl_relation_sprint_comment().

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().