Cbc 2.10.11
Loading...
Searching...
No Matches
CbcGenCtlBlk.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2007, Lou Hafer, International Business Machines Corporation
3 and others. All Rights Reserved.
4
5 This code is licensed under the terms of the Eclipse Public License (EPL).
6
7 $Id$
8*/
9/*
10 This file is part of cbc-generic.
11*/
12
13#ifndef CbcGenCtlBlk_H
14#define CbcGenCtlBlk_H
15
16/* \file CbcGenCtlBlk.hpp
17 \brief Declarations for parameters of the cbc-generic main program.
18*/
19
20#include "CoinParam.hpp"
21#include "CoinMessageHandler.hpp"
22
23#include "CglCutGenerator.hpp"
24#include "CglProbing.hpp"
25#include "CglClique.hpp"
26#include "CglFlowCover.hpp"
27#include "CglGomory.hpp"
28#include "CglKnapsackCover.hpp"
29#include "CglMixedIntegerRounding2.hpp"
30#include "CglOddHole.hpp"
31#include "CglRedSplit.hpp"
32#include "CglTwomir.hpp"
33
34#include "CbcModel.hpp"
35
36#include "CbcHeuristic.hpp"
37#include "CbcHeuristicFPump.hpp"
39#include "CbcHeuristicLocal.hpp"
40#include "CbcTreeLocal.hpp"
41
42#include "CbcGenMessages.hpp"
43
44/*
45 It turns out that doxygen is not good with anonymous structures. Hence the
46 `struct nameCtl_struct' style used for structured fields in CbcGenCtlBlk.
47*/
48
49/*
50 $Id$
51*/
52
53#define CBC_GENERIC_VERSION "00.01.00"
54
55class CbcGenCtlBlk;
57void addCbcGenParams(int &numParams, CoinParamVec &paramVec,
58 CbcGenCtlBlk *ctlBlk);
59}
60
61/* \brief cbc-generic algorithm control class
62
63 This class defines values and methods used to control the operation of the
64 cbc-generic main program.
65*/
66
68
69 friend void CbcGenParamUtils::addCbcGenParams(int &numParams,
70 CoinParamVec &paramVec, CbcGenCtlBlk *ctlBlk);
71
72public:
75
76 /*
77 In order for initialisation to work properly, the order of declaration of
78 the enum constants here must match the order of keyword declaration for
79 the PREPROCESS parameter in CbcGenParamUtils::addCbcGenParams
80 */
107
108 /*
109 In order for initialisation to work properly, the order of declaration of
110 the enum constants here must match the order of keyword declaration for
111 the various cut and heuristic control parameters in
112 CbcGenParamUtils::addCbcGenParams
113 */
142
155
171 typedef enum { BACInvalid = -1,
176 BACUser = 5
178
209
226
228
231
235
240
256
264 inline int getCutDepth()
265 {
266 return cutDepth_;
267 }
268
274 inline void setCutDepth(int cutDepth)
275 {
276 cutDepth_ = cutDepth;
277 }
278
279 /*1 \brief Get action state for use of integer preprocessing */
280
282 {
283 return (preProcess_);
284 }
285
288 inline void setIPPAction(IPPControl action)
289 {
290 preProcess_ = action;
291 }
292
295 CGControl getProbing(CglCutGenerator *&gen);
296
299 inline void setProbingAction(CGControl action)
300 {
301 probing_.action_ = action;
302 }
303
306 CGControl getClique(CglCutGenerator *&gen);
307
310 inline void setCliqueAction(CGControl action)
311 {
312 clique_.action_ = action;
313 }
314
317 CGControl getFlow(CglCutGenerator *&gen);
318
321 inline void setFlowAction(CGControl action)
322 {
323 flow_.action_ = action;
324 }
325
328 CGControl getGomory(CglCutGenerator *&gen);
329
332 inline void setGomoryAction(CGControl action)
333 {
334 gomory_.action_ = action;
335 }
336
339 CGControl getKnapsack(CglCutGenerator *&gen);
340
343 inline void setKnapsackAction(CGControl action)
344 {
345 knapsack_.action_ = action;
346 }
347
348 /* \brief Obtain a prototype for a lift-and-project cut generator.
349
350 CGControl getLandP(CglCutGenerator *&gen) ;
351
352 \brief Set action state for use of lift-and-project cut generator.
353
354 inline void setLandPAction(CGControl action)
355 { landp_.action_ = action ; }
356 */
357
362 CGControl getMir(CglCutGenerator *&gen);
363
366 inline void setMirAction(CGControl action)
367 {
368 mir_.action_ = action;
369 }
370
373 CGControl getRedSplit(CglCutGenerator *&gen);
374
377 inline void setRedSplitAction(CGControl action)
378 {
379 redSplit_.action_ = action;
380 }
381
384 CGControl getTwomir(CglCutGenerator *&gen);
385
388 inline void setTwomirAction(CGControl action)
389 {
390 twomir_.action_ = action;
391 }
392
401 bool alwaysCreate = true);
402
405 inline void setFPumpAction(CGControl action)
406 {
407 fpump_.action_ = action;
408 }
409
418 bool alwaysCreate = true);
419
422 inline void setCombineAction(CGControl action)
423 {
424 combine_.action_ = action;
425 }
426
435 bool alwaysCreate = true);
436
439 inline void setGreedyCoverAction(CGControl action)
440 {
441 greedyCover_.action_ = action;
442 }
443
452 bool alwaysCreate = true);
453
457 {
458 greedyEquality_.action_ = action;
459 }
460
469 bool alwaysCreate = true);
470
473 inline void setRoundingAction(CGControl action)
474 {
475 rounding_.action_ = action;
476 }
477
486 bool alwaysCreate = true);
487
490 inline void setTreeLocalAction(CGControl action)
491 {
492 localTree_.action_ = action;
493 }
494
496
501
504 inline void setBaBStatus(BACMajor majorStatus, BACMinor minorStatus,
505 BACWhere where, bool haveAnswer,
506 OsiSolverInterface *answerSolver)
507 {
508 bab_.majorStatus_ = majorStatus;
509 bab_.minorStatus_ = minorStatus;
510 bab_.where_ = where;
511 bab_.haveAnswer_ = haveAnswer;
512 bab_.answerSolver_ = answerSolver;
513 }
514
520 void setBaBStatus(const CbcModel *model, BACWhere where,
521 bool haveAnswer = false,
522 OsiSolverInterface *answerSolver = 0);
523
529
535
541 BACMinor translateMinor(const OsiSolverInterface *osi);
542
546
548
551
556 CoinMessageHandler &message(CbcGenMsgCode inID);
557
563 void passInMessageHandler(CoinMessageHandler *handler);
564
566 inline CoinMessageHandler *messageHandler() const
567 {
568 return msgHandler_;
569 }
570
583 void setMessages(CoinMessages::Language lang = CoinMessages::us_en);
584
586 inline void setLogLevel(int lvl)
587 {
588 logLvl_ = lvl;
589 if (msgHandler_)
590 msgHandler_->setLogLevel(lvl);
591 }
592
594 inline int logLevel() const
595 {
596 return (logLvl_);
597 }
598
603
605
610 std::string version_;
611
614 std::string dfltDirectory_;
615
618 std::string lastMpsIn_;
619
622
625 std::string lastSolnOut_;
626
634
640 std::string printMask_;
641
644 CoinParamVec *paramVec_;
645
652
659
668
679
683
686 std::vector< bool > setByUser_;
687
695
704 std::string debugCreate_;
705
712 std::string debugFile_;
713
724
725 /* \name Timing */
727
731
733
736
748
755 OsiSolverInterface *dfltSolver_;
756
760
775
777
780
793
798
800
807
821
822private:
827
831
839
854
863
869
877
878 /* \brief Control variable and prototype for lift-and-project cut
879 generator
880 struct landpCtl_struct
881 { CGControl action_ ;
882 CglLandP *proto_ ; } landp_ ;
883 */
884
890
894 CglMixedIntegerRounding2 *proto_;
896
902
910
917
924
931
937
943
949
967
969
975
977 CoinMessageHandler *msgHandler_;
978
986
988 CoinMessages::Language cur_lang_;
989
991 CoinMessages *msgs_;
992
995
997};
998
999#endif
1000
1001/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
1002*/
This file contains the enum that defines symbolic names for for cbc-generic messages.
CbcGenMsgCode
Symbolic names for cbc-generic messages.
bool allowImportErrors_
Allow/disallow errors when importing a model.
OsiSolverInterface * dfltSolver_
The current default LP solver.
CGControl getGreedyCover(CbcHeuristic *&gen, CbcModel *model, bool alwaysCreate=true)
Obtain a greedy cover heuristic.
void setMirAction(CGControl action)
Set action state for use of MIR cut generator.
CoinParamVec * paramVec_
The parameter vector.
struct CbcGenCtlBlk::combineCtl_struct combine_
BACMajor
Major status codes for branch-and-cut.
std::string printMask_
Print mask.
bool defaultSettings_
False if the user has made nontrivial modifications to the default control settings.
struct CbcGenCtlBlk::oddHoleCtl_struct oddHole_
struct CbcGenCtlBlk::chooseStrongCtl_struct chooseStrong_
struct CbcGenCtlBlk::flowCtl_struct flow_
struct CbcGenCtlBlk::localTreeCtl_struct localTree_
struct CbcGenCtlBlk::debugSolInfo_struct debugSol_
BACMinor translateMinor(const OsiSolverInterface *osi)
Translate OsiSolverInterface status to BACMinor.
void setBaBStatus(const CbcModel *model, BACWhere where, bool haveAnswer=false, OsiSolverInterface *answerSolver=0)
Set the result of branch-and-cut search.
void setLogLevel(int lvl)
Set log level.
CbcModel * model_
The reference CbcModel object.
void setCutDepth(int cutDepth)
Set cut depth setting.
void setCliqueAction(CGControl action)
Set action state for use of clique cut generator.
CGControl getRedSplit(CglCutGenerator *&gen)
Obtain a prototype for a reduce and split cut generator.
double totalTime_
Total elapsed time for this run.
int verbose_
Verbosity level for help messages.
void setGreedyCoverAction(CGControl action)
Set action state for use of greedy cover heuristic.
struct CbcGenCtlBlk::mirCtl_struct mir_
void setIPPAction(IPPControl action)
Set action state for use of integer preprocessing.
int printMode_
Solution printing mode.
CbcGenCtlBlk()
Default constructor.
CoinMessageHandler * messageHandler() const
Return a pointer to the message handler.
std::string debugFile_
Last debug input file.
struct CbcGenCtlBlk::twomirCtl_struct twomir_
void setCombineAction(CGControl action)
Set action state for use of local search/combine heuristic.
struct CbcGenCtlBlk::cbcParamsInfo_struct cbcParams_
struct CbcGenCtlBlk::roundingCtl_struct rounding_
CoinMessageHandler * msgHandler_
Message handler.
BACMajor translateMajor(int status)
Translate CbcModel major status to BACMajor.
CGControl getTwomir(CglCutGenerator *&gen)
Obtain a prototype for a 2-MIR cut generator.
std::string lastMpsIn_
Last MPS input file.
CGControl getMir(CglCutGenerator *&gen)
Obtain a prototype for a mixed integer rounding (MIR) cut generator.
CGControl getCombine(CbcHeuristic *&gen, CbcModel *model, bool alwaysCreate=true)
Obtain a local search/combine heuristic.
int logLvl_
The current log level.
std::string dfltDirectory_
Default directory prefix.
void printBaBStatus()
Print the status block.
void setMessages(CoinMessages::Language lang=CoinMessages::us_en)
Set up messages in the specified language.
struct CbcGenCtlBlk::probingCtl_struct probing_
int getCutDepth()
Get cut depth setting.
CGControl getClique(CglCutGenerator *&gen)
Obtain a prototype for a clique cut generator.
struct CbcGenCtlBlk::babState_struct bab_
CoinMessages::Language cur_lang_
The current language.
CGControl getFlow(CglCutGenerator *&gen)
Obtain a prototype for a flow cover cut generator.
struct CbcGenCtlBlk::djFixCtl_struct djFix_
BPControl priorityAction_
Control the assignment of branching priorities to integer variables.
struct CbcGenCtlBlk::cliqueCtl_struct clique_
void setTwomirAction(CGControl action)
Set action state for use of 2-MIR cut generator.
struct CbcGenCtlBlk::genParamsInfo_struct genParams_
CoinMessages * msgs_
The current set of messages.
bool goodModel_
True if we have a valid model loaded, false otherwise.
std::string version_
cbc-generic version
BPControl
Codes to specify the assignment of branching priorities.
int logLevel() const
Get log level.
void setKnapsackAction(CGControl action)
Set action state for use of knapsack cut generator.
struct CbcGenCtlBlk::knapsackCtl_struct knapsack_
struct CbcGenCtlBlk::osiParamsInfo_struct osiParams_
void setFlowAction(CGControl action)
Set action state for use of flow cover cut generator.
CGControl getTreeLocal(CbcTreeLocal *&localTree, CbcModel *model, bool alwaysCreate=true)
Obtain a local search tree object.
void passInMessageHandler(CoinMessageHandler *handler)
Supply a new message handler.
int cutDepth_
Control cut generator activity.
BACWhere
Codes to specify where branch-and-cut stopped.
std::string lastSolnOut_
Last solution output file.
void setProbingAction(CGControl action)
Set action state for use of probing cut generator.
IPPControl getIPPAction()
struct CbcGenCtlBlk::fpumpCtl_struct fpump_
CGControl getGomory(CglCutGenerator *&gen)
Obtain a prototype for a Gomory cut generator.
struct CbcGenCtlBlk::greedyCoverCtl_struct greedyCover_
std::string debugCreate_
Control debug file creation.
struct CbcGenCtlBlk::redSplitCtl_struct redSplit_
CGControl getKnapsack(CglCutGenerator *&gen)
Obtain a prototype for a knapsack cover cut generator.
int printOpt_
When greater than 0, integer presolve gives more information and branch-and-cut provides statistics.
struct CbcGenCtlBlk::greedyEqualityCtl_struct greedyEquality_
void setGomoryAction(CGControl action)
Set action state for use of Gomory cut generator.
void setBaBStatus(BACMajor majorStatus, BACMinor minorStatus, BACWhere where, bool haveAnswer, OsiSolverInterface *answerSolver)
Set the result of branch-and-cut search.
void setRedSplitAction(CGControl action)
Set action state for use of reduce and split cut generator.
CoinMessageHandler & message(CbcGenMsgCode inID)
Print a message.
void setTreeLocalAction(CGControl action)
Set action state for use of local tree.
IPPControl preProcess_
Control integer preprocessing.
bool ourMsgHandler_
Ownership of message handler.
~CbcGenCtlBlk()
Destructor.
std::vector< bool > setByUser_
Record of parameters changed by user command.
struct CbcGenCtlBlk::gomoryCtl_struct gomory_
CGControl getRounding(CbcHeuristic *&gen, CbcModel *model, bool alwaysCreate=true)
Obtain a simple rounding heuristic.
void setGreedyEqualityAction(CGControl action)
Set action state for use of greedy equality heuristic.
void setRoundingAction(CGControl action)
Set action state for use of simple rounding heuristic.
CGControl
Codes to control the use of cut generators and heuristics.
BACMinor
Minor status codes.
CGControl getGreedyEquality(CbcHeuristic *&gen, CbcModel *model, bool alwaysCreate=true)
Obtain a greedy equality heuristic.
CGControl getProbing(CglCutGenerator *&gen)
Obtain a prototype for a probing cut generator.
IPPControl
Codes to control integer preprocessing.
void setFPumpAction(CGControl action)
Set action state for use of feasibility pump heuristic.
BACMinor translateMinor(int status)
Translate CbcModel minor status to BACMinor.
int paramsProcessed_
Number of parameters processed.
CGControl getFPump(CbcHeuristic *&gen, CbcModel *model, bool alwaysCreate=true)
Obtain a feasibility pump heuristic.
Feasibility Pump class.
Greedy heuristic classes.
LocalSearch class.
Heuristic base class.
Simple Branch and bound class.
Definition CbcModel.hpp:100
Rounding class.
void addCbcGenParams(int &numParams, CoinParamVec &paramVec, CbcGenCtlBlk *ctlBlk)
State of branch-and-cut.
OsiSolverInterface * answerSolver_
Start and end of CbcModel parameters in parameter vector.
Control variables for a strong branching method.
Control variable and prototype for clique cut generator.
Control variable and prototype for combine heuristic.
Array of primal variable values for debugging.
Control use of reduced cost fixing prior to B&C.
Control variable and prototype for flow cover cut generator.
Control variable and prototype for feasibility pump heuristic.
Start and end of cbc-generic parameters in parameter vector.
Control variable and prototype for Gomory cut generator.
Control variable and prototype for greedy cover heuristic.
CbcHeuristicGreedyCover * proto_
Control variable and prototype for greedy equality heuristic.
CbcHeuristicGreedyEquality * proto_
Control variable and prototype for knapsack cover cut generator.
Control variables for local tree.
Control variable and prototype for MIR cut generator.
CglMixedIntegerRounding2 * proto_
Control variable and prototype for odd hole cut generator.
Start and end of OsiSolverInterface parameters in parameter vector.
Control variable and prototype for probing cut generator.
Control variable and prototype for reduce-and-split cut generator.
Control variable and prototype for simple rounding heuristic.
Control variable and prototype for Two-MIR cut generator.