Browse code

created a new repository for lpsymphony (v1.3.0)

vladchimescu authored on 05/03/2017 20:30:36
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,1307 @@
1
+/* $Id: ClpModel.hpp 2074 2014-12-10 09:43:54Z forrest $ */
2
+// Copyright (C) 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 ClpModel_H
7
+#define ClpModel_H
8
+
9
+#include "ClpConfig.h"
10
+
11
+#include <iostream>
12
+#include <cassert>
13
+#include <cmath>
14
+#include <vector>
15
+#include <string>
16
+//#ifndef COIN_USE_CLP
17
+//#define COIN_USE_CLP
18
+//#endif
19
+#include "ClpPackedMatrix.hpp"
20
+#include "CoinMessageHandler.hpp"
21
+#include "CoinHelperFunctions.hpp"
22
+#include "CoinTypes.hpp"
23
+#include "CoinFinite.hpp"
24
+#include "ClpParameters.hpp"
25
+#include "ClpObjective.hpp"
26
+class ClpEventHandler;
27
+/** This is the base class for Linear and quadratic Models
28
+    This knows nothing about the algorithm, but it seems to
29
+    have a reasonable amount of information
30
+
31
+    I would welcome suggestions for what should be in this and
32
+    how it relates to OsiSolverInterface.  Some methods look
33
+    very similar.
34
+
35
+*/
36
+class CoinBuild;
37
+class CoinModel;
38
+class ClpModel {
39
+
40
+public:
41
+
42
+     /**@name Constructors and destructor
43
+        Note - copy methods copy ALL data so can chew up memory
44
+        until other copy is freed
45
+      */
46
+     //@{
47
+     /// Default constructor
48
+     ClpModel (bool emptyMessages = false  );
49
+
50
+     /** Copy constructor. May scale depending on mode
51
+         -1 leave mode as is
52
+         0 -off, 1 equilibrium, 2 geometric, 3, auto, 4 auto-but-as-initialSolve-in-bab
53
+     */
54
+     ClpModel(const ClpModel & rhs, int scalingMode = -1);
55
+     /// Assignment operator. This copies the data
56
+     ClpModel & operator=(const ClpModel & rhs);
57
+     /** Subproblem constructor.  A subset of whole model is created from the
58
+         row and column lists given.  The new order is given by list order and
59
+         duplicates are allowed.  Name and integer information can be dropped
60
+     */
61
+     ClpModel (const ClpModel * wholeModel,
62
+               int numberRows, const int * whichRows,
63
+               int numberColumns, const int * whichColumns,
64
+               bool dropNames = true, bool dropIntegers = true);
65
+     /// Destructor
66
+     ~ClpModel (  );
67
+     //@}
68
+
69
+     /**@name Load model - loads some stuff and initializes others */
70
+     //@{
71
+     /** Loads a problem (the constraints on the
72
+         rows are given by lower and upper bounds). If a pointer is 0 then the
73
+         following values are the default:
74
+         <ul>
75
+           <li> <code>colub</code>: all columns have upper bound infinity
76
+           <li> <code>collb</code>: all columns have lower bound 0
77
+           <li> <code>rowub</code>: all rows have upper bound infinity
78
+           <li> <code>rowlb</code>: all rows have lower bound -infinity
79
+       <li> <code>obj</code>: all variables have 0 objective coefficient
80
+         </ul>
81
+     */
82
+     void loadProblem (  const ClpMatrixBase& matrix,
83
+                         const double* collb, const double* colub,
84
+                         const double* obj,
85
+                         const double* rowlb, const double* rowub,
86
+                         const double * rowObjective = NULL);
87
+     void loadProblem (  const CoinPackedMatrix& matrix,
88
+                         const double* collb, const double* colub,
89
+                         const double* obj,
90
+                         const double* rowlb, const double* rowub,
91
+                         const double * rowObjective = NULL);
92
+
93
+     /** Just like the other loadProblem() method except that the matrix is
94
+       given in a standard column major ordered format (without gaps). */
95
+     void loadProblem (  const int numcols, const int numrows,
96
+                         const CoinBigIndex* start, const int* index,
97
+                         const double* value,
98
+                         const double* collb, const double* colub,
99
+                         const double* obj,
100
+                         const double* rowlb, const double* rowub,
101
+                         const double * rowObjective = NULL);
102
+     /** This loads a model from a coinModel object - returns number of errors.
103
+
104
+         modelObject not const as may be changed as part of process
105
+         If tryPlusMinusOne then will try adding as +-1 matrix
106
+     */
107
+     int loadProblem (  CoinModel & modelObject, bool tryPlusMinusOne = false);
108
+     /// This one is for after presolve to save memory
109
+     void loadProblem (  const int numcols, const int numrows,
110
+                         const CoinBigIndex* start, const int* index,
111
+                         const double* value, const int * length,
112
+                         const double* collb, const double* colub,
113
+                         const double* obj,
114
+                         const double* rowlb, const double* rowub,
115
+                         const double * rowObjective = NULL);
116
+     /** Load up quadratic objective.  This is stored as a CoinPackedMatrix */
117
+     void loadQuadraticObjective(const int numberColumns,
118
+                                 const CoinBigIndex * start,
119
+                                 const int * column, const double * element);
120
+     void loadQuadraticObjective (  const CoinPackedMatrix& matrix);
121
+     /// Get rid of quadratic objective
122
+     void deleteQuadraticObjective();
123
+     /// This just loads up a row objective
124
+     void setRowObjective(const double * rowObjective);
125
+     /// Read an mps file from the given filename
126
+     int readMps(const char *filename,
127
+                 bool keepNames = false,
128
+                 bool ignoreErrors = false);
129
+     /// Read GMPL files from the given filenames
130
+     int readGMPL(const char *filename, const char * dataName,
131
+                  bool keepNames = false);
132
+     /// Copy in integer informations
133
+     void copyInIntegerInformation(const char * information);
134
+     /// Drop integer informations
135
+     void deleteIntegerInformation();
136
+     /** Set the index-th variable to be a continuous variable */
137
+     void setContinuous(int index);
138
+     /** Set the index-th variable to be an integer variable */
139
+     void setInteger(int index);
140
+     /** Return true if the index-th variable is an integer variable */
141
+     bool isInteger(int index) const;
142
+     /// Resizes rim part of model
143
+     void resize (int newNumberRows, int newNumberColumns);
144
+     /// Deletes rows
145
+     void deleteRows(int number, const int * which);
146
+     /// Add one row
147
+     void addRow(int numberInRow, const int * columns,
148
+                 const double * elements, double rowLower = -COIN_DBL_MAX,
149
+                 double rowUpper = COIN_DBL_MAX);
150
+     /// Add rows
151
+     void addRows(int number, const double * rowLower,
152
+                  const double * rowUpper,
153
+                  const CoinBigIndex * rowStarts, const int * columns,
154
+                  const double * elements);
155
+     /// Add rows
156
+     void addRows(int number, const double * rowLower,
157
+                  const double * rowUpper,
158
+                  const CoinBigIndex * rowStarts, const int * rowLengths,
159
+                  const int * columns,
160
+                  const double * elements);
161
+#ifndef CLP_NO_VECTOR
162
+     void addRows(int number, const double * rowLower,
163
+                  const double * rowUpper,
164
+                  const CoinPackedVectorBase * const * rows);
165
+#endif
166
+     /** Add rows from a build object.
167
+         If tryPlusMinusOne then will try adding as +-1 matrix
168
+         if no matrix exists.
169
+         Returns number of errors e.g. duplicates
170
+     */
171
+     int addRows(const CoinBuild & buildObject, bool tryPlusMinusOne = false,
172
+                 bool checkDuplicates = true);
173
+     /** Add rows from a model object.  returns
174
+         -1 if object in bad state (i.e. has column information)
175
+         otherwise number of errors.
176
+
177
+         modelObject non const as can be regularized as part of build
178
+         If tryPlusMinusOne then will try adding as +-1 matrix
179
+         if no matrix exists.
180
+     */
181
+     int addRows(CoinModel & modelObject, bool tryPlusMinusOne = false,
182
+                 bool checkDuplicates = true);
183
+
184
+     /// Deletes columns
185
+     void deleteColumns(int number, const int * which);
186
+     /// Deletes rows AND columns (keeps old sizes)
187
+     void deleteRowsAndColumns(int numberRows, const int * whichRows,
188
+			       int numberColumns, const int * whichColumns);
189
+     /// Add one column
190
+     void addColumn(int numberInColumn,
191
+                    const int * rows,
192
+                    const double * elements,
193
+                    double columnLower = 0.0,
194
+                    double  columnUpper = COIN_DBL_MAX,
195
+                    double  objective = 0.0);
196
+     /// Add columns
197
+     void addColumns(int number, const double * columnLower,
198
+                     const double * columnUpper,
199
+                     const double * objective,
200
+                     const CoinBigIndex * columnStarts, const int * rows,
201
+                     const double * elements);
202
+     void addColumns(int number, const double * columnLower,
203
+                     const double * columnUpper,
204
+                     const double * objective,
205
+                     const CoinBigIndex * columnStarts, const int * columnLengths,
206
+                     const int * rows,
207
+                     const double * elements);
208
+#ifndef CLP_NO_VECTOR
209
+     void addColumns(int number, const double * columnLower,
210
+                     const double * columnUpper,
211
+                     const double * objective,
212
+                     const CoinPackedVectorBase * const * columns);
213
+#endif
214
+     /** Add columns from a build object
215
+         If tryPlusMinusOne then will try adding as +-1 matrix
216
+         if no matrix exists.
217
+         Returns number of errors e.g. duplicates
218
+     */
219
+     int addColumns(const CoinBuild & buildObject, bool tryPlusMinusOne = false,
220
+                    bool checkDuplicates = true);
221
+     /** Add columns from a model object.  returns
222
+         -1 if object in bad state (i.e. has row information)
223
+         otherwise number of errors
224
+         modelObject non const as can be regularized as part of build
225
+         If tryPlusMinusOne then will try adding as +-1 matrix
226
+         if no matrix exists.
227
+     */
228
+     int addColumns(CoinModel & modelObject, bool tryPlusMinusOne = false,
229
+                    bool checkDuplicates = true);
230
+     /// Modify one element of a matrix
231
+     inline void modifyCoefficient(int row, int column, double newElement,
232
+                                   bool keepZero = false) {
233
+          matrix_->modifyCoefficient(row, column, newElement, keepZero);
234
+     }
235
+     /** Change row lower bounds */
236
+     void chgRowLower(const double * rowLower);
237
+     /** Change row upper bounds */
238
+     void chgRowUpper(const double * rowUpper);
239
+     /** Change column lower bounds */
240
+     void chgColumnLower(const double * columnLower);
241
+     /** Change column upper bounds */
242
+     void chgColumnUpper(const double * columnUpper);
243
+     /** Change objective coefficients */
244
+     void chgObjCoefficients(const double * objIn);
245
+     /** Borrow model.  This is so we don't have to copy large amounts
246
+         of data around.  It assumes a derived class wants to overwrite
247
+         an empty model with a real one - while it does an algorithm */
248
+     void borrowModel(ClpModel & otherModel);
249
+     /** Return model - nulls all arrays so can be deleted safely
250
+         also updates any scalars */
251
+     void returnModel(ClpModel & otherModel);
252
+
253
+     /// Create empty ClpPackedMatrix
254
+     void createEmptyMatrix();
255
+     /** Really clean up matrix (if ClpPackedMatrix).
256
+         a) eliminate all duplicate AND small elements in matrix
257
+         b) remove all gaps and set extraGap_ and extraMajor_ to 0.0
258
+         c) reallocate arrays and make max lengths equal to lengths
259
+         d) orders elements
260
+         returns number of elements eliminated or -1 if not ClpPackedMatrix
261
+     */
262
+     int cleanMatrix(double threshold = 1.0e-20);
263
+     /// Copy contents - resizing if necessary - otherwise re-use memory
264
+     void copy(const ClpMatrixBase * from, ClpMatrixBase * & to);
265
+#ifndef CLP_NO_STD
266
+     /// Drops names - makes lengthnames 0 and names empty
267
+     void dropNames();
268
+     /// Copies in names
269
+     void copyNames(const std::vector<std::string> & rowNames,
270
+                    const std::vector<std::string> & columnNames);
271
+     /// Copies in Row names - modifies names first .. last-1
272
+     void copyRowNames(const std::vector<std::string> & rowNames, int first, int last);
273
+     /// Copies in Column names - modifies names first .. last-1
274
+     void copyColumnNames(const std::vector<std::string> & columnNames, int first, int last);
275
+     /// Copies in Row names - modifies names first .. last-1
276
+     void copyRowNames(const char * const * rowNames, int first, int last);
277
+     /// Copies in Column names - modifies names first .. last-1
278
+     void copyColumnNames(const char * const * columnNames, int first, int last);
279
+     /// Set name of row
280
+     void setRowName(int rowIndex, std::string & name) ;
281
+     /// Set name of col
282
+     void setColumnName(int colIndex, std::string & name) ;
283
+#endif
284
+     /** Find a network subset.
285
+         rotate array should be numberRows.  On output
286
+         -1 not in network
287
+          0 in network as is
288
+          1 in network with signs swapped
289
+         Returns number of network rows
290
+     */
291
+     int findNetwork(char * rotate, double fractionNeeded = 0.75);
292
+     /** This creates a coinModel object
293
+     */
294
+     CoinModel * createCoinModel() const;
295
+
296
+     /** Write the problem in MPS format to the specified file.
297
+
298
+     Row and column names may be null.
299
+     formatType is
300
+     <ul>
301
+       <li> 0 - normal
302
+       <li> 1 - extra accuracy
303
+       <li> 2 - IEEE hex
304
+     </ul>
305
+
306
+     Returns non-zero on I/O error
307
+     */
308
+     int writeMps(const char *filename,
309
+                  int formatType = 0, int numberAcross = 2,
310
+                  double objSense = 0.0) const ;
311
+     //@}
312
+     /**@name gets and sets */
313
+     //@{
314
+     /// Number of rows
315
+     inline int numberRows() const {
316
+          return numberRows_;
317
+     }
318
+     inline int getNumRows() const {
319
+          return numberRows_;
320
+     }
321
+     /// Number of columns
322
+     inline int getNumCols() const {
323
+          return numberColumns_;
324
+     }
325
+     inline int numberColumns() const {
326
+          return numberColumns_;
327
+     }
328
+     /// Primal tolerance to use
329
+     inline double primalTolerance() const {
330
+          return dblParam_[ClpPrimalTolerance];
331
+     }
332
+     void setPrimalTolerance( double value) ;
333
+     /// Dual tolerance to use
334
+     inline double dualTolerance() const  {
335
+          return dblParam_[ClpDualTolerance];
336
+     }
337
+     void setDualTolerance( double value) ;
338
+     /// Primal objective limit
339
+     inline double primalObjectiveLimit() const {
340
+          return dblParam_[ClpPrimalObjectiveLimit];
341
+     }
342
+     void setPrimalObjectiveLimit(double value);
343
+     /// Dual objective limit
344
+     inline double dualObjectiveLimit() const {
345
+          return dblParam_[ClpDualObjectiveLimit];
346
+     }
347
+     void setDualObjectiveLimit(double value);
348
+     /// Objective offset
349
+     inline double objectiveOffset() const {
350
+          return dblParam_[ClpObjOffset];
351
+     }
352
+     void setObjectiveOffset(double value);
353
+     /// Presolve tolerance to use
354
+     inline double presolveTolerance() const {
355
+          return dblParam_[ClpPresolveTolerance];
356
+     }
357
+#ifndef CLP_NO_STD
358
+     inline const std::string & problemName() const {
359
+          return strParam_[ClpProbName];
360
+     }
361
+#endif
362
+     /// Number of iterations
363
+     inline int numberIterations() const  {
364
+          return numberIterations_;
365
+     }
366
+     inline int getIterationCount() const {
367
+          return numberIterations_;
368
+     }
369
+     inline void setNumberIterations(int numberIterationsNew) {
370
+          numberIterations_ = numberIterationsNew;
371
+     }
372
+     /** Solve type - 1 simplex, 2 simplex interface, 3 Interior.*/
373
+     inline int solveType() const {
374
+          return solveType_;
375
+     }
376
+     inline void setSolveType(int type) {
377
+          solveType_ = type;
378
+     }
379
+     /// Maximum number of iterations
380
+     inline int maximumIterations() const {
381
+          return intParam_[ClpMaxNumIteration];
382
+     }
383
+     void setMaximumIterations(int value);
384
+     /// Maximum time in seconds (from when set called)
385
+     inline double maximumSeconds() const {
386
+          return dblParam_[ClpMaxSeconds];
387
+     }
388
+     void setMaximumSeconds(double value);
389
+     void setMaximumWallSeconds(double value);
390
+     /// Returns true if hit maximum iterations (or time)
391
+     bool hitMaximumIterations() const;
392
+     /** Status of problem:
393
+         -1 - unknown e.g. before solve or if postSolve says not optimal
394
+         0 - optimal
395
+         1 - primal infeasible
396
+         2 - dual infeasible
397
+         3 - stopped on iterations or time
398
+         4 - stopped due to errors
399
+         5 - stopped by event handler (virtual int ClpEventHandler::event())
400
+     */
401
+     inline int status() const            {
402
+          return problemStatus_;
403
+     }
404
+     inline int problemStatus() const            {
405
+          return problemStatus_;
406
+     }
407
+     /// Set problem status
408
+     inline void setProblemStatus(int problemStatusNew) {
409
+          problemStatus_ = problemStatusNew;
410
+     }
411
+     /** Secondary status of problem - may get extended
412
+         0 - none
413
+         1 - primal infeasible because dual limit reached OR (probably primal
414
+         infeasible but can't prove it  - main status was 4)
415
+         2 - scaled problem optimal - unscaled problem has primal infeasibilities
416
+         3 - scaled problem optimal - unscaled problem has dual infeasibilities
417
+         4 - scaled problem optimal - unscaled problem has primal and dual infeasibilities
418
+         5 - giving up in primal with flagged variables
419
+         6 - failed due to empty problem check
420
+         7 - postSolve says not optimal
421
+         8 - failed due to bad element check
422
+         9 - status was 3 and stopped on time
423
+	 10 - status was 3 but stopped as primal feasible
424
+         100 up - translation of enum from ClpEventHandler
425
+     */
426
+     inline int secondaryStatus() const            {
427
+          return secondaryStatus_;
428
+     }
429
+     inline void setSecondaryStatus(int newstatus) {
430
+          secondaryStatus_ = newstatus;
431
+     }
432
+     /// Are there a numerical difficulties?
433
+     inline bool isAbandoned() const             {
434
+          return problemStatus_ == 4;
435
+     }
436
+     /// Is optimality proven?
437
+     inline bool isProvenOptimal() const         {
438
+          return problemStatus_ == 0;
439
+     }
440
+     /// Is primal infeasiblity proven?
441
+     inline bool isProvenPrimalInfeasible() const {
442
+          return problemStatus_ == 1;
443
+     }
444
+     /// Is dual infeasiblity proven?
445
+     inline bool isProvenDualInfeasible() const  {
446
+          return problemStatus_ == 2;
447
+     }
448
+     /// Is the given primal objective limit reached?
449
+     bool isPrimalObjectiveLimitReached() const ;
450
+     /// Is the given dual objective limit reached?
451
+     bool isDualObjectiveLimitReached() const ;
452
+     /// Iteration limit reached?
453
+     inline bool isIterationLimitReached() const {
454
+          return problemStatus_ == 3;
455
+     }
456
+     /// Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore
457
+     inline double optimizationDirection() const {
458
+          return  optimizationDirection_;
459
+     }
460
+     inline double getObjSense() const    {
461
+          return optimizationDirection_;
462
+     }
463
+     void setOptimizationDirection(double value);
464
+     /// Primal row solution
465
+     inline double * primalRowSolution() const    {
466
+          return rowActivity_;
467
+     }
468
+     inline const double * getRowActivity() const {
469
+          return rowActivity_;
470
+     }
471
+     /// Primal column solution
472
+     inline double * primalColumnSolution() const {
473
+          return columnActivity_;
474
+     }
475
+     inline const double * getColSolution() const {
476
+          return columnActivity_;
477
+     }
478
+     inline void setColSolution(const double * input) {
479
+          memcpy(columnActivity_, input, numberColumns_ * sizeof(double));
480
+     }
481
+     /// Dual row solution
482
+     inline double * dualRowSolution() const      {
483
+          return dual_;
484
+     }
485
+     inline const double * getRowPrice() const    {
486
+          return dual_;
487
+     }
488
+     /// Reduced costs
489
+     inline double * dualColumnSolution() const   {
490
+          return reducedCost_;
491
+     }
492
+     inline const double * getReducedCost() const {
493
+          return reducedCost_;
494
+     }
495
+     /// Row lower
496
+     inline double* rowLower() const              {
497
+          return rowLower_;
498
+     }
499
+     inline const double* getRowLower() const     {
500
+          return rowLower_;
501
+     }
502
+     /// Row upper
503
+     inline double* rowUpper() const              {
504
+          return rowUpper_;
505
+     }
506
+     inline const double* getRowUpper() const     {
507
+          return rowUpper_;
508
+     }
509
+     //-------------------------------------------------------------------------
510
+     /**@name Changing bounds on variables and constraints */
511
+     //@{
512
+     /** Set an objective function coefficient */
513
+     void setObjectiveCoefficient( int elementIndex, double elementValue );
514
+     /** Set an objective function coefficient */
515
+     inline void setObjCoeff( int elementIndex, double elementValue ) {
516
+          setObjectiveCoefficient( elementIndex, elementValue);
517
+     }
518
+
519
+     /** Set a single column lower bound<br>
520
+         Use -DBL_MAX for -infinity. */
521
+     void setColumnLower( int elementIndex, double elementValue );
522
+
523
+     /** Set a single column upper bound<br>
524
+         Use DBL_MAX for infinity. */
525
+     void setColumnUpper( int elementIndex, double elementValue );
526
+
527
+     /** Set a single column lower and upper bound */
528
+     void setColumnBounds( int elementIndex,
529
+                           double lower, double upper );
530
+
531
+     /** Set the bounds on a number of columns simultaneously<br>
532
+         The default implementation just invokes setColLower() and
533
+         setColUpper() over and over again.
534
+         @param indexFirst,indexLast pointers to the beginning and after the
535
+            end of the array of the indices of the variables whose
536
+        <em>either</em> bound changes
537
+         @param boundList the new lower/upper bound pairs for the variables
538
+     */
539
+     void setColumnSetBounds(const int* indexFirst,
540
+                             const int* indexLast,
541
+                             const double* boundList);
542
+
543
+     /** Set a single column lower bound<br>
544
+         Use -DBL_MAX for -infinity. */
545
+     inline void setColLower( int elementIndex, double elementValue ) {
546
+          setColumnLower(elementIndex, elementValue);
547
+     }
548
+     /** Set a single column upper bound<br>
549
+         Use DBL_MAX for infinity. */
550
+     inline void setColUpper( int elementIndex, double elementValue ) {
551
+          setColumnUpper(elementIndex, elementValue);
552
+     }
553
+
554
+     /** Set a single column lower and upper bound */
555
+     inline void setColBounds( int elementIndex,
556
+                               double lower, double upper ) {
557
+          setColumnBounds(elementIndex, lower, upper);
558
+     }
559
+
560
+     /** Set the bounds on a number of columns simultaneously<br>
561
+         @param indexFirst,indexLast pointers to the beginning and after the
562
+            end of the array of the indices of the variables whose
563
+        <em>either</em> bound changes
564
+         @param boundList the new lower/upper bound pairs for the variables
565
+     */
566
+     inline void setColSetBounds(const int* indexFirst,
567
+                                 const int* indexLast,
568
+                                 const double* boundList) {
569
+          setColumnSetBounds(indexFirst, indexLast, boundList);
570
+     }
571
+
572
+     /** Set a single row lower bound<br>
573
+         Use -DBL_MAX for -infinity. */
574
+     void setRowLower( int elementIndex, double elementValue );
575
+
576
+     /** Set a single row upper bound<br>
577
+         Use DBL_MAX for infinity. */
578
+     void setRowUpper( int elementIndex, double elementValue ) ;
579
+
580
+     /** Set a single row lower and upper bound */
581
+     void setRowBounds( int elementIndex,
582
+                        double lower, double upper ) ;
583
+
584
+     /** Set the bounds on a number of rows simultaneously<br>
585
+         @param indexFirst,indexLast pointers to the beginning and after the
586
+            end of the array of the indices of the constraints whose
587
+        <em>either</em> bound changes
588
+         @param boundList the new lower/upper bound pairs for the constraints
589
+     */
590
+     void setRowSetBounds(const int* indexFirst,
591
+                          const int* indexLast,
592
+                          const double* boundList);
593
+
594
+     //@}
595
+     /// Scaling
596
+     inline const double * rowScale() const {
597
+          return rowScale_;
598
+     }
599
+     inline const double * columnScale() const {
600
+          return columnScale_;
601
+     }
602
+     inline const double * inverseRowScale() const {
603
+          return inverseRowScale_;
604
+     }
605
+     inline const double * inverseColumnScale() const {
606
+          return inverseColumnScale_;
607
+     }
608
+     inline double * mutableRowScale() const {
609
+          return rowScale_;
610
+     }
611
+     inline double * mutableColumnScale() const {
612
+          return columnScale_;
613
+     }
614
+     inline double * mutableInverseRowScale() const {
615
+          return inverseRowScale_;
616
+     }
617
+     inline double * mutableInverseColumnScale() const {
618
+          return inverseColumnScale_;
619
+     }
620
+     inline double * swapRowScale(double * newScale) {
621
+          double * oldScale = rowScale_;
622
+	  rowScale_ = newScale;
623
+          return oldScale;
624
+     }
625
+     void setRowScale(double * scale) ;
626
+     void setColumnScale(double * scale);
627
+     /// Scaling of objective
628
+     inline double objectiveScale() const {
629
+          return objectiveScale_;
630
+     }
631
+     inline void setObjectiveScale(double value) {
632
+          objectiveScale_ = value;
633
+     }
634
+     /// Scaling of rhs and bounds
635
+     inline double rhsScale() const {
636
+          return rhsScale_;
637
+     }
638
+     inline void setRhsScale(double value) {
639
+          rhsScale_ = value;
640
+     }
641
+     /// Sets or unsets scaling, 0 -off, 1 equilibrium, 2 geometric, 3 auto, 4 auto-but-as-initialSolve-in-bab
642
+     void scaling(int mode = 1);
643
+     /** If we constructed a "really" scaled model then this reverses the operation.
644
+         Quantities may not be exactly as they were before due to rounding errors */
645
+     void unscale();
646
+     /// Gets scalingFlag
647
+     inline int scalingFlag() const {
648
+          return scalingFlag_;
649
+     }
650
+     /// Objective
651
+     inline double * objective() const {
652
+          if (objective_) {
653
+               double offset;
654
+               return objective_->gradient(NULL, NULL, offset, false);
655
+          } else {
656
+               return NULL;
657
+          }
658
+     }
659
+     inline double * objective(const double * solution, double & offset, bool refresh = true) const {
660
+          offset = 0.0;
661
+          if (objective_) {
662
+               return objective_->gradient(NULL, solution, offset, refresh);
663
+          } else {
664
+               return NULL;
665
+          }
666
+     }
667
+     inline const double * getObjCoefficients() const {
668
+          if (objective_) {
669
+               double offset;
670
+               return objective_->gradient(NULL, NULL, offset, false);
671
+          } else {
672
+               return NULL;
673
+          }
674
+     }
675
+     /// Row Objective
676
+     inline double * rowObjective() const         {
677
+          return rowObjective_;
678
+     }
679
+     inline const double * getRowObjCoefficients() const {
680
+          return rowObjective_;
681
+     }
682
+     /// Column Lower
683
+     inline double * columnLower() const          {
684
+          return columnLower_;
685
+     }
686
+     inline const double * getColLower() const    {
687
+          return columnLower_;
688
+     }
689
+     /// Column Upper
690
+     inline double * columnUpper() const          {
691
+          return columnUpper_;
692
+     }
693
+     inline const double * getColUpper() const    {
694
+          return columnUpper_;
695
+     }
696
+     /// Matrix (if not ClpPackedmatrix be careful about memory leak
697
+     inline CoinPackedMatrix * matrix() const {
698
+          if ( matrix_ == NULL ) return NULL;
699
+          else return matrix_->getPackedMatrix();
700
+     }
701
+     /// Number of elements in matrix
702
+     inline int getNumElements() const {
703
+          return matrix_->getNumElements();
704
+     }
705
+     /** Small element value - elements less than this set to zero,
706
+        default is 1.0e-20 */
707
+     inline double getSmallElementValue() const {
708
+          return smallElement_;
709
+     }
710
+     inline void setSmallElementValue(double value) {
711
+          smallElement_ = value;
712
+     }
713
+     /// Row Matrix
714
+     inline ClpMatrixBase * rowCopy() const       {
715
+          return rowCopy_;
716
+     }
717
+     /// Set new row matrix
718
+     void setNewRowCopy(ClpMatrixBase * newCopy);
719
+     /// Clp Matrix
720
+     inline ClpMatrixBase * clpMatrix() const     {
721
+          return matrix_;
722
+     }
723
+     /// Scaled ClpPackedMatrix
724
+     inline ClpPackedMatrix * clpScaledMatrix() const     {
725
+          return scaledMatrix_;
726
+     }
727
+     /// Sets pointer to scaled ClpPackedMatrix
728
+     inline void setClpScaledMatrix(ClpPackedMatrix * scaledMatrix) {
729
+          delete scaledMatrix_;
730
+          scaledMatrix_ = scaledMatrix;
731
+     }
732
+     /// Swaps pointer to scaled ClpPackedMatrix
733
+     inline ClpPackedMatrix * swapScaledMatrix(ClpPackedMatrix * scaledMatrix) {
734
+          ClpPackedMatrix * oldMatrix = scaledMatrix_;
735
+          scaledMatrix_ = scaledMatrix;
736
+	  return oldMatrix;
737
+     }
738
+     /** Replace Clp Matrix (current is not deleted unless told to
739
+         and new is used)
740
+         So up to user to delete current.  This was used where
741
+         matrices were being rotated. ClpModel takes ownership.
742
+     */
743
+     void replaceMatrix(ClpMatrixBase * matrix, bool deleteCurrent = false);
744
+     /** Replace Clp Matrix (current is not deleted unless told to
745
+         and new is used) So up to user to delete current.  This was used where
746
+         matrices were being rotated.  This version changes CoinPackedMatrix
747
+         to ClpPackedMatrix.  ClpModel takes ownership.
748
+     */
749
+     inline void replaceMatrix(CoinPackedMatrix * newmatrix,
750
+                               bool deleteCurrent = false) {
751
+          replaceMatrix(new ClpPackedMatrix(newmatrix), deleteCurrent);
752
+     }
753
+     /// Objective value
754
+     inline double objectiveValue() const {
755
+          return objectiveValue_ * optimizationDirection_ - dblParam_[ClpObjOffset];
756
+     }
757
+     inline void setObjectiveValue(double value) {
758
+          objectiveValue_ = (value + dblParam_[ClpObjOffset]) / optimizationDirection_;
759
+     }
760
+     inline double getObjValue() const {
761
+          return objectiveValue_ * optimizationDirection_ - dblParam_[ClpObjOffset];
762
+     }
763
+     /// Integer information
764
+     inline char * integerInformation() const     {
765
+          return integerType_;
766
+     }
767
+     /** Infeasibility/unbounded ray (NULL returned if none/wrong)
768
+         Up to user to use delete [] on these arrays.  */
769
+     double * infeasibilityRay(bool fullRay=false) const;
770
+     double * unboundedRay() const;
771
+     /// For advanced users - no need to delete - sign not changed
772
+     inline double * ray() const
773
+     { return ray_;}
774
+     /// just test if infeasibility or unbounded Ray exists
775
+     inline bool rayExists() const {
776
+         return (ray_!=NULL);
777
+     }
778
+     /// just delete ray if exists
779
+     inline void deleteRay() {
780
+         delete [] ray_;
781
+         ray_=NULL;
782
+     }
783
+	 /// Access internal ray storage. Users should call infeasibilityRay() or unboundedRay() instead.
784
+	 inline const double * internalRay() const {
785
+		 return ray_;
786
+	 }
787
+     /// See if status (i.e. basis) array exists (partly for OsiClp)
788
+     inline bool statusExists() const {
789
+          return (status_ != NULL);
790
+     }
791
+     /// Return address of status (i.e. basis) array (char[numberRows+numberColumns])
792
+     inline unsigned char *  statusArray() const {
793
+          return status_;
794
+     }
795
+     /** Return copy of status (i.e. basis) array (char[numberRows+numberColumns]),
796
+         use delete [] */
797
+     unsigned char *  statusCopy() const;
798
+     /// Copy in status (basis) vector
799
+     void copyinStatus(const unsigned char * statusArray);
800
+
801
+     /// User pointer for whatever reason
802
+     inline void setUserPointer (void * pointer) {
803
+          userPointer_ = pointer;
804
+     }
805
+     inline void * getUserPointer () const {
806
+          return userPointer_;
807
+     }
808
+     /// Trusted user pointer
809
+     inline void setTrustedUserPointer (ClpTrustedData * pointer) {
810
+          trustedUserPointer_ = pointer;
811
+     }
812
+     inline ClpTrustedData * getTrustedUserPointer () const {
813
+          return trustedUserPointer_;
814
+     }
815
+     /// What has changed in model (only for masochistic users)
816
+     inline int whatsChanged() const {
817
+          return whatsChanged_;
818
+     }
819
+     inline void setWhatsChanged(int value) {
820
+          whatsChanged_ = value;
821
+     }
822
+     /// Number of threads (not really being used)
823
+     inline int numberThreads() const {
824
+          return numberThreads_;
825
+     }
826
+     inline void setNumberThreads(int value) {
827
+          numberThreads_ = value;
828
+     }
829
+     //@}
830
+     /**@name Message handling */
831
+     //@{
832
+     /// Pass in Message handler (not deleted at end)
833
+     void passInMessageHandler(CoinMessageHandler * handler);
834
+     /// Pass in Message handler (not deleted at end) and return current
835
+     CoinMessageHandler * pushMessageHandler(CoinMessageHandler * handler,
836
+                                             bool & oldDefault);
837
+     /// back to previous message handler
838
+     void popMessageHandler(CoinMessageHandler * oldHandler, bool oldDefault);
839
+     /// Set language
840
+     void newLanguage(CoinMessages::Language language);
841
+     inline void setLanguage(CoinMessages::Language language) {
842
+          newLanguage(language);
843
+     }
844
+     /// Overrides message handler with a default one
845
+     void setDefaultMessageHandler();
846
+     /// Return handler
847
+     inline CoinMessageHandler * messageHandler() const       {
848
+          return handler_;
849
+     }
850
+     /// Return messages
851
+     inline CoinMessages messages() const                     {
852
+          return messages_;
853
+     }
854
+     /// Return pointer to messages
855
+     inline CoinMessages * messagesPointer()                  {
856
+          return & messages_;
857
+     }
858
+     /// Return Coin messages
859
+     inline CoinMessages coinMessages() const                  {
860
+          return coinMessages_;
861
+     }
862
+     /// Return pointer to Coin messages
863
+     inline CoinMessages * coinMessagesPointer()                  {
864
+          return & coinMessages_;
865
+     }
866
+     /** Amount of print out:
867
+         0 - none
868
+         1 - just final
869
+         2 - just factorizations
870
+         3 - as 2 plus a bit more
871
+         4 - verbose
872
+         above that 8,16,32 etc just for selective debug
873
+     */
874
+     inline void setLogLevel(int value)    {
875
+          handler_->setLogLevel(value);
876
+     }
877
+     inline int logLevel() const           {
878
+          return handler_->logLevel();
879
+     }
880
+     /// Return true if default handler
881
+     inline bool defaultHandler() const {
882
+          return defaultHandler_;
883
+     }
884
+     /// Pass in Event handler (cloned and deleted at end)
885
+     void passInEventHandler(const ClpEventHandler * eventHandler);
886
+     /// Event handler
887
+     inline ClpEventHandler * eventHandler() const {
888
+          return eventHandler_;
889
+     }
890
+     /// Thread specific random number generator
891
+     inline CoinThreadRandom * randomNumberGenerator() {
892
+          return &randomNumberGenerator_;
893
+     }
894
+     /// Thread specific random number generator
895
+     inline CoinThreadRandom & mutableRandomNumberGenerator() {
896
+          return randomNumberGenerator_;
897
+     }
898
+     /// Set seed for thread specific random number generator
899
+     inline void setRandomSeed(int value) {
900
+          randomNumberGenerator_.setSeed(value);
901
+     }
902
+     /// length of names (0 means no names0
903
+     inline int lengthNames() const {
904
+          return lengthNames_;
905
+     }
906
+#ifndef CLP_NO_STD
907
+     /// length of names (0 means no names0
908
+     inline void setLengthNames(int value) {
909
+          lengthNames_ = value;
910
+     }
911
+     /// Row names
912
+     inline const std::vector<std::string> * rowNames() const {
913
+          return &rowNames_;
914
+     }
915
+     inline const std::string& rowName(int iRow) const {
916
+          return rowNames_[iRow];
917
+     }
918
+     /// Return name or Rnnnnnnn
919
+     std::string getRowName(int iRow) const;
920
+     /// Column names
921
+     inline const std::vector<std::string> * columnNames() const {
922
+          return &columnNames_;
923
+     }
924
+     inline const std::string& columnName(int iColumn) const {
925
+          return columnNames_[iColumn];
926
+     }
927
+     /// Return name or Cnnnnnnn
928
+     std::string getColumnName(int iColumn) const;
929
+#endif
930
+     /// Objective methods
931
+     inline ClpObjective * objectiveAsObject() const {
932
+          return objective_;
933
+     }
934
+     void setObjective(ClpObjective * objective);
935
+     inline void setObjectivePointer(ClpObjective * newobjective) {
936
+          objective_ = newobjective;
937
+     }
938
+     /** Solve a problem with no elements - return status and
939
+         dual and primal infeasibilites */
940
+     int emptyProblem(int * infeasNumber = NULL, double * infeasSum = NULL, bool printMessage = true);
941
+
942
+     //@}
943
+
944
+     /**@name Matrix times vector methods
945
+        They can be faster if scalar is +- 1
946
+        These are covers so user need not worry about scaling
947
+        Also for simplex I am not using basic/non-basic split */
948
+     //@{
949
+     /** Return <code>y + A * x * scalar</code> in <code>y</code>.
950
+         @pre <code>x</code> must be of size <code>numColumns()</code>
951
+         @pre <code>y</code> must be of size <code>numRows()</code> */
952
+     void times(double scalar,
953
+                const double * x, double * y) const;
954
+     /** Return <code>y + x * scalar * A</code> in <code>y</code>.
955
+         @pre <code>x</code> must be of size <code>numRows()</code>
956
+         @pre <code>y</code> must be of size <code>numColumns()</code> */
957
+     void transposeTimes(double scalar,
958
+                         const double * x, double * y) const ;
959
+     //@}
960
+
961
+
962
+     //---------------------------------------------------------------------------
963
+     /**@name Parameter set/get methods
964
+
965
+        The set methods return true if the parameter was set to the given value,
966
+        false otherwise. There can be various reasons for failure: the given
967
+        parameter is not applicable for the solver (e.g., refactorization
968
+        frequency for the volume algorithm), the parameter is not yet implemented
969
+        for the solver or simply the value of the parameter is out of the range
970
+        the solver accepts. If a parameter setting call returns false check the
971
+        details of your solver.
972
+
973
+        The get methods return true if the given parameter is applicable for the
974
+        solver and is implemented. In this case the value of the parameter is
975
+        returned in the second argument. Otherwise they return false.
976
+
977
+        ** once it has been decided where solver sits this may be redone
978
+     */
979
+     //@{
980
+     /// Set an integer parameter
981
+     bool setIntParam(ClpIntParam key, int value) ;
982
+     /// Set an double parameter
983
+     bool setDblParam(ClpDblParam key, double value) ;
984
+#ifndef CLP_NO_STD
985
+     /// Set an string parameter
986
+     bool setStrParam(ClpStrParam key, const std::string & value);
987
+#endif
988
+     // Get an integer parameter
989
+     inline bool getIntParam(ClpIntParam key, int& value) const {
990
+          if (key < ClpLastIntParam) {
991
+               value = intParam_[key];
992
+               return true;
993
+          } else {
994
+               return false;
995
+          }
996
+     }
997
+     // Get an double parameter
998
+     inline bool getDblParam(ClpDblParam key, double& value) const {
999
+          if (key < ClpLastDblParam) {
1000
+               value = dblParam_[key];
1001
+               return true;
1002
+          } else {
1003
+               return false;
1004
+          }
1005
+     }
1006
+#ifndef CLP_NO_STD
1007
+     // Get a string parameter
1008
+     inline bool getStrParam(ClpStrParam key, std::string& value) const {
1009
+          if (key < ClpLastStrParam) {
1010
+               value = strParam_[key];
1011
+               return true;
1012
+          } else {
1013
+               return false;
1014
+          }
1015
+     }
1016
+#endif
1017
+     /// Create C++ lines to get to current state
1018
+     void generateCpp( FILE * fp);
1019
+     /** For advanced options
1020
+         1 - Don't keep changing infeasibility weight
1021
+         2 - Keep nonLinearCost round solves
1022
+         4 - Force outgoing variables to exact bound (primal)
1023
+         8 - Safe to use dense initial factorization
1024
+         16 -Just use basic variables for operation if column generation
1025
+         32 -Create ray even in BAB
1026
+         64 -Treat problem as feasible until last minute (i.e. minimize infeasibilities)
1027
+         128 - Switch off all matrix sanity checks
1028
+         256 - No row copy
1029
+         512 - If not in values pass, solution guaranteed, skip as much as possible
1030
+         1024 - In branch and bound
1031
+         2048 - Don't bother to re-factorize if < 20 iterations
1032
+         4096 - Skip some optimality checks
1033
+         8192 - Do Primal when cleaning up primal
1034
+         16384 - In fast dual (so we can switch off things)
1035
+         32768 - called from Osi
1036
+         65536 - keep arrays around as much as possible (also use maximumR/C)
1037
+         131072 - transposeTimes is -1.0 and can skip basic and fixed
1038
+         262144 - extra copy of scaled matrix
1039
+         524288 - Clp fast dual
1040
+         1048576 - don't need to finish dual (can return 3)
1041
+	 2097152 - zero costs!
1042
+	 4194304 - don't scale integer variables
1043
+	 8388608 - Idiot when not really sure about it
1044
+         NOTE - many applications can call Clp but there may be some short cuts
1045
+                which are taken which are not guaranteed safe from all applications.
1046
+                Vetted applications will have a bit set and the code may test this
1047
+                At present I expect a few such applications - if too many I will
1048
+                have to re-think.  It is up to application owner to change the code
1049
+                if she/he needs these short cuts.  I will not debug unless in Coin
1050
+                repository.  See COIN_CLP_VETTED comments.
1051
+         0x01000000 is Cbc (and in branch and bound)
1052
+         0x02000000 is in a different branch and bound
1053
+     */
1054
+     inline unsigned int specialOptions() const {
1055
+          return specialOptions_;
1056
+     }
1057
+     void setSpecialOptions(unsigned int value);
1058
+#define COIN_CBC_USING_CLP 0x01000000
1059
+     inline bool inCbcBranchAndBound() const {
1060
+          return (specialOptions_ & COIN_CBC_USING_CLP) != 0;
1061
+     }
1062
+     //@}
1063
+
1064
+     /**@name private or protected methods */
1065
+     //@{
1066
+protected:
1067
+     /// Does most of deletion (0 = all, 1 = most)
1068
+     void gutsOfDelete(int type);
1069
+     /** Does most of copying
1070
+         If trueCopy 0 then just points to arrays
1071
+         If -1 leaves as much as possible */
1072
+     void gutsOfCopy(const ClpModel & rhs, int trueCopy = 1);
1073
+     /// gets lower and upper bounds on rows
1074
+     void getRowBound(int iRow, double& lower, double& upper) const;
1075
+     /// puts in format I like - 4 array matrix - may make row copy
1076
+     void gutsOfLoadModel ( int numberRows, int numberColumns,
1077
+                            const double* collb, const double* colub,
1078
+                            const double* obj,
1079
+                            const double* rowlb, const double* rowub,
1080
+                            const double * rowObjective = NULL);
1081
+     /// Does much of scaling
1082
+     void gutsOfScaling();
1083
+     /// Objective value - always minimize
1084
+     inline double rawObjectiveValue() const {
1085
+          return objectiveValue_;
1086
+     }
1087
+     /// If we are using maximumRows_ and Columns_
1088
+     inline bool permanentArrays() const {
1089
+          return (specialOptions_ & 65536) != 0;
1090
+     }
1091
+     /// Start using maximumRows_ and Columns_
1092
+     void startPermanentArrays();
1093
+     /// Stop using maximumRows_ and Columns_
1094
+     void stopPermanentArrays();
1095
+     /// Create row names as char **
1096
+     const char * const * rowNamesAsChar() const;
1097
+     /// Create column names as char **
1098
+     const char * const * columnNamesAsChar() const;
1099
+     /// Delete char * version of names
1100
+     void deleteNamesAsChar(const char * const * names, int number) const;
1101
+     /// On stopped - sets secondary status
1102
+     void onStopped();
1103
+     //@}
1104
+
1105
+
1106
+////////////////// data //////////////////
1107
+protected:
1108
+
1109
+     /**@name data */
1110
+     //@{
1111
+     /// Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore
1112
+     double optimizationDirection_;
1113
+     /// Array of double parameters
1114
+     double dblParam_[ClpLastDblParam];
1115
+     /// Objective value
1116
+     double objectiveValue_;
1117
+     /// Small element value
1118
+     double smallElement_;
1119
+     /// Scaling of objective
1120
+     double objectiveScale_;
1121
+     /// Scaling of rhs and bounds
1122
+     double rhsScale_;
1123
+     /// Number of rows
1124
+     int numberRows_;
1125
+     /// Number of columns
1126
+     int numberColumns_;
1127
+     /// Row activities
1128
+     double * rowActivity_;
1129
+     /// Column activities
1130
+     double * columnActivity_;
1131
+     /// Duals
1132
+     double * dual_;
1133
+     /// Reduced costs
1134
+     double * reducedCost_;
1135
+     /// Row lower
1136
+     double* rowLower_;
1137
+     /// Row upper
1138
+     double* rowUpper_;
1139
+     /// Objective
1140
+     ClpObjective * objective_;
1141
+     /// Row Objective (? sign)  - may be NULL
1142
+     double * rowObjective_;
1143
+     /// Column Lower
1144
+     double * columnLower_;
1145
+     /// Column Upper
1146
+     double * columnUpper_;
1147
+     /// Packed matrix
1148
+     ClpMatrixBase * matrix_;
1149
+     /// Row copy if wanted
1150
+     ClpMatrixBase * rowCopy_;
1151
+     /// Scaled packed matrix
1152
+     ClpPackedMatrix * scaledMatrix_;
1153
+     /// Infeasible/unbounded ray
1154
+     double * ray_;
1155
+     /// Row scale factors for matrix
1156
+     double * rowScale_;
1157
+     /// Column scale factors
1158
+     double * columnScale_;
1159
+     /// Inverse row scale factors for matrix (end of rowScale_)
1160
+     double * inverseRowScale_;
1161
+     /// Inverse column scale factors for matrix (end of columnScale_)
1162
+     double * inverseColumnScale_;
1163
+     /** Scale flag, 0 none, 1 equilibrium, 2 geometric, 3, auto, 4 dynamic,
1164
+         5 geometric on rows */
1165
+     int scalingFlag_;
1166
+     /** Status (i.e. basis) Region.  I know that not all algorithms need a status
1167
+         array, but it made sense for things like crossover and put
1168
+         all permanent stuff in one place.  No assumption is made
1169
+         about what is in status array (although it might be good to reserve
1170
+         bottom 3 bits (i.e. 0-7 numeric) for classic status).  This
1171
+         is number of columns + number of rows long (in that order).
1172
+     */
1173
+     unsigned char * status_;
1174
+     /// Integer information
1175
+     char * integerType_;
1176
+     /// User pointer for whatever reason
1177
+     void * userPointer_;
1178
+     /// Trusted user pointer e.g. for heuristics
1179
+     ClpTrustedData * trustedUserPointer_;
1180
+     /// Array of integer parameters
1181
+     int intParam_[ClpLastIntParam];
1182
+     /// Number of iterations
1183
+     int numberIterations_;
1184
+     /** Solve type - 1 simplex, 2 simplex interface, 3 Interior.*/
1185
+     int solveType_;
1186
+     /** Whats changed since last solve.  This is a work in progress
1187
+         It is designed so careful people can make go faster.
1188
+         It is only used when startFinishOptions used in dual or primal.
1189
+         Bit 1 - number of rows/columns has not changed (so work arrays valid)
1190
+             2 - matrix has not changed
1191
+             4 - if matrix has changed only by adding rows
1192
+             8 - if matrix has changed only by adding columns
1193
+            16 - row lbs not changed
1194
+            32 - row ubs not changed
1195
+            64 - column objective not changed
1196
+           128 - column lbs not changed
1197
+           256 - column ubs not changed
1198
+       512 - basis not changed (up to user to set this to 0)
1199
+             top bits may be used internally
1200
+       shift by 65336 is 3 all same, 1 all except col bounds
1201
+     */
1202
+#define ROW_COLUMN_COUNTS_SAME 1
1203
+#define MATRIX_SAME 2
1204
+#define MATRIX_JUST_ROWS_ADDED 4
1205
+#define MATRIX_JUST_COLUMNS_ADDED 8
1206
+#define ROW_LOWER_SAME 16
1207
+#define ROW_UPPER_SAME 32
1208
+#define OBJECTIVE_SAME 64 
1209
+#define COLUMN_LOWER_SAME 128
1210
+#define COLUMN_UPPER_SAME 256
1211
+#define BASIS_SAME 512
1212
+#define ALL_SAME 65339
1213
+#define ALL_SAME_EXCEPT_COLUMN_BOUNDS 65337
1214
+     unsigned int whatsChanged_;
1215
+     /// Status of problem
1216
+     int problemStatus_;
1217
+     /// Secondary status of problem
1218
+     int secondaryStatus_;
1219
+     /// length of names (0 means no names)
1220
+     int lengthNames_;
1221
+     /// Number of threads (not very operational)
1222
+     int numberThreads_;
1223
+     /** For advanced options
1224
+         See get and set for meaning
1225
+     */
1226
+     unsigned int specialOptions_;
1227
+     /// Message handler
1228
+     CoinMessageHandler * handler_;
1229
+     /// Flag to say if default handler (so delete)
1230
+     bool defaultHandler_;
1231
+     /// Thread specific random number generator
1232
+     CoinThreadRandom randomNumberGenerator_;
1233
+     /// Event handler
1234
+     ClpEventHandler * eventHandler_;
1235
+#ifndef CLP_NO_STD
1236
+     /// Row names
1237
+     std::vector<std::string> rowNames_;
1238
+     /// Column names
1239
+     std::vector<std::string> columnNames_;
1240
+#endif
1241
+     /// Messages
1242
+     CoinMessages messages_;
1243
+     /// Coin messages
1244
+     CoinMessages coinMessages_;
1245
+     /// Maximum number of columns in model
1246
+     int maximumColumns_;
1247
+     /// Maximum number of rows in model
1248
+     int maximumRows_;
1249
+     /// Maximum number of columns (internal arrays) in model
1250
+     int maximumInternalColumns_;
1251
+     /// Maximum number of rows (internal arrays) in model
1252
+     int maximumInternalRows_;
1253
+     /// Base packed matrix
1254
+     CoinPackedMatrix baseMatrix_;
1255
+     /// Base row copy
1256
+     CoinPackedMatrix baseRowCopy_;
1257
+     /// Saved row scale factors for matrix
1258
+     double * savedRowScale_;
1259
+     /// Saved column scale factors
1260
+     double * savedColumnScale_;
1261
+#ifndef CLP_NO_STD
1262
+     /// Array of string parameters
1263
+     std::string strParam_[ClpLastStrParam];
1264
+#endif
1265
+     //@}
1266
+};
1267
+/** This is a tiny class where data can be saved round calls.
1268
+ */
1269
+class ClpDataSave {
1270
+
1271
+public:
1272
+     /**@name Constructors and destructor
1273
+      */
1274
+     //@{
1275
+     /// Default constructor
1276
+     ClpDataSave (  );
1277
+
1278
+     /// Copy constructor.
1279
+     ClpDataSave(const ClpDataSave &);
1280
+     /// Assignment operator. This copies the data
1281
+     ClpDataSave & operator=(const ClpDataSave & rhs);
1282
+     /// Destructor
1283
+     ~ClpDataSave (  );
1284
+
1285
+     //@}
1286
+
1287
+////////////////// data //////////////////
1288
+public:
1289
+
1290
+     /**@name data - with same names as in other classes*/
1291
+     //@{
1292
+     double dualBound_;
1293
+     double infeasibilityCost_;
1294
+     double pivotTolerance_;
1295
+     double zeroFactorizationTolerance_;
1296
+     double zeroSimplexTolerance_;
1297
+     double acceptablePivot_;
1298
+     double objectiveScale_;
1299
+     int sparseThreshold_;
1300
+     int perturbation_;
1301
+     int forceFactorization_;
1302
+     int scalingFlag_;
1303
+     unsigned int specialOptions_;
1304
+     //@}
1305
+};
1306
+
1307
+#endif