void purge_ptr_vector(BCP_vec< T * > &pvec, typename BCP_vec< T * >::iterator first, typename BCP_vec< T * >::iterator last)
This function purges the entries [first,last) from the vector of pointers pvec.
This class holds a MIP feasible primal solution.
virtual ~BCP_solution_generic()
The destructor deletes the data members.
BCP_vec< BCP_var * > _vars
Vector of variables that are at nonzero level in the solution.
virtual double objective_value() const
Return the objective value of the solution.
BCP_solution_generic(bool delvars=true)
The default constructor creates a solution with zero objective value.
void add_entry(BCP_var *var, double value)
Append a variable and the corresponding value to the end of the appropriate vectors.
void display() const
Display the solution.
void set_objective_value(double v)
Set the objective value of the solution.
bool _delete_vars
An indicator to show whether the pointers in _vars should be deleted upon destruction or not.
BCP_vec< double > _values
Values of these variables in the solution.
double _objective
The objective value of the solution.
This is the abstract base class for a solution to a Mixed Integer Programming problem.
virtual ~BCP_solution()
The virtual destructor ensures that the correct destructor is invoked.
virtual double objective_value() const =0
The method returning the objective value of the solution.
Abstract base class that defines members common to all types of variables.
double obj() const
Return the objective coefficient.
The class BCP_vec serves the same purpose as the vector class in the standard template library.
void push_back(const_reference x)
Append x to the end of the vector.