BCP_solution_generic Class Reference

This class holds a MIP feasible primal solution. More...

#include <BCP_solution.hpp>

Inheritance diagram for BCP_solution_generic:
Inheritance graph
[legend]
Collaboration diagram for BCP_solution_generic:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 BCP_solution_generic (bool delvars=true)
 The default constructor creates a solution with zero objective value.
virtual ~BCP_solution_generic ()
 The destructor deletes the data members.
virtual double objective_value () const
 Return the objective value of the solution.
void display () const
 Display the solution.
void add_entry (BCP_var *var, double value)
 Append a variable and the corresponding value to the end of the appropriate vectors.

Public Attributes

Data members



double _objective
 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< BCP_var * > _vars
 Vector of variables that are at nonzero level in the solution.
BCP_vec< double > _values
 Values of these variables in the solution.

Detailed Description

This class holds a MIP feasible primal solution.

The default BCP_lp_user::pack_feasible_solution() uses this class to pack an MIP feasible solution, but the user can use this class (instead of using BCP_solution as a base class to derive a different solution holder. (This might be necessary if, for example, the dual values are of importance as well.) The virtual destructor and virtual member functions make this easy.

Definition at line 33 of file BCP_solution.hpp.


Constructor & Destructor Documentation

BCP_solution_generic::BCP_solution_generic ( bool  delvars = true  )  [inline]

The default constructor creates a solution with zero objective value.

Definition at line 50 of file BCP_solution.hpp.

virtual BCP_solution_generic::~BCP_solution_generic (  )  [inline, virtual]

The destructor deletes the data members.

Note that it purges _vars (i.e., deletes the variables the pointers in _vars point to) only if the _delete_vars member is true.

Definition at line 55 of file BCP_solution.hpp.


Member Function Documentation

virtual double BCP_solution_generic::objective_value (  )  const [inline, virtual]

Return the objective value of the solution.

Implements BCP_solution.

Definition at line 61 of file BCP_solution.hpp.

void BCP_solution_generic::display (  )  const

Display the solution.

void BCP_solution_generic::add_entry ( BCP_var var,
double  value 
) [inline]

Append a variable and the corresponding value to the end of the appropriate vectors.

This method is used when unpacking the solution.

Definition at line 68 of file BCP_solution.hpp.


Member Data Documentation

The objective value of the solution.

Definition at line 38 of file BCP_solution.hpp.

An indicator to show whether the pointers in _vars should be deleted upon destruction or not.

By default they are not.

Definition at line 41 of file BCP_solution.hpp.

Vector of variables that are at nonzero level in the solution.

Definition at line 43 of file BCP_solution.hpp.

Values of these variables in the solution.

Definition at line 45 of file BCP_solution.hpp.


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

Generated on 15 Mar 2015 for Coin-All by  doxygen 1.6.1