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