PPL C Language Interface 2.0
ppl_Coefficient_tag Interface Reference

Types and functions for coefficients. More...

#include <ppl_c_header.h>

(Note that these are not member symbols.)

int ppl_new_Coefficient (ppl_Coefficient_t *pc)
 Creates a new coefficient with value 0 and writes a handle for the newly created coefficient at address pc.
int ppl_new_Coefficient_from_mpz_t (ppl_Coefficient_t *pc, mpz_t z)
 Creates a new coefficient with the value given by the GMP integer z and writes a handle for the newly created coefficient at address pc.
int ppl_new_Coefficient_from_Coefficient (ppl_Coefficient_t *pc, ppl_const_Coefficient_t c)
 Builds a coefficient that is a copy of c; writes a handle for the newly created coefficient at address pc.
int ppl_assign_Coefficient_from_mpz_t (ppl_Coefficient_t dst, mpz_t z)
 Assign to dst the value given by the GMP integer z.
int ppl_assign_Coefficient_from_Coefficient (ppl_Coefficient_t dst, ppl_const_Coefficient_t src)
 Assigns a copy of the coefficient src to dst.
int ppl_delete_Coefficient (ppl_const_Coefficient_t c)
 Invalidates the handle c: this makes sure the corresponding resources will eventually be released.
int ppl_Coefficient_to_mpz_t (ppl_const_Coefficient_t c, mpz_t z)
 Sets the value of the GMP integer z to the value of c.
int ppl_Coefficient_OK (ppl_const_Coefficient_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_Coefficient_is_bounded (void)
 Returns a positive integer if coefficients are bounded; returns 0 otherwise.
int ppl_Coefficient_min (mpz_t min)
 Returns a positive integer if coefficients are bounded, in which case min is set to their minimum value; returns 0 otherwise.
int ppl_Coefficient_max (mpz_t max)
 Returns a positive integer if coefficients are bounded, in which case max is set to their maximum value; returns 0 otherwise.
int ppl_io_print_Coefficient (ppl_const_Coefficient_t x)
 Prints x to stdout.
int ppl_io_fprint_Coefficient (FILE *stream, ppl_const_Coefficient_t x)
 Prints x to the given output stream.
int ppl_io_asprint_Coefficient (char **strp, ppl_const_Coefficient_t x)
 Prints x to a malloc-allocated string, a pointer to which is returned via strp.

Detailed Description

Types and functions for coefficients.

The types and functions for coefficients provide an interface towards Coefficient. Depending on configuration, the PPL coefficients may be implemented by the unbounded precision integers provided by GMP (default), or by bounded precision integers (with checks for overflows).

◆ ppl_new_Coefficient()

int ppl_new_Coefficient ( ppl_Coefficient_t * pc)
related

Creates a new coefficient with value 0 and writes a handle for the newly created coefficient 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_Coefficient_from_mpz_t()

int ppl_new_Coefficient_from_mpz_t ( ppl_Coefficient_t * pc,
mpz_t z )
related

Creates a new coefficient with the value given by the GMP integer z and writes a handle for the newly created coefficient at address pc.

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

◆ ppl_new_Coefficient_from_Coefficient()

int ppl_new_Coefficient_from_Coefficient ( ppl_Coefficient_t * pc,
ppl_const_Coefficient_t c )
related

Builds a coefficient that is a copy of c; writes a handle for the newly created coefficient 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_Coefficient_from_mpz_t()

int ppl_assign_Coefficient_from_mpz_t ( ppl_Coefficient_t dst,
mpz_t z )
related

Assign to dst the value given by the GMP integer z.

Parameters
dstThe destination object handle.
zThe third input value.
Returns
Zero on success; a negative error code on failure.

◆ ppl_assign_Coefficient_from_Coefficient()

int ppl_assign_Coefficient_from_Coefficient ( ppl_Coefficient_t dst,
ppl_const_Coefficient_t src )
related

Assigns a copy of the coefficient src to dst.

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

◆ ppl_delete_Coefficient()

int ppl_delete_Coefficient ( ppl_const_Coefficient_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_Coefficient_to_mpz_t()

int ppl_Coefficient_to_mpz_t ( ppl_const_Coefficient_t c,
mpz_t z )
related

Sets the value of the GMP integer z to the value of c.

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

◆ ppl_Coefficient_OK()

int ppl_Coefficient_OK ( ppl_const_Coefficient_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_Coefficient_is_bounded()

int ppl_Coefficient_is_bounded ( void )
related

Returns a positive integer if coefficients are bounded; returns 0 otherwise.

Returns
A positive integer if coefficients are bounded; returns 0 otherwise.

◆ ppl_Coefficient_min()

int ppl_Coefficient_min ( mpz_t min)
related

Returns a positive integer if coefficients are bounded, in which case min is set to their minimum value; returns 0 otherwise.

Parameters
minReceives the minimum admitted coefficient value.
Returns
A positive integer if coefficients are bounded, in which case min is set to their minimum value; returns 0 otherwise.

◆ ppl_Coefficient_max()

int ppl_Coefficient_max ( mpz_t max)
related

Returns a positive integer if coefficients are bounded, in which case max is set to their maximum value; returns 0 otherwise.

Parameters
maxReceives the maximum admitted coefficient value.
Returns
A positive integer if coefficients are bounded, in which case max is set to their maximum value; returns 0 otherwise.

◆ ppl_io_print_Coefficient()

int ppl_io_print_Coefficient ( ppl_const_Coefficient_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_Coefficient()

int ppl_io_fprint_Coefficient ( FILE * stream,
ppl_const_Coefficient_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_Coefficient()

int ppl_io_asprint_Coefficient ( char ** strp,
ppl_const_Coefficient_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.

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