37 using namespace Bonmin;
46 argv[1] = strdup(
"dont_even_try_to_open_it.nl");
65 double cutOffDecrement =
74 printf(
" The integrality tolerance parameters are different for\n");
75 printf(
" BCP (%f) and bonmin (%f). They should be identical.\n",
77 printf(
" For now both will be set to that of bonmin.\n");
79 if (fabs(bcp_cutoffIncr - cutOffDecrement) > 1
e-10) {
81 printf(
" The granularity (cutoff increment) parameters are different\n");
82 printf(
" BCP (%f) and bonmin (%f). They should be identical.\n",
83 bcp_cutoffIncr, cutOffDecrement);
84 printf(
" For now both will be set to that of bonmin.\n");
107 const int numCols = nlp.getNumCols();
108 const double* clb = nlp.getColLower();
109 const double* cub = nlp.getColUpper();
110 const int* cPrio = nlp.getPriorities();
114 OsiObject** osiObj =
new OsiObject*[numCols + sos->num];
115 for (i = 0; i < numCols; ++i) {
116 if (nlp.isInteger(i)) {
117 osiObj[nObj] =
new OsiSimpleInteger(i, clb[i], cub[i]);
119 osiObj[nObj]->setPriority(cPrio[i]);
124 #if ! defined(BM_DISREGARD_SOS)
125 const int* starts = sos->starts;
126 for (i = 0; i < sos->num; ++i) {
127 OsiSOS* so =
new OsiSOS(NULL,
128 starts[i+1] - starts[i],
129 sos->indices + starts[i],
130 sos->weights + starts[i],
132 so->setPriority(sos->priorities ? sos->priorities[i] : 1);
136 nlp.addObjects(nObj, osiObj);
149 for (i = 0; i <
objNum_; ++i) {
152 prio[i] = osiObj[i]->priority();
157 for (i = 0; i < nObj; ++i) {
194 const BB_cut* bb_cut =
dynamic_cast<const BB_cut*
>(cut);
void initialize(char **&argv)
initialize bonmin with ampl model using the command line arguments.
Values not further from an integer value than the value of this parameter are considered to be intege...
BCP_buffer & pack(const T &value)
Pack a single object of type T.
Upper limit on the number of iterations performed in each of the children of the search tree node whe...
The minimum difference between the objective value of any two feasible solution (with different objec...
BCP_buffer & unpack(T &value)
Unpack a single object of type T.
Print the number of cuts generated during this iteration (since the LP was resolved last time)...
Print the number of variables generated during this iteration.
This is class provides an Osi interface for a Mixed Integer Linear Program expressed as a TMINLP (so ...
void pack_pseudo_costs(BCP_buffer &buf)
This is the class from which the user should derive her own algorithmic cuts.
BCP_process_t
This enumerative constant describes the various process types.
const char * c_str() const
Class to store sos constraints for model.
BCP_string nl_file_content
Print the current number of cuts in the cut pool.
void unpack_pseudo_costs(BCP_buffer &buf)
Similar as above for variables.
void fint fint fint real fint real real real real real real real real real * e
Bonmin::Algorithm getAlgorithm()
Get the algorithm used.
Bonmin::BonminAmplSetup bonmin_
This contains the setup for running Bonmin in particular nlp solver, continuous solver, cut generators,...
int * infInd_
Every time when branching decisions are to be made, we create 6 arrays, 3 for those objects that are ...
void pack(BCP_buffer &buf) const
virtual void pack_cut_algo(const BCP_cut_algo *cut, BCP_buffer &buf)
Pack an algorithmic cut.
void pack(BCP_buffer &buf) const
Packing cut to a buffer.
void fint fint fint real fint real real real real real real real real real fint real fint * lp
BCP_lp_prob * getLpProblemPointer()
Get the pointer.
BCP_string ipopt_file_content
Simple representation of a cut by storing non zero coefficients only.
virtual void pack_user_data(const BCP_user_data *ud, BCP_buffer &buf)
Pack an user data.
int * objInd_
These are the indices of the integral (i.e., things that can be branched on) objects in the solver...
virtual BCP_cut_algo * unpack_cut_algo(BCP_buffer &buf)
Unpack an algorithmic cut.
Currently there isn't any error handling in BCP.
BCP_string ipopt_file_content
BCP_parameter_set< BM_par > par
This class describes the message buffer used for all processes of BCP.
BCP_parameter_set< BM_par > par
OsiTMINLPInterface * nonlinearSolver()
Pointer to the non-linear solver used.
Ipopt::SmartPtr< Ipopt::OptionsList > options()
Acces list of Options.
double getDoubleParameter(const DoubleParameter &p) const
Return value of double parameter.
virtual BCP_user_data * unpack_user_data(BCP_buffer &buf)
Unpack an user data.
Print the number of ineffective rows in the current problem.
virtual void pack_module_data(BCP_buffer &buf, BCP_process_t ptype)
Pack the initial information (info that the user wants to send over) for the process specified by the...
BM_SB_result * sbResult_
This is where we keep the results in case of distributed strong branching.
void unpack(BCP_buffer &buf)
Unpack the parameter set from the buffer.
void pack(BCP_buffer &buf)
Pack the parameter set into the buffer.
virtual void unpack_module_data(BCP_buffer &buf)
Unpack the initial information sent to the LP process by the Tree Manager.
BCP_string nl_file_content