Main Page
Classes
Files
File List
File Members
var
build
temp
tmp.GbsVr1VNv1
4.0-0-0
clp
clp-1.12.0
Clp
src
CbcOrClpParam.hpp
Go to the documentation of this file.
1
2
/* $Id: CbcOrClpParam.hpp 1525 2010-02-26 17:27:59Z mjs $ */
3
// Copyright (C) 2002, International Business Machines
4
// Corporation and others. All Rights Reserved.
5
6
#ifdef USE_CBCCONFIG
7
# include "CbcConfig.h"
8
#else
9
# include "
ClpConfig.h
"
10
#endif
11
12
#ifndef CbcOrClpParam_H
13
#define CbcOrClpParam_H
14
26
class
OsiSolverInterface
;
27
class
CbcModel;
28
class
ClpSimplex
;
46
enum
CbcOrClpParameterType
47
48
{
49
CBC_PARAM_GENERALQUERY
= -100,
50
CBC_PARAM_FULLGENERALQUERY
,
51
52
CLP_PARAM_DBL_PRIMALTOLERANCE
= 1,
53
CLP_PARAM_DBL_DUALTOLERANCE
,
54
CLP_PARAM_DBL_TIMELIMIT
,
55
CLP_PARAM_DBL_DUALBOUND
,
56
CLP_PARAM_DBL_PRIMALWEIGHT
,
57
CLP_PARAM_DBL_OBJSCALE
,
58
CLP_PARAM_DBL_RHSSCALE
,
59
60
CBC_PARAM_DBL_INFEASIBILITYWEIGHT
= 51,
61
CBC_PARAM_DBL_CUTOFF
,
62
CBC_PARAM_DBL_INTEGERTOLERANCE
,
63
CBC_PARAM_DBL_INCREMENT
,
64
CBC_PARAM_DBL_ALLOWABLEGAP
,
65
CBC_PARAM_DBL_TIMELIMIT_BAB
,
66
CBC_PARAM_DBL_GAPRATIO
,
67
68
CBC_PARAM_DBL_DJFIX
= 81,
69
CBC_PARAM_DBL_TIGHTENFACTOR
,
70
CLP_PARAM_DBL_PRESOLVETOLERANCE
,
71
CLP_PARAM_DBL_OBJSCALE2
,
72
CBC_PARAM_DBL_FAKEINCREMENT
,
73
CBC_PARAM_DBL_FAKECUTOFF
,
74
CBC_PARAM_DBL_ARTIFICIALCOST
,
75
CBC_PARAM_DBL_DEXTRA3
,
76
CBC_PARAM_DBL_SMALLBAB
,
77
CBC_PARAM_DBL_DEXTRA4
,
78
CBC_PARAM_DBL_DEXTRA5
,
79
80
CLP_PARAM_INT_SOLVERLOGLEVEL
= 101,
81
#ifndef COIN_HAS_CBC
82
CLP_PARAM_INT_LOGLEVEL
= 101,
83
#endif
84
CLP_PARAM_INT_MAXFACTOR
,
85
CLP_PARAM_INT_PERTVALUE
,
86
CLP_PARAM_INT_MAXITERATION
,
87
CLP_PARAM_INT_PRESOLVEPASS
,
88
CLP_PARAM_INT_IDIOT
,
89
CLP_PARAM_INT_SPRINT
,
90
CLP_PARAM_INT_OUTPUTFORMAT
,
91
CLP_PARAM_INT_SLPVALUE
,
92
CLP_PARAM_INT_PRESOLVEOPTIONS
,
93
CLP_PARAM_INT_PRINTOPTIONS
,
94
CLP_PARAM_INT_SPECIALOPTIONS
,
95
CLP_PARAM_INT_SUBSTITUTION
,
96
CLP_PARAM_INT_DUALIZE
,
97
CLP_PARAM_INT_VERBOSE
,
98
CLP_PARAM_INT_CPP
,
99
CLP_PARAM_INT_PROCESSTUNE
,
100
CLP_PARAM_INT_USESOLUTION
,
101
102
CBC_PARAM_INT_STRONGBRANCHING
= 151,
103
CBC_PARAM_INT_CUTDEPTH
,
104
CBC_PARAM_INT_MAXNODES
,
105
CBC_PARAM_INT_NUMBERBEFORE
,
106
CBC_PARAM_INT_NUMBERANALYZE
,
107
CBC_PARAM_INT_MIPOPTIONS
,
108
CBC_PARAM_INT_MOREMIPOPTIONS
,
109
CBC_PARAM_INT_MAXHOTITS
,
110
CBC_PARAM_INT_FPUMPITS
,
111
CBC_PARAM_INT_MAXSOLS
,
112
CBC_PARAM_INT_FPUMPTUNE
,
113
CBC_PARAM_INT_TESTOSI
,
114
CBC_PARAM_INT_EXTRA1
,
115
CBC_PARAM_INT_EXTRA2
,
116
CBC_PARAM_INT_EXTRA3
,
117
CBC_PARAM_INT_EXTRA4
,
118
CBC_PARAM_INT_DEPTHMINIBAB
,
119
CBC_PARAM_INT_CUTPASSINTREE
,
120
CBC_PARAM_INT_THREADS
,
121
CBC_PARAM_INT_CUTPASS
,
122
CBC_PARAM_INT_VUBTRY
,
123
CBC_PARAM_INT_DENSE
,
124
CBC_PARAM_INT_EXPERIMENT
,
125
CBC_PARAM_INT_DIVEOPT
,
126
CBC_PARAM_INT_STRATEGY
,
127
CBC_PARAM_INT_SMALLFACT
,
128
CBC_PARAM_INT_HOPTIONS
,
129
CBC_PARAM_INT_CUTLENGTH
,
130
CBC_PARAM_INT_FPUMPTUNE2
,
131
#ifdef COIN_HAS_CBC
132
CLP_PARAM_INT_LOGLEVEL
,
133
#endif
134
135
CLP_PARAM_STR_DIRECTION
= 201,
136
CLP_PARAM_STR_DUALPIVOT
,
137
CLP_PARAM_STR_SCALING
,
138
CLP_PARAM_STR_ERRORSALLOWED
,
139
CLP_PARAM_STR_KEEPNAMES
,
140
CLP_PARAM_STR_SPARSEFACTOR
,
141
CLP_PARAM_STR_PRIMALPIVOT
,
142
CLP_PARAM_STR_PRESOLVE
,
143
CLP_PARAM_STR_CRASH
,
144
CLP_PARAM_STR_BIASLU
,
145
CLP_PARAM_STR_PERTURBATION
,
146
CLP_PARAM_STR_MESSAGES
,
147
CLP_PARAM_STR_AUTOSCALE
,
148
CLP_PARAM_STR_CHOLESKY
,
149
CLP_PARAM_STR_KKT
,
150
CLP_PARAM_STR_BARRIERSCALE
,
151
CLP_PARAM_STR_GAMMA
,
152
CLP_PARAM_STR_CROSSOVER
,
153
CLP_PARAM_STR_PFI
,
154
CLP_PARAM_STR_INTPRINT
,
155
CLP_PARAM_STR_VECTOR
,
156
CLP_PARAM_STR_FACTORIZATION
,
157
CLP_PARAM_STR_ALLCOMMANDS
,
158
159
CBC_PARAM_STR_NODESTRATEGY
= 251,
160
CBC_PARAM_STR_BRANCHSTRATEGY
,
161
CBC_PARAM_STR_CUTSSTRATEGY
,
162
CBC_PARAM_STR_HEURISTICSTRATEGY
,
163
CBC_PARAM_STR_GOMORYCUTS
,
164
CBC_PARAM_STR_PROBINGCUTS
,
165
CBC_PARAM_STR_KNAPSACKCUTS
,
166
CBC_PARAM_STR_REDSPLITCUTS
,
167
CBC_PARAM_STR_ROUNDING
,
168
CBC_PARAM_STR_SOLVER
,
169
CBC_PARAM_STR_CLIQUECUTS
,
170
CBC_PARAM_STR_COSTSTRATEGY
,
171
CBC_PARAM_STR_FLOWCUTS
,
172
CBC_PARAM_STR_MIXEDCUTS
,
173
CBC_PARAM_STR_TWOMIRCUTS
,
174
CBC_PARAM_STR_PREPROCESS
,
175
CBC_PARAM_STR_FPUMP
,
176
CBC_PARAM_STR_GREEDY
,
177
CBC_PARAM_STR_COMBINE
,
178
CBC_PARAM_STR_LOCALTREE
,
179
CBC_PARAM_STR_SOS
,
180
CBC_PARAM_STR_LANDPCUTS
,
181
CBC_PARAM_STR_RINS
,
182
CBC_PARAM_STR_RESIDCUTS
,
183
CBC_PARAM_STR_RENS
,
184
CBC_PARAM_STR_DIVINGS
,
185
CBC_PARAM_STR_DIVINGC
,
186
CBC_PARAM_STR_DIVINGF
,
187
CBC_PARAM_STR_DIVINGG
,
188
CBC_PARAM_STR_DIVINGL
,
189
CBC_PARAM_STR_DIVINGP
,
190
CBC_PARAM_STR_DIVINGV
,
191
CBC_PARAM_STR_DINS
,
192
CBC_PARAM_STR_PIVOTANDFIX
,
193
CBC_PARAM_STR_RANDROUND
,
194
CBC_PARAM_STR_NAIVE
,
195
CBC_PARAM_STR_ZEROHALFCUTS
,
196
CBC_PARAM_STR_CPX
,
197
CBC_PARAM_STR_CROSSOVER2
,
198
CBC_PARAM_STR_PIVOTANDCOMPLEMENT
,
199
CBC_PARAM_STR_VND
,
200
201
CLP_PARAM_ACTION_DIRECTORY
= 301,
202
CLP_PARAM_ACTION_DIRSAMPLE
,
203
CLP_PARAM_ACTION_DIRNETLIB
,
204
CBC_PARAM_ACTION_DIRMIPLIB
,
205
CLP_PARAM_ACTION_IMPORT
,
206
CLP_PARAM_ACTION_EXPORT
,
207
CLP_PARAM_ACTION_RESTORE
,
208
CLP_PARAM_ACTION_SAVE
,
209
CLP_PARAM_ACTION_DUALSIMPLEX
,
210
CLP_PARAM_ACTION_PRIMALSIMPLEX
,
211
CLP_PARAM_ACTION_EITHERSIMPLEX
,
212
CLP_PARAM_ACTION_MAXIMIZE
,
213
CLP_PARAM_ACTION_MINIMIZE
,
214
CLP_PARAM_ACTION_EXIT
,
215
CLP_PARAM_ACTION_STDIN
,
216
CLP_PARAM_ACTION_UNITTEST
,
217
CLP_PARAM_ACTION_NETLIB_EITHER
,
218
CLP_PARAM_ACTION_NETLIB_DUAL
,
219
CLP_PARAM_ACTION_NETLIB_PRIMAL
,
220
CLP_PARAM_ACTION_SOLUTION
,
221
CLP_PARAM_ACTION_SAVESOL
,
222
CLP_PARAM_ACTION_TIGHTEN
,
223
CLP_PARAM_ACTION_FAKEBOUND
,
224
CLP_PARAM_ACTION_HELP
,
225
CLP_PARAM_ACTION_PLUSMINUS
,
226
CLP_PARAM_ACTION_NETWORK
,
227
CLP_PARAM_ACTION_ALLSLACK
,
228
CLP_PARAM_ACTION_REVERSE
,
229
CLP_PARAM_ACTION_BARRIER
,
230
CLP_PARAM_ACTION_NETLIB_BARRIER
,
231
CLP_PARAM_ACTION_NETLIB_TUNE
,
232
CLP_PARAM_ACTION_REALLY_SCALE
,
233
CLP_PARAM_ACTION_BASISIN
,
234
CLP_PARAM_ACTION_BASISOUT
,
235
CLP_PARAM_ACTION_SOLVECONTINUOUS
,
236
CLP_PARAM_ACTION_CLEARCUTS
,
237
CLP_PARAM_ACTION_VERSION
,
238
CLP_PARAM_ACTION_STATISTICS
,
239
CLP_PARAM_ACTION_DEBUG
,
240
CLP_PARAM_ACTION_DUMMY
,
241
CLP_PARAM_ACTION_PRINTMASK
,
242
CLP_PARAM_ACTION_OUTDUPROWS
,
243
CLP_PARAM_ACTION_USERCLP
,
244
CLP_PARAM_ACTION_MODELIN
,
245
CLP_PARAM_ACTION_CSVSTATISTICS
,
246
CLP_PARAM_ACTION_STOREDFILE
,
247
CLP_PARAM_ACTION_ENVIRONMENT
,
248
249
CBC_PARAM_ACTION_BAB
= 351,
250
CBC_PARAM_ACTION_MIPLIB
,
251
CBC_PARAM_ACTION_STRENGTHEN
,
252
CBC_PARAM_ACTION_PRIORITYIN
,
253
CBC_PARAM_ACTION_USERCBC
,
254
CBC_PARAM_ACTION_DOHEURISTIC
,
255
256
CBC_PARAM_NOTUSED_OSLSTUFF
= 401,
257
CBC_PARAM_NOTUSED_CBCSTUFF
,
258
259
CBC_PARAM_NOTUSED_INVALID
= 1000
260
} ;
261
#include <vector>
262
#include <string>
263
265
266
class
CbcOrClpParam
{
267
public
:
270
271
CbcOrClpParam
( );
272
CbcOrClpParam
(std::string
name
, std::string help,
273
double
lower,
double
upper,
CbcOrClpParameterType
type
,
int
display = 2);
274
CbcOrClpParam
(std::string name, std::string help,
275
int
lower,
int
upper,
CbcOrClpParameterType
type,
int
display = 2);
276
// Other strings will be added by insert
277
CbcOrClpParam
(std::string name, std::string help, std::string firstValue,
278
CbcOrClpParameterType
type,
int
whereUsed
= 7,
int
display = 2);
279
// Action
280
CbcOrClpParam
(std::string name, std::string help,
281
CbcOrClpParameterType
type,
int
whereUsed
= 7,
int
display = 2);
283
CbcOrClpParam
(
const
CbcOrClpParam
&);
285
CbcOrClpParam
&
operator=
(
const
CbcOrClpParam
& rhs);
287
~CbcOrClpParam
( );
289
292
293
void
append
(std::string keyWord);
295
void
addHelp
(std::string keyWord);
297
inline
std::string
name
( )
const
{
298
return
name_
;
299
}
301
inline
std::string
shortHelp
( )
const
{
302
return
shortHelp_
;
303
}
305
int
setDoubleParameter
(CbcModel & model,
double
value) ;
307
const
char
*
setDoubleParameterWithMessage
( CbcModel & model,
double
value ,
int
& returnCode);
309
double
doubleParameter
(CbcModel & model)
const
;
311
int
setIntParameter
(CbcModel & model,
int
value) ;
313
const
char
*
setIntParameterWithMessage
( CbcModel & model,
int
value ,
int
& returnCode);
315
int
intParameter
(CbcModel & model)
const
;
317
int
setDoubleParameter
(
ClpSimplex
* model,
double
value) ;
319
double
doubleParameter
(
ClpSimplex
* model)
const
;
321
const
char
*
setDoubleParameterWithMessage
(
ClpSimplex
* model,
double
value ,
int
& returnCode);
323
int
setIntParameter
(
ClpSimplex
* model,
int
value) ;
325
const
char
*
setIntParameterWithMessage
(
ClpSimplex
* model,
int
value ,
int
& returnCode);
327
int
intParameter
(
ClpSimplex
* model)
const
;
329
int
setDoubleParameter
(
OsiSolverInterface
* model,
double
value) ;
331
const
char
*
setDoubleParameterWithMessage
(
OsiSolverInterface
* model,
double
value ,
int
& returnCode);
333
double
doubleParameter
(
OsiSolverInterface
* model)
const
;
335
int
setIntParameter
(
OsiSolverInterface
* model,
int
value) ;
337
const
char
*
setIntParameterWithMessage
(
OsiSolverInterface
* model,
int
value ,
int
& returnCode);
339
int
intParameter
(
OsiSolverInterface
* model)
const
;
341
int
checkDoubleParameter
(
double
value)
const
;
343
std::string
matchName
( )
const
;
345
int
lengthMatchName
( )
const
;
347
int
parameterOption
( std::string check )
const
;
349
void
printOptions
( )
const
;
351
inline
std::string
currentOption
( )
const
{
352
return
definedKeyWords_
[
currentKeyWord_
];
353
}
355
void
setCurrentOption
(
int
value ,
bool
printIt =
false
);
357
const
char
*
setCurrentOptionWithMessage
(
int
value );
359
void
setCurrentOption
(
const
std::string value );
361
inline
int
currentOptionAsInteger
( )
const
{
362
return
currentKeyWord_
;
363
}
365
void
setIntValue
(
int
value );
366
inline
int
intValue
()
const
{
367
return
intValue_
;
368
}
370
void
setDoubleValue
(
double
value );
371
inline
double
doubleValue
()
const
{
372
return
doubleValue_
;
373
}
375
void
setStringValue
( std::string value );
376
inline
std::string
stringValue
()
const
{
377
return
stringValue_
;
378
}
380
int
matches
(std::string input)
const
;
382
inline
CbcOrClpParameterType
type
()
const
{
383
return
type_
;
384
}
386
inline
int
displayThis
()
const
{
387
return
display_
;
388
}
390
inline
void
setLonghelp
(
const
std::string help) {
391
longHelp_
= help;
392
}
394
void
printLongHelp
()
const
;
396
void
printString
()
const
;
402
inline
int
whereUsed
()
const
{
403
return
whereUsed_
;
404
}
405
406
private
:
408
void
gutsOfConstructor
();
410
411
private
:
412
417
// Type see CbcOrClpParameterType
418
CbcOrClpParameterType
type_
;
420
double
lowerDoubleValue_
;
421
double
upperDoubleValue_
;
423
int
lowerIntValue_
;
424
int
upperIntValue_
;
425
// Length of name
426
unsigned
int
lengthName_
;
427
// Minimum match
428
unsigned
int
lengthMatch_
;
430
std::vector<std::string>
definedKeyWords_
;
432
std::string
name_
;
434
std::string
shortHelp_
;
436
std::string
longHelp_
;
438
CbcOrClpParameterType
action_
;
440
int
currentKeyWord_
;
442
int
display_
;
444
int
intValue_
;
446
double
doubleValue_
;
448
std::string
stringValue_
;
454
int
whereUsed_
;
456
};
458
std::string
CoinReadNextField
();
459
460
std::string
CoinReadGetCommand
(
int
argc,
const
char
*argv[]);
461
std::string
CoinReadGetString
(
int
argc,
const
char
*argv[]);
462
// valid 0 - okay, 1 bad, 2 not there
463
int
CoinReadGetIntField
(
int
argc,
const
char
*argv[],
int
* valid);
464
double
CoinReadGetDoubleField
(
int
argc,
const
char
*argv[],
int
* valid);
465
void
CoinReadPrintit
(
const
char
* input);
466
void
setCbcOrClpPrinting
(
bool
yesNo);
467
#define CBCMAXPARAMETERS 200
468
/*
469
Subroutine to establish the cbc parameter array. See the description of
470
class CbcOrClpParam for details. Pulled from C..Main() for clarity.
471
*/
472
void
establishParams
(
int
&numberParameters,
CbcOrClpParam
*
const
parameters);
473
// Given a parameter type - returns its number in list
474
int
whichParam
(
CbcOrClpParameterType
name,
475
int
numberParameters,
CbcOrClpParam
*
const
parameters);
476
// Dump a solution to file
477
void
saveSolution
(
const
ClpSimplex
* lpSolver, std::string fileName);
478
#endif
/* CbcOrClpParam_H */
Generated on Sat Nov 1 2014 02:18:45 by
1.8.1.2