Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
coin.h
Go to the documentation of this file.
1
32#pragma once
33
34#include <coin/CoinPackedVector.hpp> // not used here but always necessary when using COIN
35
36#include <ogdf/basic/Logger.h>
37
39
40namespace ogdf {
41
44public:
46
50
53#ifdef COIN_OSI_CPX
55#elif defined(COIN_OSI_GRB)
57#elif defined(COIN_OSI_SYM)
59 ret->setSymParam(OsiSymVerbosity, -2);
60#else // COIN_OSI_CLP
61 OsiClpSolverInterface* ret = new OsiClpSolverInterface(); // Coin-OR LP
62#endif
63 updateLogging(ret);
64 return ret;
65 }
66
69 if (CoinLog.effectiveStatisticMode()) {
70 osi->messageHandler()->setLogLevel(0);
71 } else {
72 switch (CoinLog.effectiveLogLevel()) {
73 //- 0 - none
74 //- 1 - minimal
75 //- 2 - normal low
76 //- 3 - normal high
77 //- 4 - verbose
78 case Logger::Level::Minor:
79 osi->messageHandler()->setLogLevel(4);
80 break;
81 case Logger::Level::Medium:
82 osi->messageHandler()->setLogLevel(3);
83 break;
84 case Logger::Level::Default:
85 osi->messageHandler()->setLogLevel(2);
86 break;
87 case Logger::Level::High:
88 osi->messageHandler()->setLogLevel(1);
89 break;
90 case Logger::Level::Alarm:
91 osi->messageHandler()->setLogLevel(0);
92 break;
93 case Logger::Level::Force:
94 osi->messageHandler()->setLogLevel(0);
95 break;
96 }
97 }
98 }
99};
100
101}
Contains logging functionality.
If you use COIN-OR, you should use this class.
Definition coin.h:43
static void updateLogging(OsiSolverInterface *osi)
Update the log level of the CoinMessageHandler associated with osi to match the log level of the ogdf...
Definition coin.h:68
static Logger CoinLog
The OGDF Logger which will determine the log level for a new instance returned by createCorrectOsiSol...
Definition coin.h:49
static OsiSolverInterface * createCorrectOsiSolverInterface()
Get a new solver and set its initial log level according to the level of CoinLog.
Definition coin.h:52
Centralized global and local logging facility working on streams like std::cout.
Definition Logger.h:100
Level effectiveLogLevel() const
obtain the effective log-level for the Logger-object (i.e., resolve the dependencies on the global se...
Definition Logger.h:256
bool effectiveStatisticMode() const
returns true if the Logger-object is effectively in statistic-mode (as this might be depending on the...
Definition Logger.h:265
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition config.h:101
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.