PPL
1.2
|
A tree node representing part of the space of solutions. More...
#include <ppl.hh>
Classes | |
struct | No_Constraints |
A tag type to select the alternative copy constructor. More... | |
Public Member Functions | |
PIP_Solution_Node (const PIP_Problem *owner) | |
Constructor: builds a solution node owned by *owner . | |
virtual PIP_Tree_Node * | clone () const |
Returns a pointer to a dynamically-allocated copy of *this . | |
virtual | ~PIP_Solution_Node () |
Destructor. | |
virtual bool | OK () const |
Returns true if and only if *this is well formed. | |
virtual const PIP_Solution_Node * | as_solution () const |
Returns this . | |
virtual const PIP_Decision_Node * | as_decision () const |
Returns 0, since this is not a decision node. | |
const Linear_Expression & | parametric_values (Variable var) const |
Returns a parametric expression for the values of problem variable var . More... | |
void | ascii_dump (std::ostream &os) const |
Dumps to os an ASCII representation of *this . | |
bool | ascii_load (std::istream &is) |
Loads from is an ASCII representation (as produced by ascii_dump(std::ostream&) const) and sets *this accordingly. Returns true if successful, false otherwise. | |
virtual memory_size_type | total_memory_in_bytes () const |
Returns the total size in bytes of the memory occupied by *this . | |
virtual memory_size_type | external_memory_in_bytes () const |
Returns the size in bytes of the memory managed by *this . | |
![]() | |
virtual | ~PIP_Tree_Node () |
Destructor. | |
const Constraint_System & | constraints () const |
Returns the system of parameter constraints controlling *this . More... | |
Artificial_Parameter_Sequence::const_iterator | art_parameter_begin () const |
Returns a const_iterator to the beginning of local artificial parameters. | |
Artificial_Parameter_Sequence::const_iterator | art_parameter_end () const |
Returns a const_iterator to the end of local artificial parameters. | |
dimension_type | art_parameter_count () const |
Returns the number of local artificial parameters. | |
void | print (std::ostream &s, int indent=0) const |
Prints on s the tree rooted in *this . More... | |
void | ascii_dump (std::ostream &s) const |
Dumps to s an ASCII representation of *this . | |
bool | ascii_load (std::istream &s) |
Loads from s an ASCII representation (as produced by ascii_dump(std::ostream&) const) and sets *this accordingly. Returns true if successful, false otherwise. | |
Protected Member Functions | |
PIP_Solution_Node (const PIP_Solution_Node &y) | |
Copy constructor. | |
PIP_Solution_Node (const PIP_Solution_Node &y, No_Constraints) | |
Alternative copy constructor. More... | |
virtual void | set_owner (const PIP_Problem *owner) |
Sets the pointer to the PIP_Problem owning object. | |
virtual bool | check_ownership (const PIP_Problem *owner) const |
Returns true if and only if all the nodes in the subtree rooted in *this is owned by *pip . | |
virtual void | update_tableau (const PIP_Problem &pip, dimension_type external_space_dim, dimension_type first_pending_constraint, const Constraint_Sequence &input_cs, const Variables_Set ¶meters) |
Implements pure virtual method PIP_Tree_Node::update_tableau. | |
void | update_solution (const std::vector< bool > &pip_dim_is_param) const |
Update the solution values. More... | |
void | update_solution () const |
Helper method. | |
virtual PIP_Tree_Node * | solve (const PIP_Problem &pip, bool check_feasible_context, const Matrix< Row > &context, const Variables_Set ¶ms, dimension_type space_dim, int indent_level) |
Implements pure virtual method PIP_Tree_Node::solve. | |
void | generate_cut (dimension_type index, Variables_Set ¶meters, Matrix< Row > &context, dimension_type &space_dimension, int indent_level) |
Generate a Gomory cut using non-integer tableau row index . More... | |
virtual void | print_tree (std::ostream &s, int indent, const std::vector< bool > &pip_dim_is_param, dimension_type first_art_dim) const |
Prints on s the tree rooted in *this . | |
![]() | |
PIP_Tree_Node (const PIP_Problem *owner) | |
Constructor: builds a node owned by *owner . | |
PIP_Tree_Node (const PIP_Tree_Node &y) | |
Copy constructor. | |
const PIP_Problem * | get_owner () const |
Returns a pointer to the PIP_Problem owning object. | |
const PIP_Decision_Node * | parent () const |
Returns a pointer to this node's parent. | |
void | set_parent (const PIP_Decision_Node *p) |
Set this node's parent to *p . | |
void | add_constraint (const Row &row, const Variables_Set ¶meters) |
Inserts a new parametric constraint in internal row format. | |
void | parent_merge () |
Merges parent's artificial parameters into *this . | |
Additional Inherited Members | |
![]() | |
typedef std::vector< Artificial_Parameter > | Artificial_Parameter_Sequence |
A type alias for a sequence of Artificial_Parameter's. | |
![]() | |
typedef std::vector< Constraint > | Constraint_Sequence |
A type alias for a sequence of constraints. | |
![]() | |
static void | indent_and_print (std::ostream &s, int indent, const char *str) |
A helper function used when printing PIP trees. | |
static bool | compatibility_check (Matrix< Row > &s) |
Checks whether a context matrix is satisfiable. More... | |
static bool | compatibility_check (const Matrix< Row > &context, const Row &row) |
Helper method: checks for satisfiability of the restricted context obtained by adding row to context . | |
![]() | |
const PIP_Problem * | owner_ |
A pointer to the PIP_Problem object owning this node. | |
const PIP_Decision_Node * | parent_ |
A pointer to the parent of *this , null if *this is the root. | |
Constraint_System | constraints_ |
The local system of parameter constraints. | |
Artificial_Parameter_Sequence | artificial_parameters |
The local sequence of expressions for local artificial parameters. | |
![]() | |
std::ostream & | operator<< (std::ostream &os, const PIP_Tree_Node &x) |
Output operator: prints the solution tree rooted in x . More... | |
A tree node representing part of the space of solutions.
|
protected |
Alternative copy constructor.
This constructor differs from the default copy constructor in that it will not copy the constraint system, nor the artificial parameters.
const Linear_Expression& Parma_Polyhedra_Library::PIP_Solution_Node::parametric_values | ( | Variable | var | ) | const |
Returns a parametric expression for the values of problem variable var
.
The returned linear expression may involve problem parameters as well as artificial parameters.
var | The problem variable which is queried about. |
std::invalid_argument | Thrown if var is dimension-incompatible with the PIP_Problem owning this solution node, or if var is a problem parameter. |
|
protected |
Update the solution values.
pip_dim_is_param | A vector of Boolean flags telling which PIP problem dimensions are problem parameters. The size of the vector is equal to the PIP problem internal space dimension (i.e., no artificial parameters). |
|
protected |
Generate a Gomory cut using non-integer tableau row index
.
index | Row index in simplex tableau from which the cut is generated. |
parameters | A std::set of the current parameter dimensions (including artificials); to be updated if a new artificial parameter is to be created. |
context | A set of linear inequalities on the parameters, in matrix form; to be updated if a new artificial parameter is to be created. |
space_dimension | The current space dimension, including variables and all parameters; to be updated if an extra parameter is to be created. |
indent_level | The indentation level (for debugging output only). |