PPL C Language Interface 2.0
ppl_PIP_Problem_tag Interface Reference

Types and functions for PIP problems. More...

#include <ppl_c_header.h>

(Note that these are not member symbols.)

int PPL_PIP_PROBLEM_STATUS_UNFEASIBLE
 Code of the "unfeasible PIP problem" status.
int PPL_PIP_PROBLEM_STATUS_OPTIMIZED
 Code of the "optimized PIP problem" status.
int PPL_PIP_PROBLEM_CONTROL_PARAMETER_NAME_CUTTING_STRATEGY
 Code for the PIP problem's "cutting strategy" control parameter name.
int PPL_PIP_PROBLEM_CONTROL_PARAMETER_NAME_PIVOT_ROW_STRATEGY
 Code for the PIP problem's "pivot row strategy" control parameter name.
int PPL_PIP_PROBLEM_CONTROL_PARAMETER_CUTTING_STRATEGY_FIRST
 Code of PIP problem's "first" cutting strategy.
int PPL_PIP_PROBLEM_CONTROL_PARAMETER_CUTTING_STRATEGY_DEEPEST
 Code of PIP problem's "deepest" cutting strategy.
int PPL_PIP_PROBLEM_CONTROL_PARAMETER_CUTTING_STRATEGY_ALL
 Code of PIP problem's "all" cutting strategy.
int PPL_PIP_PROBLEM_CONTROL_PARAMETER_PIVOT_ROW_STRATEGY_FIRST
 Code of PIP problem's "first" pivot row strategy.
int PPL_PIP_PROBLEM_CONTROL_PARAMETER_PIVOT_ROW_STRATEGY_MAX_COLUMN
 Code of PIP problem's "max column" pivot row strategy.
int ppl_new_PIP_Problem_from_space_dimension (ppl_PIP_Problem_t *ppip, ppl_dimension_type d)
 Builds a trivial PIP problem of dimension d and writes a handle to it at address ppip.
int ppl_new_PIP_Problem_from_PIP_Problem (ppl_PIP_Problem_t *ppip, ppl_const_PIP_Problem_t pip)
 Builds a PIP problem that is a copy of pip; writes a handle for the newly created problem at address ppip.
int ppl_assign_PIP_Problem_from_PIP_Problem (ppl_PIP_Problem_t dst, ppl_const_PIP_Problem_t src)
 Assigns a copy of the PIP problem src to dst.
int ppl_new_PIP_Problem_from_constraints (ppl_PIP_Problem_t *ppip, ppl_dimension_type d, ppl_Constraint_System_const_iterator_t first, ppl_Constraint_System_const_iterator_t last, size_t n, ppl_dimension_type ds[])
 Builds a PIP problem having space dimension d from the sequence of constraints in the range $[\mathrm{first}, \mathrm{last})$; the n dimensions whose indices occur in ds are interpreted as parameters.
int ppl_delete_PIP_Problem (ppl_const_PIP_Problem_t pip)
 Invalidates the handle pip: this makes sure the corresponding resources will eventually be released.
int ppl_PIP_Problem_space_dimension (ppl_const_PIP_Problem_t pip, ppl_dimension_type *m)
 Writes to m the dimension of the vector space enclosing pip.
int ppl_PIP_Problem_number_of_parameter_space_dimensions (ppl_const_PIP_Problem_t pip, ppl_dimension_type *m)
 Writes to m the number of parameter space dimensions of pip.
int ppl_PIP_Problem_parameter_space_dimensions (ppl_const_PIP_Problem_t pip, ppl_dimension_type ds[])
 Writes in the first positions of the array ds all the parameter space dimensions of problem pip. If the array is not big enough to hold all of the parameter space dimensions, the behavior is undefined.
int ppl_PIP_Problem_get_big_parameter_dimension (ppl_const_PIP_Problem_t pip, ppl_dimension_type *pd)
 Writes into *pd the big parameter dimension of PIP problem pip.
int ppl_PIP_Problem_number_of_constraints (ppl_const_PIP_Problem_t pip, ppl_dimension_type *m)
 Writes to m the number of constraints defining the feasible region of pip.
int ppl_PIP_Problem_constraint_at_index (ppl_const_PIP_Problem_t pip, ppl_dimension_type i, ppl_const_Constraint_t *pc)
 Writes at address pc a const handle to the i-th constraint defining the feasible region of the PIP problem pip.
int ppl_PIP_Problem_total_memory_in_bytes (ppl_const_PIP_Problem_t pip, size_t *sz)
 Writes into *sz the size in bytes of the memory occupied by pip.
int ppl_PIP_Problem_external_memory_in_bytes (ppl_const_PIP_Problem_t pip, size_t *sz)
 Writes into *sz the size in bytes of the memory managed by pip.
int ppl_PIP_Problem_OK (ppl_const_PIP_Problem_t pip)
 Returns a positive integer if pip is well formed, i.e., if it satisfies all its implementation invariants; returns 0 and perhaps makes some noise if pip is broken. Useful for debugging purposes.
int ppl_PIP_Problem_clear (ppl_PIP_Problem_t pip)
 Resets the PIP problem to be a trivial problem of space dimension 0.
int ppl_PIP_Problem_add_space_dimensions_and_embed (ppl_PIP_Problem_t pip, ppl_dimension_type pip_vars, ppl_dimension_type pip_params)
 Adds pip_vars + pip_params new space dimensions and embeds the PIP problem pip in the new vector space.
int ppl_PIP_Problem_add_to_parameter_space_dimensions (ppl_PIP_Problem_t pip, ppl_dimension_type ds[], size_t n)
 Sets the space dimensions that are specified in first n positions of the array ds to be parameter dimensions of problem pip. The presence of duplicates in ds is a waste but an innocuous one.
int ppl_PIP_Problem_set_big_parameter_dimension (ppl_PIP_Problem_t pip, ppl_dimension_type d)
 Sets the big parameter dimension of PIP problem pip to d.
int ppl_PIP_Problem_add_constraint (ppl_PIP_Problem_t pip, ppl_const_Constraint_t c)
 Modifies the feasible region of the PIP problem pip by adding a copy of the constraint c.
int ppl_PIP_Problem_add_constraints (ppl_PIP_Problem_t pip, ppl_const_Constraint_System_t cs)
 Modifies the feasible region of the PIP problem pip by adding a copy of the constraints in cs.
int ppl_PIP_Problem_is_satisfiable (ppl_const_PIP_Problem_t pip)
 Tests feasibility in the selected mode, including any big-parameter sign assumptions.
int ppl_PIP_Problem_solve (ppl_const_PIP_Problem_t pip)
 Solves the PIP problem pip in the selected mode.
int ppl_PIP_Problem_solution (ppl_const_PIP_Problem_t pip, ppl_const_PIP_Tree_Node_t *pip_tree)
 Writes to pip_tree a solution for pip, if it exists.
int ppl_PIP_Problem_optimizing_solution (ppl_const_PIP_Problem_t pip, ppl_const_PIP_Tree_Node_t *pip_tree)
 Writes to pip_tree an optimizing solution for pip, if it exists.
int ppl_PIP_Problem_get_control_parameter (ppl_const_PIP_Problem_t pip, int name)
 Returns the value of control parameter name in problem pip.
int ppl_PIP_Problem_set_control_parameter (ppl_PIP_Problem_t pip, int value)
 Sets control parameter value in problem pip.
int ppl_io_print_PIP_Problem (ppl_const_PIP_Problem_t x)
 Prints x to stdout.
int ppl_io_fprint_PIP_Problem (FILE *stream, ppl_const_PIP_Problem_t x)
 Prints x to the given output stream.
int ppl_io_asprint_PIP_Problem (char **strp, ppl_const_PIP_Problem_t x)
 Prints x to a malloc-allocated string, a pointer to which is returned via strp.
int ppl_PIP_Problem_ascii_dump (ppl_const_PIP_Problem_t x, FILE *stream)
 Dumps an ascii representation of x on stream.
int ppl_PIP_Problem_ascii_load (ppl_PIP_Problem_t x, FILE *stream)
 Loads an ascii representation of x from stream.

Detailed Description

Types and functions for PIP problems.

The types and functions for PIP problems provide an interface towards PIP_Problem.

◆ ppl_new_PIP_Problem_from_space_dimension()

int ppl_new_PIP_Problem_from_space_dimension ( ppl_PIP_Problem_t * ppip,
ppl_dimension_type d )
related

Builds a trivial PIP problem of dimension d and writes a handle to it at address ppip.

Parameters
ppipReceives 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_PIP_Problem_from_PIP_Problem()

int ppl_new_PIP_Problem_from_PIP_Problem ( ppl_PIP_Problem_t * ppip,
ppl_const_PIP_Problem_t pip )
related

Builds a PIP problem that is a copy of pip; writes a handle for the newly created problem at address ppip.

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

◆ ppl_assign_PIP_Problem_from_PIP_Problem()

int ppl_assign_PIP_Problem_from_PIP_Problem ( ppl_PIP_Problem_t dst,
ppl_const_PIP_Problem_t src )
related

Assigns a copy of the PIP problem src to dst.

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

◆ ppl_new_PIP_Problem_from_constraints()

int ppl_new_PIP_Problem_from_constraints ( ppl_PIP_Problem_t * ppip,
ppl_dimension_type d,
ppl_Constraint_System_const_iterator_t first,
ppl_Constraint_System_const_iterator_t last,
size_t n,
ppl_dimension_type ds[] )
related

Builds a PIP problem having space dimension d from the sequence of constraints in the range $[\mathrm{first}, \mathrm{last})$; the n dimensions whose indices occur in ds are interpreted as parameters.

Parameters
ppipReceives the newly allocated object handle; release it with the matching deletion function.
dThe requested space dimension.
firstThe iterator at the beginning of the input range.
lastThe past-the-end iterator of the input range.
nThe number of elements or space dimensions selected by the operation.
dsThe array of selected space-dimension indices.
Returns
Zero on success; a negative error code on failure.

◆ ppl_delete_PIP_Problem()

int ppl_delete_PIP_Problem ( ppl_const_PIP_Problem_t pip)
related

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

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

◆ ppl_PIP_Problem_space_dimension()

int ppl_PIP_Problem_space_dimension ( ppl_const_PIP_Problem_t pip,
ppl_dimension_type * m )
related

Writes to m the dimension of the vector space enclosing pip.

The vector space dimensions includes both the problem variables and the problem parameters, but they do not include the artificial parameters.

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

◆ ppl_PIP_Problem_number_of_parameter_space_dimensions()

int ppl_PIP_Problem_number_of_parameter_space_dimensions ( ppl_const_PIP_Problem_t pip,
ppl_dimension_type * m )
related

Writes to m the number of parameter space dimensions of pip.

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

◆ ppl_PIP_Problem_parameter_space_dimensions()

int ppl_PIP_Problem_parameter_space_dimensions ( ppl_const_PIP_Problem_t pip,
ppl_dimension_type ds[] )
related

Writes in the first positions of the array ds all the parameter space dimensions of problem pip. If the array is not big enough to hold all of the parameter space dimensions, the behavior is undefined.

Parameters
pipThe borrowed handle to the input object.
dsThe array of selected space-dimension indices.
Returns
Zero on success; a negative error code on failure.

◆ ppl_PIP_Problem_get_big_parameter_dimension()

int ppl_PIP_Problem_get_big_parameter_dimension ( ppl_const_PIP_Problem_t pip,
ppl_dimension_type * pd )
related

Writes into *pd the big parameter dimension of PIP problem pip.

Parameters
pipThe borrowed handle to the input object.
pdReceives the requested value or borrowed object handle.
Returns
Zero on success; a negative error code on failure.

◆ ppl_PIP_Problem_number_of_constraints()

int ppl_PIP_Problem_number_of_constraints ( ppl_const_PIP_Problem_t pip,
ppl_dimension_type * m )
related

Writes to m the number of constraints defining the feasible region of pip.

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

◆ ppl_PIP_Problem_constraint_at_index()

int ppl_PIP_Problem_constraint_at_index ( ppl_const_PIP_Problem_t pip,
ppl_dimension_type i,
ppl_const_Constraint_t * pc )
related

Writes at address pc a const handle to the i-th constraint defining the feasible region of the PIP problem pip.

The index must be smaller than the number of constraints in pip. The non-null result is borrowed from pip and must not be modified or deleted; see Borrowed PIP Problem Data and Solution Trees for invalidation rules. On failure, *pc is unchanged.

Parameters
pipThe borrowed handle to the input object.
iThe index of the selected element or space dimension.
pcThe borrowed handle to the input object.
Returns
Zero on success; a negative error code on failure.

◆ ppl_PIP_Problem_total_memory_in_bytes()

int ppl_PIP_Problem_total_memory_in_bytes ( ppl_const_PIP_Problem_t pip,
size_t * sz )
related

Writes into *sz the size in bytes of the memory occupied by pip.

Parameters
pipThe borrowed handle to the input object.
szReceives the value computed by the operation.
Returns
Zero on success; a negative error code on failure.

◆ ppl_PIP_Problem_external_memory_in_bytes()

int ppl_PIP_Problem_external_memory_in_bytes ( ppl_const_PIP_Problem_t pip,
size_t * sz )
related

Writes into *sz the size in bytes of the memory managed by pip.

Parameters
pipThe borrowed handle to the input object.
szReceives the value computed by the operation.
Returns
Zero on success; a negative error code on failure.

◆ ppl_PIP_Problem_OK()

int ppl_PIP_Problem_OK ( ppl_const_PIP_Problem_t pip)
related

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

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

◆ ppl_PIP_Problem_clear()

int ppl_PIP_Problem_clear ( ppl_PIP_Problem_t pip)
related

Resets the PIP problem to be a trivial problem of space dimension 0.

Parameters
pipThe parametric integer programming problem owning the state.
Returns
Zero on success; a negative error code on failure.

◆ ppl_PIP_Problem_add_space_dimensions_and_embed()

int ppl_PIP_Problem_add_space_dimensions_and_embed ( ppl_PIP_Problem_t pip,
ppl_dimension_type pip_vars,
ppl_dimension_type pip_params )
related

Adds pip_vars + pip_params new space dimensions and embeds the PIP problem pip in the new vector space.

Parameters
pipThe PIP problem to be embedded in the new vector space.
pip_varsThe number of space dimensions to add that are interpreted as PIP problem variables (i.e., non parameters). These are added before adding the pip_params parameters.
pip_paramsThe number of space dimensions to add that are interpreted as PIP problem parameters. These are added after having added the pip_vars problem variables.

The new space dimensions will be those having the highest indexes in the new PIP problem; they are initially unconstrained.

Returns
Zero on success; a negative error code on failure.

◆ ppl_PIP_Problem_add_to_parameter_space_dimensions()

int ppl_PIP_Problem_add_to_parameter_space_dimensions ( ppl_PIP_Problem_t pip,
ppl_dimension_type ds[],
size_t n )
related

Sets the space dimensions that are specified in first n positions of the array ds to be parameter dimensions of problem pip. The presence of duplicates in ds is a waste but an innocuous one.

Parameters
pipThe parametric integer programming problem owning the state.
dsThe array of selected space-dimension indices.
nThe number of elements or space dimensions selected by the operation.
Returns
Zero on success; a negative error code on failure.

◆ ppl_PIP_Problem_set_big_parameter_dimension()

int ppl_PIP_Problem_set_big_parameter_dimension ( ppl_PIP_Problem_t pip,
ppl_dimension_type d )
related

Sets the big parameter dimension of PIP problem pip to d.

The native solver treats this parameter as arbitrarily large. A finite substitution into a returned tree must satisfy the initial context and the sign assumptions made using the big parameter. An infeasible status under those assumptions can coexist with a feasible finite substitution outside them.

Parameters
pipThe parametric integer programming problem owning the state.
dThe requested space dimension.
Returns
Zero on success; a negative error code on failure.

◆ ppl_PIP_Problem_add_constraint()

int ppl_PIP_Problem_add_constraint ( ppl_PIP_Problem_t pip,
ppl_const_Constraint_t c )
related

Modifies the feasible region of the PIP problem pip by adding a copy of the constraint c.

Parameters
pipThe parametric integer programming problem owning the state.
cThe borrowed handle to the input object.
Returns
Zero on success; a negative error code on failure.

◆ ppl_PIP_Problem_add_constraints()

int ppl_PIP_Problem_add_constraints ( ppl_PIP_Problem_t pip,
ppl_const_Constraint_System_t cs )
related

Modifies the feasible region of the PIP problem pip by adding a copy of the constraints in cs.

Parameters
pipThe parametric integer programming problem owning the state.
csThe borrowed handle to the input object.
Returns
Zero on success; a negative error code on failure.

◆ ppl_PIP_Problem_is_satisfiable()

int ppl_PIP_Problem_is_satisfiable ( ppl_const_PIP_Problem_t pip)
related

Tests feasibility in the selected mode, including any big-parameter sign assumptions.

Parameters
pipThe borrowed handle to the input object.
Returns
A positive integer for the optimized status, zero for the infeasible status, or a negative error code on failure.

◆ ppl_PIP_Problem_solve()

int ppl_PIP_Problem_solve ( ppl_const_PIP_Problem_t pip)
related

Solves the PIP problem pip in the selected mode.

Returns
PPL_PIP_PROBLEM_STATUS_UNFEASIBLE for infeasibility in the selected mode, PPL_PIP_PROBLEM_STATUS_OPTIMIZED when the solver produces an optimal solution tree, or a negative error code on failure.
Parameters
pipThe borrowed handle to the input object.

◆ ppl_PIP_Problem_solution()

int ppl_PIP_Problem_solution ( ppl_const_PIP_Problem_t pip,
ppl_const_PIP_Tree_Node_t * pip_tree )
related

Writes to pip_tree a solution for pip, if it exists.

Writes a null handle for the infeasible status in the selected mode. A non-null result is borrowed from pip. Neither it nor any part of its tree may be modified or deleted. Traversal is permitted while the tree remains valid; see Borrowed PIP Problem Data and Solution Trees for invalidation rules. On failure, *pip_tree is unchanged.

Parameters
pipThe borrowed handle to the input object.
pip_treeWritable address for the borrowed solution-tree handle.
Returns
Zero on success; a negative error code on failure.

◆ ppl_PIP_Problem_optimizing_solution()

int ppl_PIP_Problem_optimizing_solution ( ppl_const_PIP_Problem_t pip,
ppl_const_PIP_Tree_Node_t * pip_tree )
related

Writes to pip_tree an optimizing solution for pip, if it exists.

Writes a null handle for the infeasible status in the selected mode. A non-null result is borrowed from pip. Neither it nor any part of its tree may be modified or deleted. Traversal is permitted while the tree remains valid; see Borrowed PIP Problem Data and Solution Trees for invalidation rules. On failure, *pip_tree is unchanged.

Parameters
pipThe borrowed handle to the input object.
pip_treeWritable address for the borrowed solution-tree handle.
Returns
Zero on success; a negative error code on failure.

◆ ppl_PIP_Problem_get_control_parameter()

int ppl_PIP_Problem_get_control_parameter ( ppl_const_PIP_Problem_t pip,
int name )
related

Returns the value of control parameter name in problem pip.

Parameters
pipThe borrowed handle to the input object.
nameThe name used in the diagnostic or textual representation.
Returns
The value of control parameter name in problem pip.

◆ ppl_PIP_Problem_set_control_parameter()

int ppl_PIP_Problem_set_control_parameter ( ppl_PIP_Problem_t pip,
int value )
related

Sets control parameter value in problem pip.

Parameters
pipThe parametric integer programming problem owning the state.
valueThe value to assign or inspect.
Returns
Zero on success; a negative error code on failure.

◆ ppl_io_print_PIP_Problem()

int ppl_io_print_PIP_Problem ( ppl_const_PIP_Problem_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_PIP_Problem()

int ppl_io_fprint_PIP_Problem ( FILE * stream,
ppl_const_PIP_Problem_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_PIP_Problem()

int ppl_io_asprint_PIP_Problem ( char ** strp,
ppl_const_PIP_Problem_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_PIP_Problem_ascii_dump()

int ppl_PIP_Problem_ascii_dump ( ppl_const_PIP_Problem_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_PIP_Problem_ascii_load()

int ppl_PIP_Problem_ascii_load ( ppl_PIP_Problem_t x,
FILE * stream )
related

Loads an ascii representation of x from stream.

Parameters
xThe parametric integer programming problem 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: