source: trunk/Clp/src/ClpParameters.hpp @ 1370

Last change on this file since 1370 was 1370, checked in by forrest, 11 years ago

add ids

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