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

Last change on this file since 754 was 754, checked in by andreasw, 13 years ago

first version

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.8 KB
Line 
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*/
10enum 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  /** Just a marker, so that we can allocate a static sized array to store
18      parameters. */
19  ClpLastIntParam
20};
21
22enum ClpDblParam {
23  /** Set Dual objective limit. This is to be used as a termination criteria
24      in methods where the dual objective monotonically changes (dual
25      simplex). */
26  ClpDualObjectiveLimit,
27  /** Primal objective limit. This is to be used as a termination
28      criteria in methods where the primal objective monotonically changes
29      (e.g., primal simplex) */
30  ClpPrimalObjectiveLimit,
31  /** The maximum amount the dual constraints can be violated and still be
32      considered feasible. */
33  ClpDualTolerance,
34  /** The maximum amount the primal constraints can be violated and still be
35      considered feasible. */
36  ClpPrimalTolerance,
37  /** Objective function constant. This the value of the constant term in
38      the objective function. */
39  ClpObjOffset,
40  /// Maximum time in seconds - after this action is as max iterations
41  ClpMaxSeconds,
42  /// Tolerance to use in presolve
43  ClpPresolveTolerance,
44  /** Just a marker, so that we can allocate a static sized array to store
45      parameters. */
46  ClpLastDblParam
47};
48
49
50enum ClpStrParam {
51  /** Name of the problem. This is the found on the Name card of
52      an mps file. */
53  ClpProbName = 0,
54  /** Just a marker, so that we can allocate a static sized array to store
55      parameters. */
56  ClpLastStrParam
57};
58
59/// Copy (I don't like complexity of Coin version)
60template <class T> inline void
61ClpDisjointCopyN( const T * array, const int size, T * newArray)
62{
63  memcpy((void *) newArray,array,size*sizeof(T));
64}
65/// And set
66template <class T> inline void
67ClpFillN( T * array, const int size, T value)
68{
69  int i;
70  for (i=0;i<size;i++)
71    array[i]=value;
72}
73/// This returns a non const array filled with input from scalar or actual array
74template <class T> inline T*
75ClpCopyOfArray( const T * array, const int size, T value)
76{
77  T * arrayNew = new T[size];
78  if (array) 
79    ClpDisjointCopyN(array,size,arrayNew);
80  else
81    ClpFillN ( arrayNew, size,value);
82  return arrayNew;
83}
84
85/// This returns a non const array filled with actual array (or NULL)
86template <class T> inline T*
87ClpCopyOfArray( const T * array, const int size)
88{
89  if (array) {
90    T * arrayNew = new T[size];
91    ClpDisjointCopyN(array,size,arrayNew);
92    return arrayNew;
93  } else {
94    return NULL;
95  }
96}
97#endif
Note: See TracBrowser for help on using the repository browser.