PPL C Language Interface 2.0
ppl_Linear_Expression_tag Interface Reference

Types and functions for linear expressions. More...

#include <ppl_c_header.h>

(Note that these are not member symbols.)

int ppl_new_Linear_Expression (ppl_Linear_Expression_t *ple)
 Creates a new linear expression corresponding to the constant 0 in a zero-dimensional space; writes a handle for the new linear expression at address ple.
int ppl_new_Linear_Expression_with_dimension (ppl_Linear_Expression_t *ple, ppl_dimension_type d)
 Creates a new linear expression corresponding to the constant 0 in a d-dimensional space; writes a handle for the new linear expression at address ple.
int ppl_new_Linear_Expression_from_Linear_Expression (ppl_Linear_Expression_t *ple, ppl_const_Linear_Expression_t le)
 Builds a linear expression that is a copy of le; writes a handle for the newly created linear expression at address ple.
int ppl_new_Linear_Expression_from_Constraint (ppl_Linear_Expression_t *ple, ppl_const_Constraint_t c)
 Builds a linear expression corresponding to constraint c; writes a handle for the newly created linear expression at address ple.
int ppl_new_Linear_Expression_from_Generator (ppl_Linear_Expression_t *ple, ppl_const_Generator_t g)
 Builds a linear expression corresponding to generator g; writes a handle for the newly created linear expression at address ple.
int ppl_new_Linear_Expression_from_Congruence (ppl_Linear_Expression_t *ple, ppl_const_Congruence_t c)
 Builds a linear expression corresponding to congruence c; writes a handle for the newly created linear expression at address ple.
int ppl_new_Linear_Expression_from_Grid_Generator (ppl_Linear_Expression_t *ple, ppl_const_Grid_Generator_t g)
 Builds a linear expression corresponding to grid generator g; writes a handle for the newly created linear expression at address ple.
int ppl_assign_Linear_Expression_from_Linear_Expression (ppl_Linear_Expression_t dst, ppl_const_Linear_Expression_t src)
 Assigns a copy of the linear expression src to dst.
int ppl_delete_Linear_Expression (ppl_const_Linear_Expression_t le)
 Invalidates the handle le: this makes sure the corresponding resources will eventually be released.
int ppl_Linear_Expression_space_dimension (ppl_const_Linear_Expression_t le, ppl_dimension_type *m)
 Writes to m the space dimension of le.
int ppl_Linear_Expression_coefficient (ppl_const_Linear_Expression_t le, ppl_dimension_type var, ppl_Coefficient_t n)
 Copies into n the coefficient of variable var in the linear expression le.
int ppl_Linear_Expression_inhomogeneous_term (ppl_const_Linear_Expression_t le, ppl_Coefficient_t n)
 Copies into n the inhomogeneous term of linear expression le.
int ppl_Linear_Expression_OK (ppl_const_Linear_Expression_t le)
 Returns a positive integer if le is well formed, i.e., if it satisfies all its implementation invariants; returns 0 and perhaps makes some noise if le is broken. Useful for debugging purposes.
int ppl_Linear_Expression_is_zero (ppl_const_Linear_Expression_t le)
 Returns true if and only if *this is $0$.
int ppl_Linear_Expression_all_homogeneous_terms_are_zero (ppl_const_Linear_Expression_t le)
 Returns true if and only if all the homogeneous terms of *this are $0$.
int ppl_Linear_Expression_add_to_coefficient (ppl_Linear_Expression_t le, ppl_dimension_type var, ppl_const_Coefficient_t n)
 Adds n to the coefficient of variable var in the linear expression le. The space dimension is set to be the maximum between var + 1 and the old space dimension.
int ppl_Linear_Expression_add_to_inhomogeneous (ppl_Linear_Expression_t le, ppl_const_Coefficient_t n)
 Adds n to the inhomogeneous term of the linear expression le.
int ppl_add_Linear_Expression_to_Linear_Expression (ppl_Linear_Expression_t dst, ppl_const_Linear_Expression_t src)
 Adds the linear expression src to dst.
int ppl_subtract_Linear_Expression_from_Linear_Expression (ppl_Linear_Expression_t dst, ppl_const_Linear_Expression_t src)
 Subtracts the linear expression src from dst.
int ppl_multiply_Linear_Expression_by_Coefficient (ppl_Linear_Expression_t le, ppl_const_Coefficient_t n)
 Multiply the linear expression dst by n.
int ppl_io_print_Linear_Expression (ppl_const_Linear_Expression_t x)
 Prints x to stdout.
int ppl_io_fprint_Linear_Expression (FILE *stream, ppl_const_Linear_Expression_t x)
 Prints x to the given output stream.
int ppl_io_asprint_Linear_Expression (char **strp, ppl_const_Linear_Expression_t x)
 Prints x to a malloc-allocated string, a pointer to which is returned via strp.
int ppl_Linear_Expression_ascii_dump (ppl_const_Linear_Expression_t x, FILE *stream)
 Dumps an ascii representation of x on stream.
int ppl_Linear_Expression_ascii_load (ppl_Linear_Expression_t x, FILE *stream)
 Loads an ascii representation of x from stream.

Detailed Description

Types and functions for linear expressions.

The types and functions for linear expression provide an interface towards Linear_Expression.

◆ ppl_new_Linear_Expression()

int ppl_new_Linear_Expression ( ppl_Linear_Expression_t * ple)
related

Creates a new linear expression corresponding to the constant 0 in a zero-dimensional space; writes a handle for the new linear expression at address ple.

Parameters
pleReceives the newly allocated object handle; release it with the matching deletion function.
Returns
Zero on success; a negative error code on failure.

◆ ppl_new_Linear_Expression_with_dimension()

int ppl_new_Linear_Expression_with_dimension ( ppl_Linear_Expression_t * ple,
ppl_dimension_type d )
related

Creates a new linear expression corresponding to the constant 0 in a d-dimensional space; writes a handle for the new linear expression at address ple.

Parameters
pleReceives the newly allocated object handle; release it with the matching deletion function.
dThe requested space dimension.
Returns
Zero on success; a negative error code on failure.

◆ ppl_new_Linear_Expression_from_Linear_Expression()

int ppl_new_Linear_Expression_from_Linear_Expression ( ppl_Linear_Expression_t * ple,
ppl_const_Linear_Expression_t le )
related

Builds a linear expression that is a copy of le; writes a handle for the newly created linear expression at address ple.

Parameters
pleReceives the newly allocated object handle; release it with the matching deletion function.
leThe borrowed handle to the input object.
Returns
Zero on success; a negative error code on failure.

◆ ppl_new_Linear_Expression_from_Constraint()

int ppl_new_Linear_Expression_from_Constraint ( ppl_Linear_Expression_t * ple,
ppl_const_Constraint_t c )
related

Builds a linear expression corresponding to constraint c; writes a handle for the newly created linear expression at address ple.

Parameters
pleReceives the newly allocated object handle; release it with the matching deletion function.
cThe borrowed handle to the input object.
Returns
Zero on success; a negative error code on failure.

◆ ppl_new_Linear_Expression_from_Generator()

int ppl_new_Linear_Expression_from_Generator ( ppl_Linear_Expression_t * ple,
ppl_const_Generator_t g )
related

Builds a linear expression corresponding to generator g; writes a handle for the newly created linear expression at address ple.

Parameters
pleReceives the newly allocated object handle; release it with the matching deletion function.
gThe borrowed handle to the input object.
Returns
Zero on success; a negative error code on failure.

◆ ppl_new_Linear_Expression_from_Congruence()

int ppl_new_Linear_Expression_from_Congruence ( ppl_Linear_Expression_t * ple,
ppl_const_Congruence_t c )
related

Builds a linear expression corresponding to congruence c; writes a handle for the newly created linear expression at address ple.

Parameters
pleReceives the newly allocated object handle; release it with the matching deletion function.
cThe borrowed handle to the input object.
Returns
Zero on success; a negative error code on failure.

◆ ppl_new_Linear_Expression_from_Grid_Generator()

int ppl_new_Linear_Expression_from_Grid_Generator ( ppl_Linear_Expression_t * ple,
ppl_const_Grid_Generator_t g )
related

Builds a linear expression corresponding to grid generator g; writes a handle for the newly created linear expression at address ple.

Parameters
pleReceives the newly allocated object handle; release it with the matching deletion function.
gThe borrowed handle to the input object.
Returns
Zero on success; a negative error code on failure.

◆ ppl_assign_Linear_Expression_from_Linear_Expression()

int ppl_assign_Linear_Expression_from_Linear_Expression ( ppl_Linear_Expression_t dst,
ppl_const_Linear_Expression_t src )
related

Assigns a copy of the linear expression src to dst.

Parameters
dstThe destination object handle.
srcThe source object handle.
Returns
Zero on success; a negative error code on failure.

◆ ppl_delete_Linear_Expression()

int ppl_delete_Linear_Expression ( ppl_const_Linear_Expression_t le)
related

Invalidates the handle le: this makes sure the corresponding resources will eventually be released.

Parameters
leThe borrowed handle to the input object.
Returns
Zero on success; a negative error code on failure.

◆ ppl_Linear_Expression_space_dimension()

int ppl_Linear_Expression_space_dimension ( ppl_const_Linear_Expression_t le,
ppl_dimension_type * m )
related

Writes to m the space dimension of le.

Parameters
leThe borrowed handle to the input object.
mThe number of space dimensions to add.
Returns
Zero on success; a negative error code on failure.

◆ ppl_Linear_Expression_coefficient()

int ppl_Linear_Expression_coefficient ( ppl_const_Linear_Expression_t le,
ppl_dimension_type var,
ppl_Coefficient_t n )
related

Copies into n the coefficient of variable var in the linear expression le.

Parameters
leThe borrowed handle to the input object.
varThe index of the selected space dimension.
nThe coefficient handle receiving the requested value.
Returns
Zero on success; a negative error code on failure.

◆ ppl_Linear_Expression_inhomogeneous_term()

int ppl_Linear_Expression_inhomogeneous_term ( ppl_const_Linear_Expression_t le,
ppl_Coefficient_t n )
related

Copies into n the inhomogeneous term of linear expression le.

Parameters
leThe borrowed handle to the input object.
nThe coefficient handle receiving the requested value.
Returns
Zero on success; a negative error code on failure.

◆ ppl_Linear_Expression_OK()

int ppl_Linear_Expression_OK ( ppl_const_Linear_Expression_t le)
related

Returns a positive integer if le is well formed, i.e., if it satisfies all its implementation invariants; returns 0 and perhaps makes some noise if le is broken. Useful for debugging purposes.

Parameters
leThe borrowed handle to the input object.
Returns
A positive integer if le is well formed, i.e., if it satisfies all its implementation invariants; returns 0 and perhaps makes some noise if le is broken. Useful for debugging purposes.

◆ ppl_Linear_Expression_is_zero()

int ppl_Linear_Expression_is_zero ( ppl_const_Linear_Expression_t le)
related

Returns true if and only if *this is $0$.

Parameters
leThe borrowed handle to the input object.
Returns
true if and only if *this is $0$.

◆ ppl_Linear_Expression_all_homogeneous_terms_are_zero()

int ppl_Linear_Expression_all_homogeneous_terms_are_zero ( ppl_const_Linear_Expression_t le)
related

Returns true if and only if all the homogeneous terms of *this are $0$.

Parameters
leThe borrowed handle to the input object.
Returns
true if and only if all the homogeneous terms of *this are $0$.

◆ ppl_Linear_Expression_add_to_coefficient()

int ppl_Linear_Expression_add_to_coefficient ( ppl_Linear_Expression_t le,
ppl_dimension_type var,
ppl_const_Coefficient_t n )
related

Adds n to the coefficient of variable var in the linear expression le. The space dimension is set to be the maximum between var + 1 and the old space dimension.

Parameters
leThe linear-expression handle updated by the operation.
varThe index of the selected space dimension.
nThe borrowed handle to the input object.
Returns
Zero on success; a negative error code on failure.

◆ ppl_Linear_Expression_add_to_inhomogeneous()

int ppl_Linear_Expression_add_to_inhomogeneous ( ppl_Linear_Expression_t le,
ppl_const_Coefficient_t n )
related

Adds n to the inhomogeneous term of the linear expression le.

Parameters
leThe linear-expression handle updated by the operation.
nThe borrowed handle to the input object.
Returns
Zero on success; a negative error code on failure.

◆ ppl_add_Linear_Expression_to_Linear_Expression()

int ppl_add_Linear_Expression_to_Linear_Expression ( ppl_Linear_Expression_t dst,
ppl_const_Linear_Expression_t src )
related

Adds the linear expression src to dst.

Parameters
dstThe destination object handle.
srcThe source object handle.
Returns
Zero on success; a negative error code on failure.

◆ ppl_subtract_Linear_Expression_from_Linear_Expression()

int ppl_subtract_Linear_Expression_from_Linear_Expression ( ppl_Linear_Expression_t dst,
ppl_const_Linear_Expression_t src )
related

Subtracts the linear expression src from dst.

Parameters
dstThe destination object handle.
srcThe source object handle.
Returns
Zero on success; a negative error code on failure.

◆ ppl_multiply_Linear_Expression_by_Coefficient()

int ppl_multiply_Linear_Expression_by_Coefficient ( ppl_Linear_Expression_t le,
ppl_const_Coefficient_t n )
related

Multiply the linear expression dst by n.

Parameters
leThe linear-expression handle updated by the operation.
nThe borrowed handle to the input object.
Returns
Zero on success; a negative error code on failure.

◆ ppl_io_print_Linear_Expression()

int ppl_io_print_Linear_Expression ( ppl_const_Linear_Expression_t x)
related

Prints x to stdout.

Parameters
xThe borrowed handle to the input object.
Returns
Zero on success; a negative error code on failure.

◆ ppl_io_fprint_Linear_Expression()

int ppl_io_fprint_Linear_Expression ( FILE * stream,
ppl_const_Linear_Expression_t x )
related

Prints x to the given output stream.

Parameters
streamThe file stream to which output is written.
xThe borrowed handle to the input object.
Returns
Zero on success; a negative error code on failure.

◆ ppl_io_asprint_Linear_Expression()

int ppl_io_asprint_Linear_Expression ( char ** strp,
ppl_const_Linear_Expression_t x )
related

Prints x to a malloc-allocated string, a pointer to which is returned via strp.

Parameters
strpReceives the newly malloc-allocated string; the caller must release it with free().
xThe borrowed handle to the input object.
Returns
Prints x to a malloc-allocated string, a pointer to which is returned via strp.

◆ ppl_Linear_Expression_ascii_dump()

int ppl_Linear_Expression_ascii_dump ( ppl_const_Linear_Expression_t x,
FILE * stream )
related

Dumps an ascii representation of x on stream.

Parameters
xThe borrowed handle to the input object.
streamThe file stream to which output is written.
Returns
Zero on success; a negative error code on failure.

◆ ppl_Linear_Expression_ascii_load()

int ppl_Linear_Expression_ascii_load ( ppl_Linear_Expression_t x,
FILE * stream )
related

Loads an ascii representation of x from stream.

Parameters
xThe linear expression operand.
streamThe file stream from which input is read.
Returns
Zero on success; a negative error code on failure.

The documentation for this interface was generated from the following file: