PPL C Language Interface 2.0
ppl_Congruence_tag Interface Reference

Types and functions for congruences. More...

#include <ppl_c_header.h>

(Note that these are not member symbols.)

int ppl_new_Congruence (ppl_Congruence_t *pc, ppl_const_Linear_Expression_t le, ppl_const_Coefficient_t m)
 Creates the new congruence $le = 0 \pmod{m}$ and writes a handle for it at address pc. The space dimension of the new congruence is equal to the space dimension of le.
int ppl_new_Congruence_zero_dim_false (ppl_Congruence_t *pc)
 Creates the unsatisfiable (zero-dimension space) congruence $0 = 1 \pmod{0}$ and writes a handle for it at address pc.
int ppl_new_Congruence_zero_dim_integrality (ppl_Congruence_t *pc)
 Creates the true (zero-dimension space) congruence $0 = 1 \pmod{1}$, also known as integrality congruence. A handle for the newly created congruence is written at address pc.
int ppl_new_Congruence_from_Congruence (ppl_Congruence_t *pc, ppl_const_Congruence_t c)
 Builds a congruence that is a copy of c; writes a handle for the newly created congruence at address pc.
int ppl_assign_Congruence_from_Congruence (ppl_Congruence_t dst, ppl_const_Congruence_t src)
 Assigns a copy of the congruence src to dst.
int ppl_delete_Congruence (ppl_const_Congruence_t c)
 Invalidates the handle c: this makes sure the corresponding resources will eventually be released.
int ppl_Congruence_space_dimension (ppl_const_Congruence_t c, ppl_dimension_type *m)
 Writes to m the space dimension of c.
int ppl_Congruence_coefficient (ppl_const_Congruence_t c, ppl_dimension_type var, ppl_Coefficient_t n)
 Copies into n the coefficient of variable var in congruence c.
int ppl_Congruence_inhomogeneous_term (ppl_const_Congruence_t c, ppl_Coefficient_t n)
 Copies into n the inhomogeneous term of congruence c.
int ppl_Congruence_modulus (ppl_const_Congruence_t c, ppl_Coefficient_t m)
 Copies into m the modulus of congruence c.
int ppl_Congruence_OK (ppl_const_Congruence_t c)
 Returns a positive integer if c is well formed, i.e., if it satisfies all its implementation invariants; returns 0 and perhaps makes some noise if c is broken. Useful for debugging purposes.
int ppl_io_print_Congruence (ppl_const_Congruence_t x)
 Prints x to stdout.
int ppl_io_fprint_Congruence (FILE *stream, ppl_const_Congruence_t x)
 Prints x to the given output stream.
int ppl_io_asprint_Congruence (char **strp, ppl_const_Congruence_t x)
 Prints x to a malloc-allocated string, a pointer to which is returned via strp.
int ppl_Congruence_ascii_dump (ppl_const_Congruence_t x, FILE *stream)
 Dumps an ascii representation of x on stream.
int ppl_Congruence_ascii_load (ppl_Congruence_t x, FILE *stream)
 Loads an ascii representation of x from stream.

Detailed Description

Types and functions for congruences.

The types and functions for congruences provide an interface towards Congruence.

◆ ppl_new_Congruence()

int ppl_new_Congruence ( ppl_Congruence_t * pc,
ppl_const_Linear_Expression_t le,
ppl_const_Coefficient_t m )
related

Creates the new congruence $le = 0 \pmod{m}$ and writes a handle for it at address pc. The space dimension of the new congruence is equal to the space dimension of le.

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

◆ ppl_new_Congruence_zero_dim_false()

int ppl_new_Congruence_zero_dim_false ( ppl_Congruence_t * pc)
related

Creates the unsatisfiable (zero-dimension space) congruence $0 = 1 \pmod{0}$ and writes a handle for it at address pc.

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

◆ ppl_new_Congruence_zero_dim_integrality()

int ppl_new_Congruence_zero_dim_integrality ( ppl_Congruence_t * pc)
related

Creates the true (zero-dimension space) congruence $0 = 1 \pmod{1}$, also known as integrality congruence. A handle for the newly created congruence is written at address pc.

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

◆ ppl_new_Congruence_from_Congruence()

int ppl_new_Congruence_from_Congruence ( ppl_Congruence_t * pc,
ppl_const_Congruence_t c )
related

Builds a congruence that is a copy of c; writes a handle for the newly created congruence at address pc.

Parameters
pcReceives 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_assign_Congruence_from_Congruence()

int ppl_assign_Congruence_from_Congruence ( ppl_Congruence_t dst,
ppl_const_Congruence_t src )
related

Assigns a copy of the congruence src to dst.

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

◆ ppl_delete_Congruence()

int ppl_delete_Congruence ( ppl_const_Congruence_t c)
related

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

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

◆ ppl_Congruence_space_dimension()

int ppl_Congruence_space_dimension ( ppl_const_Congruence_t c,
ppl_dimension_type * m )
related

Writes to m the space dimension of c.

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

◆ ppl_Congruence_coefficient()

int ppl_Congruence_coefficient ( ppl_const_Congruence_t c,
ppl_dimension_type var,
ppl_Coefficient_t n )
related

Copies into n the coefficient of variable var in congruence c.

Parameters
cThe 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_Congruence_inhomogeneous_term()

int ppl_Congruence_inhomogeneous_term ( ppl_const_Congruence_t c,
ppl_Coefficient_t n )
related

Copies into n the inhomogeneous term of congruence c.

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

◆ ppl_Congruence_modulus()

int ppl_Congruence_modulus ( ppl_const_Congruence_t c,
ppl_Coefficient_t m )
related

Copies into m the modulus of congruence c.

Parameters
cThe borrowed handle to the input object.
mThe modulus defining the congruence.
Returns
Zero on success; a negative error code on failure.

◆ ppl_Congruence_OK()

int ppl_Congruence_OK ( ppl_const_Congruence_t c)
related

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

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

◆ ppl_io_print_Congruence()

int ppl_io_print_Congruence ( ppl_const_Congruence_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_Congruence()

int ppl_io_fprint_Congruence ( FILE * stream,
ppl_const_Congruence_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_Congruence()

int ppl_io_asprint_Congruence ( char ** strp,
ppl_const_Congruence_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_Congruence_ascii_dump()

int ppl_Congruence_ascii_dump ( ppl_const_Congruence_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_Congruence_ascii_load()

int ppl_Congruence_ascii_load ( ppl_Congruence_t x,
FILE * stream )
related

Loads an ascii representation of x from stream.

Parameters
xThe congruence 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: