OpenScop
0.9.0
|
Go to the source code of this file.
Data Structures | |
struct | osl_vector |
Typedefs | |
typedef struct osl_vector | osl_vector_t |
typedef struct osl_vector * | osl_vector_p |
Functions | |
void | osl_vector_idump (FILE *, osl_vector_p, int) |
void | osl_vector_dump (FILE *, osl_vector_p) |
osl_vector_p | osl_vector_pmalloc (int, int) |
osl_vector_p | osl_vector_malloc (int) |
void | osl_vector_free (osl_vector_p) |
osl_vector_p | osl_vector_add_scalar (osl_vector_p, int) |
osl_vector_p | osl_vector_mul_scalar (osl_vector_p, int) |
osl_vector_p | osl_vector_add (osl_vector_p, osl_vector_p) |
osl_vector_p | osl_vector_sub (osl_vector_p, osl_vector_p) |
void | osl_vector_tag_inequality (osl_vector_p) |
void | osl_vector_tag_equality (osl_vector_p) |
int | osl_vector_equal (osl_vector_p, osl_vector_p) |
int | osl_vector_is_scalar (osl_vector_p) |
typedef struct osl_vector* osl_vector_p |
typedef struct osl_vector osl_vector_t |
osl_vector_p osl_vector_add | ( | osl_vector_p | v1, |
osl_vector_p | v2 | ||
) |
osl_vector_add function: This function achieves the addition of two vectors and returns the result as a new vector (the addition means the ith entry of the new vector is equal to the ith entry of vector v1 plus the ith entry of vector v2).
v1 | The first vector for the addition. |
v2 | The second vector for the addition. |
Definition at line 254 of file vector.c.
References OSL_error, osl_int_add(), osl_vector_pmalloc(), osl_vector::precision, osl_vector::size, and osl_vector::v.
osl_vector_p osl_vector_add_scalar | ( | osl_vector_p | vector, |
int | scalar | ||
) |
osl_vector_add_scalar function: This function adds a scalar to the vector representation of an affine expression (this means we add the scalar only to the very last entry of the vector). It returns a new vector resulting from this addition.
[in] | vector | The basis vector. |
[in] | scalar | The scalar to add to the vector. |
Definition at line 226 of file vector.c.
References OSL_error, osl_int_add_si(), osl_int_assign(), osl_vector_pmalloc(), osl_vector::precision, osl_vector::size, and osl_vector::v.
void osl_vector_dump | ( | FILE * | file, |
osl_vector_p | vector | ||
) |
osl_vector_dump function: This function prints the content of a osl_vector_t structure (*vector) into a file (file, possibly stdout).
[in] | file | File where informations are printed. |
[in] | vector | The vector whose information have to be printed. |
Definition at line 138 of file vector.c.
References osl_vector_idump().
int osl_vector_equal | ( | osl_vector_p | v1, |
osl_vector_p | v2 | ||
) |
osl_vector_equal function: this function returns true if the two vectors are the same, false otherwise.
v1 | The first vector. |
v2 | The second vector. |
Definition at line 333 of file vector.c.
References osl_int_ne(), osl_vector::precision, osl_vector::size, and osl_vector::v.
void osl_vector_free | ( | osl_vector_p | vector | ) |
osl_vector_free function: This function frees the allocated memory for a osl_vector_t structure.
[in] | vector | The pointer to the vector we want to free. |
Definition at line 197 of file vector.c.
References osl_int_clear(), osl_vector::precision, osl_vector::size, and osl_vector::v.
Referenced by osl_relation_insert_blank_row().
void osl_vector_idump | ( | FILE * | file, |
osl_vector_p | vector, | ||
int | level | ||
) |
osl_vector_idump function: Displays a osl_vector_t structure (*vector) into a file (file, possibly stdout) in a way that trends to be understandable without falling in a deep depression or, for the lucky ones, getting a headache... It includes an indentation level (level) in order to work with others idump functions.
[in] | file | File where informations are printed. |
[in] | vector | The vector whose information have to be printed. |
[in] | level | Number of spaces before printing, for each line. |
Definition at line 89 of file vector.c.
References osl_int_dump_precision(), osl_int_print(), osl_vector::precision, osl_vector::size, and osl_vector::v.
Referenced by osl_vector_dump().
int osl_vector_is_scalar | ( | osl_vector_p | vector | ) |
osl_vector_is_scalar function: this function returns 1 if the vector represents a scalar value (all but its last element is 0), 0 otherwise.
[in] | vector | The vector to check whether it is scalar or not. |
Definition at line 376 of file vector.c.
References osl_int_zero(), osl_vector::precision, osl_vector::size, and osl_vector::v.
osl_vector_p osl_vector_malloc | ( | int | size | ) |
osl_vector_malloc function: This function allocates the memory space for a osl_vector_t structure and sets its fields with default values. Then it returns a pointer to the allocated space. The precision of the vector elements corresponds to the precision environment variable or to the highest available precision if it is not defined.
[in] | size | The number of entries of the vector to allocate. |
Definition at line 186 of file vector.c.
References osl_util_get_precision(), and osl_vector_pmalloc().
osl_vector_p osl_vector_mul_scalar | ( | osl_vector_p | v, |
int | scalar | ||
) |
osl_vector_mul_scalar function: this function returns a new vector corresponding to the one provided as parameter with each entry multiplied by a scalar.
v | The vector to multiply. |
scalar | The scalar coefficient. |
Definition at line 358 of file vector.c.
References osl_int_mul_si(), osl_vector_pmalloc(), osl_vector::precision, osl_vector::size, and osl_vector::v.
osl_vector_p osl_vector_pmalloc | ( | int | precision, |
int | size | ||
) |
osl_vector_pmalloc function: (precision malloc) this function allocates the memory space for an osl_vector_t structure and sets its fields with default values. Then it returns a pointer to the allocated space.
[in] | precision | The precision of the vector entries. |
[in] | size | The number of entries of the vector to allocate. |
Definition at line 157 of file vector.c.
References osl_int_init_set_si(), OSL_malloc, osl_vector::precision, osl_vector::size, and osl_vector::v.
Referenced by osl_relation_insert_blank_row(), osl_vector_add(), osl_vector_add_scalar(), osl_vector_malloc(), osl_vector_mul_scalar(), and osl_vector_sub().
osl_vector_p osl_vector_sub | ( | osl_vector_p | v1, |
osl_vector_p | v2 | ||
) |
osl_vector_sub function: This function achieves the subtraction of two vectors and returns the result as a new vector (the addition means the ith entry of the new vector is equal to the ith entry of vector v1 minus the ith entry of vector v2).
v1 | The first vector for the subtraction. |
v2 | The second vector for the subtraction (result is v1-v2). |
Definition at line 279 of file vector.c.
References OSL_error, osl_int_sub(), osl_vector_pmalloc(), osl_vector::precision, osl_vector::size, and osl_vector::v.
void osl_vector_tag_equality | ( | osl_vector_p | vector | ) |
osl_vector_tag_equality function: This function tags a vector representation of a contraint as being an equality ==0. This means in the PolyLib format, to set to 0 the very first entry of the vector. It modifies directly the vector provided as an argument.
vector | The vector to be tagged. |
Definition at line 318 of file vector.c.
References OSL_error, osl_int_set_si(), osl_vector::precision, osl_vector::size, and osl_vector::v.
void osl_vector_tag_inequality | ( | osl_vector_p | vector | ) |
osl_vector_tag_inequality function: This function tags a vector representation of a contraint as being an inequality >=0. This means in the PolyLib format, to set to 1 the very first entry of the vector. It modifies directly the vector provided as an argument.
vector | The vector to be tagged. |
Definition at line 303 of file vector.c.
References OSL_error, osl_int_set_si(), osl_vector::precision, osl_vector::size, and osl_vector::v.