1 | /* $Id: ClpParameters.hpp 2385 2019-01-06 19:43:06Z unxusr $ */ |
---|
2 | // Copyright (C) 2000, 2002, International Business Machines |
---|
3 | // Corporation and others. All Rights Reserved. |
---|
4 | // This code is licensed under the terms of the Eclipse Public License (EPL). |
---|
5 | |
---|
6 | #ifndef _ClpParameters_H |
---|
7 | #define _ClpParameters_H |
---|
8 | |
---|
9 | /** This is where to put any useful stuff. |
---|
10 | |
---|
11 | */ |
---|
12 | enum ClpIntParam { |
---|
13 | /** The maximum number of iterations Clp can execute in the simplex methods |
---|
14 | */ |
---|
15 | ClpMaxNumIteration = 0, |
---|
16 | /** The maximum number of iterations Clp can execute in hotstart before |
---|
17 | terminating */ |
---|
18 | ClpMaxNumIterationHotStart, |
---|
19 | /** The name discipline; specifies how the solver will handle row and |
---|
20 | column names. |
---|
21 | - 0: Auto names: Names cannot be set by the client. Names of the form |
---|
22 | Rnnnnnnn or Cnnnnnnn are generated on demand when a name for a |
---|
23 | specific row or column is requested; nnnnnnn is derived from the row |
---|
24 | or column index. Requests for a vector of names return a vector with |
---|
25 | zero entries. |
---|
26 | - 1: Lazy names: Names supplied by the client are retained. Names of the |
---|
27 | form Rnnnnnnn or Cnnnnnnn are generated on demand if no name has been |
---|
28 | supplied by the client. Requests for a vector of names return a |
---|
29 | vector sized to the largest index of a name supplied by the client; |
---|
30 | some entries in the vector may be null strings. |
---|
31 | - 2: Full names: Names supplied by the client are retained. Names of the |
---|
32 | form Rnnnnnnn or Cnnnnnnn are generated on demand if no name has been |
---|
33 | supplied by the client. Requests for a vector of names return a |
---|
34 | vector sized to match the constraint system, and all entries will |
---|
35 | contain either the name specified by the client or a generated name. |
---|
36 | */ |
---|
37 | ClpNameDiscipline, |
---|
38 | /** Just a marker, so that we can allocate a static sized array to store |
---|
39 | parameters. */ |
---|
40 | ClpLastIntParam |
---|
41 | }; |
---|
42 | |
---|
43 | enum ClpDblParam { |
---|
44 | /** Set Dual objective limit. This is to be used as a termination criteria |
---|
45 | in methods where the dual objective monotonically changes (dual |
---|
46 | simplex). */ |
---|
47 | ClpDualObjectiveLimit, |
---|
48 | /** Primal objective limit. This is to be used as a termination |
---|
49 | criteria in methods where the primal objective monotonically changes |
---|
50 | (e.g., primal simplex) */ |
---|
51 | ClpPrimalObjectiveLimit, |
---|
52 | /** The maximum amount the dual constraints can be violated and still be |
---|
53 | considered feasible. */ |
---|
54 | ClpDualTolerance, |
---|
55 | /** The maximum amount the primal constraints can be violated and still be |
---|
56 | considered feasible. */ |
---|
57 | ClpPrimalTolerance, |
---|
58 | /** Objective function constant. This the value of the constant term in |
---|
59 | the objective function. */ |
---|
60 | ClpObjOffset, |
---|
61 | /// Maximum time in seconds - after, this action is as max iterations |
---|
62 | ClpMaxSeconds, |
---|
63 | /// Maximum wallclock running time in seconds - after, this action is as max iterations |
---|
64 | ClpMaxWallSeconds, |
---|
65 | /// Tolerance to use in presolve |
---|
66 | ClpPresolveTolerance, |
---|
67 | /** Just a marker, so that we can allocate a static sized array to store |
---|
68 | parameters. */ |
---|
69 | ClpLastDblParam |
---|
70 | }; |
---|
71 | |
---|
72 | enum ClpStrParam { |
---|
73 | /** Name of the problem. This is the found on the Name card of |
---|
74 | an mps file. */ |
---|
75 | ClpProbName = 0, |
---|
76 | /** Just a marker, so that we can allocate a static sized array to store |
---|
77 | parameters. */ |
---|
78 | ClpLastStrParam |
---|
79 | }; |
---|
80 | |
---|
81 | /// Copy (I don't like complexity of Coin version) |
---|
82 | template < class T > |
---|
83 | inline void |
---|
84 | ClpDisjointCopyN(const T *array, const CoinBigIndex size, T *newArray) |
---|
85 | { |
---|
86 | memcpy(reinterpret_cast< void * >(newArray), array, size * sizeof(T)); |
---|
87 | } |
---|
88 | /// And set |
---|
89 | template < class T > |
---|
90 | inline void |
---|
91 | ClpFillN(T *array, const CoinBigIndex size, T value) |
---|
92 | { |
---|
93 | CoinBigIndex i; |
---|
94 | for (i = 0; i < size; i++) |
---|
95 | array[i] = value; |
---|
96 | } |
---|
97 | /// This returns a non const array filled with input from scalar or actual array |
---|
98 | template < class T > |
---|
99 | inline T * |
---|
100 | ClpCopyOfArray(const T *array, const CoinBigIndex size, T value) |
---|
101 | { |
---|
102 | T *arrayNew = new T[size]; |
---|
103 | if (array) |
---|
104 | ClpDisjointCopyN(array, size, arrayNew); |
---|
105 | else |
---|
106 | ClpFillN(arrayNew, size, value); |
---|
107 | return arrayNew; |
---|
108 | } |
---|
109 | |
---|
110 | /// This returns a non const array filled with actual array (or NULL) |
---|
111 | template < class T > |
---|
112 | inline T * |
---|
113 | ClpCopyOfArray(const T *array, const CoinBigIndex size) |
---|
114 | { |
---|
115 | if (array) { |
---|
116 | T *arrayNew = new T[size]; |
---|
117 | ClpDisjointCopyN(array, size, arrayNew); |
---|
118 | return arrayNew; |
---|
119 | } else { |
---|
120 | return NULL; |
---|
121 | } |
---|
122 | } |
---|
123 | /// For a structure to be used by trusted code |
---|
124 | typedef struct { |
---|
125 | int typeStruct; // allocated as 1,2 etc |
---|
126 | int typeCall; |
---|
127 | void *data; |
---|
128 | } ClpTrustedData; |
---|
129 | #endif |
---|
130 | |
---|
131 | /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2 |
---|
132 | */ |
---|