source: trunk/Clp/src/AbcSimplex.hpp @ 2030

Last change on this file since 2030 was 2026, checked in by forrest, 5 years ago

fix compile error for abc

  • Property svn:keywords set to Id
File size: 44.6 KB
Line 
1/* $Id: AbcSimplex.hpp 2026 2014-03-20 09:06:26Z forrest $ */
2// Copyright (C) 2002, International Business Machines
3// Corporation and others, Copyright (C) 2012, FasterCoin.  All Rights Reserved.
4// This code is licensed under the terms of the Eclipse Public License (EPL).
5/*
6  Authors
7 
8  John Forrest
9 
10*/
11#ifndef AbcSimplex_H
12#define AbcSimplex_H
13
14#include <iostream>
15#include <cfloat>
16#include "ClpModel.hpp"
17#include "ClpMatrixBase.hpp"
18#include "CoinIndexedVector.hpp"
19#include "AbcCommon.hpp"
20class AbcSimplex;
21#include "ClpSolve.hpp"
22#include "CoinAbcCommon.hpp"
23class ClpSimplex;
24class AbcDualRowPivot;
25class AbcPrimalColumnPivot;
26class AbcSimplexFactorization;
27class AbcNonLinearCost;
28class OsiAbcSolverInterface;
29class CoinWarmStartBasis;
30class ClpDisasterHandler;
31class AbcSimplexProgress;
32class AbcMatrix;
33class AbcTolerancesEtc;
34
35/** This solves LPs using the simplex method
36   
37    It inherits from ClpModel and all its arrays are created at
38    algorithm time. Originally I tried to work with model arrays
39    but for simplicity of coding I changed to single arrays with
40    structural variables then row variables.  Some coding is still
41    based on old style and needs cleaning up.
42   
43    For a description of algorithms:
44   
45    for dual see AbcSimplexDual.hpp and at top of AbcSimplexDual.cpp
46    for primal see AbcSimplexPrimal.hpp and at top of AbcSimplexPrimal.cpp
47   
48    There is an algorithm data member.  + for primal variations
49    and - for dual variations
50   
51*/
52#define PAN
53#if ABC_NORMAL_DEBUG>0
54#define PRINT_PAN 1
55#endif
56#define TRY_ABC_GUS
57#define HEAVY_PERTURBATION 57
58#if ABC_PARALLEL==1
59// Use pthreads
60#include <pthread.h>
61#endif
62typedef struct {
63  double result;
64  //const CoinIndexedVector * constVector; // can get rid of
65  //CoinIndexedVector * vectors[2]; // can get rid of
66  void * extraInfo;
67  int status;
68  int stuff[4];
69} CoinAbcThreadInfo;
70#include "ClpSimplex.hpp"
71class AbcSimplex : public ClpSimplex {
72  friend void AbcSimplexUnitTest(const std::string & mpsDir);
73 
74public:
75  /** enums for status of various sorts.
76      ClpModel order (and warmstart) is
77      isFree = 0x00,
78      basic = 0x01,
79      atUpperBound = 0x02,
80      atLowerBound = 0x03,
81      isFixed means fixed at lower bound and out of basis
82  */
83  enum Status {
84    atLowerBound = 0x00, // so we can use bottom two bits to sort and swap signs
85    atUpperBound = 0x01,
86    isFree = 0x04,
87    superBasic = 0x05,
88    basic = 0x06,
89    isFixed = 0x07
90  };
91  // For Dual
92  enum FakeBound {
93    noFake = 0x00,
94    lowerFake = 0x01,
95    upperFake = 0x02,
96    bothFake = 0x03
97  };
98 
99  /**@name Constructors and destructor and copy */
100  //@{
101  /// Default constructor
102  AbcSimplex (bool emptyMessages = false  );
103 
104  /** Copy constructor.
105  */
106  AbcSimplex(const AbcSimplex & rhs);
107  /** Copy constructor from model.
108  */
109  AbcSimplex(const ClpSimplex & rhs);
110  /** Subproblem constructor.  A subset of whole model is created from the
111      row and column lists given.  The new order is given by list order and
112      duplicates are allowed.  Name and integer information can be dropped
113      Can optionally modify rhs to take into account variables NOT in list
114      in this case duplicates are not allowed (also see getbackSolution)
115  */
116  AbcSimplex (const ClpSimplex * wholeModel,
117              int numberRows, const int * whichRows,
118              int numberColumns, const int * whichColumns,
119              bool dropNames = true, bool dropIntegers = true,
120              bool fixOthers = false);
121  /** Subproblem constructor.  A subset of whole model is created from the
122      row and column lists given.  The new order is given by list order and
123      duplicates are allowed.  Name and integer information can be dropped
124      Can optionally modify rhs to take into account variables NOT in list
125      in this case duplicates are not allowed (also see getbackSolution)
126  */
127  AbcSimplex (const AbcSimplex * wholeModel,
128              int numberRows, const int * whichRows,
129              int numberColumns, const int * whichColumns,
130              bool dropNames = true, bool dropIntegers = true,
131              bool fixOthers = false);
132  /** This constructor modifies original AbcSimplex and stores
133      original stuff in created AbcSimplex.  It is only to be used in
134      conjunction with originalModel */
135  AbcSimplex (AbcSimplex * wholeModel,
136              int numberColumns, const int * whichColumns);
137  /** This copies back stuff from miniModel and then deletes miniModel.
138      Only to be used with mini constructor */
139  void originalModel(AbcSimplex * miniModel);
140  /** This constructor copies from ClpSimplex */
141  AbcSimplex (const ClpSimplex * clpSimplex);
142  /// Put back solution into ClpSimplex
143  void putBackSolution(ClpSimplex * simplex);
144  /** Array persistence flag
145      If 0 then as now (delete/new)
146      1 then only do arrays if bigger needed
147      2 as 1 but give a bit extra if bigger needed
148  */
149  //void setPersistenceFlag(int value);
150  /// Save a copy of model with certain state - normally without cuts
151  void makeBaseModel();
152  /// Switch off base model
153  void deleteBaseModel();
154  /// See if we have base model
155  inline AbcSimplex *  baseModel() const {
156    return abcBaseModel_;
157  }
158  /** Reset to base model (just size and arrays needed)
159      If model NULL use internal copy
160  */
161  void setToBaseModel(AbcSimplex * model = NULL);
162  /// Assignment operator. This copies the data
163  AbcSimplex & operator=(const AbcSimplex & rhs);
164  /// Destructor
165  ~AbcSimplex (  );
166  //@}
167 
168  /**@name Functions most useful to user */
169  //@{
170  /** Dual algorithm - see AbcSimplexDual.hpp for method.
171  */
172  int dual();
173  int doAbcDual();
174  /** Primal algorithm - see AbcSimplexPrimal.hpp for method.
175  */
176  int primal(int ifValuesPass);
177  int doAbcPrimal(int ifValuesPass);
178  /// Returns a basis (to be deleted by user)
179  CoinWarmStartBasis * getBasis() const;
180  /// Passes in factorization
181  void setFactorization( AbcSimplexFactorization & factorization);
182  /// Swaps factorization
183  AbcSimplexFactorization * swapFactorization( AbcSimplexFactorization * factorization);
184  /// Gets clean and emptyish factorization
185  AbcSimplexFactorization * getEmptyFactorization();
186  /** Tightens primal bounds to make dual faster.  Unless
187      fixed or doTight>10, bounds are slightly looser than they could be.
188      This is to make dual go faster and is probably not needed
189      with a presolve.  Returns non-zero if problem infeasible.
190     
191      Fudge for branch and bound - put bounds on columns of factor *
192      largest value (at continuous) - should improve stability
193      in branch and bound on infeasible branches (0.0 is off)
194  */
195  int tightenPrimalBounds();
196  /// Sets row pivot choice algorithm in dual
197  void setDualRowPivotAlgorithm(AbcDualRowPivot & choice);
198  /// Sets column pivot choice algorithm in primal
199  void setPrimalColumnPivotAlgorithm(AbcPrimalColumnPivot & choice);
200  //@}
201  /// If user left factorization frequency then compute
202  void defaultFactorizationFrequency();
203  //@}
204 
205  /**@name most useful gets and sets */
206  //@{
207  /// factorization
208  inline AbcSimplexFactorization * factorization() const {
209    return reinterpret_cast<AbcSimplexFactorization *>(abcFactorization_);
210  }
211#ifdef EARLY_FACTORIZE
212  /// Early factorization
213  inline AbcSimplexFactorization * earlyFactorization() const {
214    return reinterpret_cast<AbcSimplexFactorization *>(abcEarlyFactorization_);
215  }
216#endif
217  /// Factorization frequency
218  int factorizationFrequency() const;
219  void setFactorizationFrequency(int value);
220  /// Maximum rows
221  inline int maximumAbcNumberRows() const
222  { return maximumAbcNumberRows_;}
223  /// Maximum Total
224  inline int maximumNumberTotal() const
225  { return maximumNumberTotal_;}
226  inline int maximumTotal() const
227  { return maximumNumberTotal_;}
228  /// Return true if the objective limit test can be relied upon
229  bool isObjectiveLimitTestValid() const ;
230  /// Number of variables (includes spare rows)
231  inline int numberTotal() const
232  { return numberTotal_;}
233  /// Number of variables without fixed to zero (includes spare rows)
234  inline int numberTotalWithoutFixed() const
235  { return numberTotalWithoutFixed_;}
236  /// Useful arrays (0,1,2,3,4,5,6,7)
237  inline CoinPartitionedVector * usefulArray(int index) {
238    return & usefulArray_[index];
239  }
240  inline CoinPartitionedVector * usefulArray(int index) const {
241    return const_cast<CoinPartitionedVector *>(&usefulArray_[index]);
242  }
243  //@}
244 
245  /******************** End of most useful part **************/
246  /**@name Functions less likely to be useful to casual user */
247  //@{
248  /** Given an existing factorization computes and checks
249      primal and dual solutions.  Uses current problem arrays for
250      bounds.  Returns feasibility states */
251  int getSolution ();
252  /// Sets objectiveValue_ from rawObjectiveValue_
253  void setClpSimplexObjectiveValue();
254  /** Sets dual values pass djs using unscaled duals
255      type 1 - values pass
256      type 2 - just use as infeasibility weights
257      type 3 - as 2 but crash
258  */
259  void setupDualValuesPass(const double * fakeDuals,
260                           const double * fakePrimals,
261                           int type);
262  /// Gets objective value with all offsets but as for minimization
263  inline double minimizationObjectiveValue() const
264  { return objectiveValue_-dblParam_[ClpObjOffset];}
265  /// Current dualTolerance (will end up as dualTolerance_)
266  inline double currentDualTolerance() const
267  { return currentDualTolerance_;}
268  inline void setCurrentDualTolerance(double value) {
269    currentDualTolerance_ = value;
270  }
271  /// Return pointer to details of costs
272  inline AbcNonLinearCost * abcNonLinearCost() const {
273    return abcNonLinearCost_;
274  }
275  /// Perturbation (fixed) - is just scaled random numbers
276  double * perturbationSaved() const
277  { return perturbationSaved_;}
278  /// Acceptable pivot for this iteration
279  inline double acceptablePivot() const
280  { return acceptablePivot_;}
281  /// Set to 1 if no free or super basic
282  inline int ordinaryVariables() const
283  { return ordinaryVariables_;}
284  /// Number of ordinary (lo/up) in tableau row
285  inline int numberOrdinary() const
286  { return numberOrdinary_;}
287  /// Set number of ordinary (lo/up) in tableau row
288  inline void setNumberOrdinary(int number)
289  { numberOrdinary_=number;}
290  /// Current dualBound (will end up as dualBound_)
291  inline double currentDualBound() const
292  { return currentDualBound_;}
293  /// dual row pivot choice
294  inline AbcDualRowPivot * dualRowPivot() const {
295    return abcDualRowPivot_;
296  }
297  /// primal column pivot choice
298  inline AbcPrimalColumnPivot * primalColumnPivot() const {
299    return abcPrimalColumnPivot_;
300  }
301  /// Abc Matrix
302  inline AbcMatrix * abcMatrix() const     {
303    return abcMatrix_;
304  }
305  /** Factorizes using current basis.
306      solveType - 1 iterating, 0 initial, -1 external
307      If 10 added then in primal values pass
308      Return codes are as from AbcSimplexFactorization unless initial factorization
309      when total number of singularities is returned.
310      Special case is numberRows_+1 -> all slack basis.
311      if initial should be before permute in
312      pivotVariable may be same as toExternal
313  */
314  int internalFactorize(int solveType);
315  /**
316     Permutes in from ClpModel data - assumes scale factors done
317     and AbcMatrix exists but is in original order (including slacks)
318     For now just add basicArray at end
319     ==
320     But could partition into
321     normal (i.e. reasonable lower/upper)
322     abnormal - free, odd bounds
323     fixed
324     ==
325     sets a valid pivotVariable
326     Slacks always shifted by offset
327     Fixed variables always shifted by offset
328     Recode to allow row objective so can use pi from idiot etc
329  */
330  void permuteIn();
331  /// deals with new basis and puts in abcPivotVariable_
332  void permuteBasis();
333  /// Permutes out - bit settings same as stateOfProblem
334  void permuteOut(int whatsWanted);
335  /// Save data
336  ClpDataSave saveData() ;
337  /// Restore data
338  void restoreData(ClpDataSave saved);
339  /// Clean up status - make sure no superbasic etc
340  void cleanStatus(bool valuesPass=false);
341  /** Computes duals from scratch. If givenDjs then
342      allows for nonzero basic djs.  Returns number of refinements  */
343  int computeDuals(double * givenDjs, CoinIndexedVector * array1, CoinIndexedVector * array2);
344  /// Computes primals from scratch.  Returns number of refinements
345  int computePrimals (CoinIndexedVector * array1, CoinIndexedVector * array2);
346  /// Computes nonbasic cost and total cost
347  void computeObjective ();
348  /// set multiple sequence in
349  void setMultipleSequenceIn(int sequenceIn[4]);
350  /**
351     Unpacks one column of the matrix into indexed array
352     Uses sequenceIn_
353  */
354  inline void unpack(CoinIndexedVector & rowArray) const 
355  {unpack(rowArray,sequenceIn_);}
356  /**
357     Unpacks one column of the matrix into indexed array
358  */
359  void unpack(CoinIndexedVector & rowArray, int sequence) const;
360  /**
361     This does basis housekeeping and does values for in/out variables.
362     Can also decide to re-factorize
363  */
364  int housekeeping(/*double objectiveChange*/);
365  /** This sets largest infeasibility and most infeasible and sum
366      and number of infeasibilities (Primal) */
367  void checkPrimalSolution(bool justBasic);
368  /** This sets largest infeasibility and most infeasible and sum
369      and number of infeasibilities (Dual) */
370  void checkDualSolution();
371  /** This sets largest infeasibility and most infeasible and sum
372      and number of infeasibilities AND sumFakeInfeasibilites_ (Dual) */
373  void checkDualSolutionPlusFake();
374  /** This sets sum and number of infeasibilities (Dual and Primal) */
375  void checkBothSolutions();
376  /// Computes solutions - 1 do duals, 2 do primals, 3 both (returns number of refinements)
377  int gutsOfSolution(int type);
378  /// Computes solutions - 1 do duals, 2 do primals, 3 both (returns number of refinements)
379  int gutsOfPrimalSolution(int type);
380  /// Saves good status etc
381  void saveGoodStatus();
382  /// Restores previous good status and says trouble
383  void restoreGoodStatus(int type);
384#define rowUseScale_ scaleFromExternal_
385#define inverseRowUseScale_ scaleToExternal_
386  /// After modifying first copy refreshes second copy and marks as updated
387  void refreshCosts();
388  void refreshLower(unsigned int type=~(ROW_LOWER_SAME|COLUMN_UPPER_SAME));
389  void refreshUpper(unsigned int type=~(ROW_LOWER_SAME|COLUMN_LOWER_SAME));
390  /// Sets up all extra pointers
391  void setupPointers(int maxRows,int maxColumns);
392  /// Copies all saved versions to working versions and may do something for perturbation
393  void copyFromSaved(int type=31);
394  /// fills in perturbationSaved_ from start with 0.5+random
395  void fillPerturbation(int start, int number);
396  /// For debug - prints summary of arrays which are out of kilter
397  void checkArrays(int ignoreEmpty=0) const;
398  /// For debug - summarizes dj situation (1 recomputes duals first, 2 checks duals as well)
399  void checkDjs(int type=1) const;
400  /// For debug - checks solutionBasic
401  void checkSolutionBasic() const;
402  /// For debug - moves solution back to external and computes stuff (always checks djs)
403  void checkMoveBack(bool checkDuals);
404public:
405  /** For advanced use.  When doing iterative solves things can get
406      nasty so on values pass if incoming solution has largest
407      infeasibility < incomingInfeasibility throw out variables
408      from basis until largest infeasibility < allowedInfeasibility
409      or incoming largest infeasibility.
410      If allowedInfeasibility>= incomingInfeasibility this is
411      always possible altough you may end up with an all slack basis.
412     
413      Defaults are 1.0,10.0
414  */
415  void setValuesPassAction(double incomingInfeasibility,
416                           double allowedInfeasibility);
417  /** Get a clean factorization - i.e. throw out singularities
418      may do more later */
419  int cleanFactorization(int ifValuesPass);
420  /// Move status and solution to ClpSimplex
421  void moveStatusToClp(ClpSimplex * clpModel);
422  /// Move status and solution from ClpSimplex
423  void moveStatusFromClp(ClpSimplex * clpModel);
424  //@}
425  /**@name most useful gets and sets */
426  //@{
427public:
428
429  /// Objective value
430  inline double clpObjectiveValue() const {
431  return (objectiveValue_+objectiveOffset_-bestPossibleImprovement_)*optimizationDirection_ - dblParam_[ClpObjOffset];
432  }
433  /** Basic variables pivoting on which rows
434      may be same as toExternal but may be as at invert */
435  inline int * pivotVariable() const {
436    return abcPivotVariable_;
437  }
438  /// State of problem
439  inline int stateOfProblem() const
440  { return stateOfProblem_;}
441  /// State of problem
442  inline void setStateOfProblem(int value)
443  { stateOfProblem_=value;}
444  /// Points from external to internal
445  //inline int * fromExternal() const
446  //{ return fromExternal_;}
447  /// Points from internal to external
448  //inline int * toExternal() const
449  //{return toExternal_;}
450  /** Scale from primal external to internal (in external order) Or other way for dual
451   */
452  inline double * scaleFromExternal() const
453  {return scaleFromExternal_;}
454  /** Scale from primal internal to external (in external order) Or other way for dual
455   */
456  inline double * scaleToExternal() const
457  {return scaleToExternal_;}
458  /// corresponds to rowScale etc
459  inline double * rowScale2() const
460  {return rowUseScale_;}
461  inline double * inverseRowScale2() const
462  {return inverseRowUseScale_;}
463  inline double * inverseColumnScale2() const
464  {return inverseColumnUseScale_;}
465  inline double * columnScale2() const
466  {return columnUseScale_;}
467  inline int arrayForDualColumn() const
468  {return arrayForDualColumn_;}
469  /// upper theta from dual column
470  inline double upperTheta() const
471  {return upperTheta_;}
472  inline int arrayForReplaceColumn() const
473  { return arrayForReplaceColumn_;}
474  inline int arrayForFlipBounds() const
475  { return arrayForFlipBounds_;}
476  inline int arrayForFlipRhs() const
477  { return arrayForFlipRhs_;}
478  inline int arrayForBtran() const
479  { return arrayForBtran_;}
480  inline int arrayForFtran() const
481  { return arrayForFtran_;}
482  inline int arrayForTableauRow() const
483  { return arrayForTableauRow_;}
484  /// value of incoming variable (in Dual)
485  double valueIncomingDual() const;
486  /// Get pointer to array[getNumCols()] of primal solution vector
487  const double * getColSolution() const; 
488 
489  /// Get pointer to array[getNumRows()] of dual prices
490  const double * getRowPrice() const;
491 
492  /// Get a pointer to array[getNumCols()] of reduced costs
493  const double * getReducedCost() const; 
494 
495  /** Get pointer to array[getNumRows()] of row activity levels (constraint
496      matrix times the solution vector */
497  const double * getRowActivity() const; 
498  //@}
499 
500  /**@name protected methods */
501  //@{
502  /** May change basis and then returns number changed.
503      Computation of solutions may be overriden by given pi and solution
504  */
505  int gutsOfSolution ( double * givenDuals,
506                       const double * givenPrimals,
507                       bool valuesPass = false);
508  /// Does most of deletion for arrays etc(0 just null arrays, 1 delete first)
509  void gutsOfDelete(int type);
510  /// Does most of copying
511  void gutsOfCopy(const AbcSimplex & rhs);
512  /// Initializes arrays
513  void gutsOfInitialize(int numberRows,int numberColumns,bool doMore);
514  /// resizes arrays
515  void gutsOfResize(int numberRows,int numberColumns);
516  /** Translates ClpModel to AbcSimplex
517      See DO_ bits in stateOfProblem_ for type e.g. DO_BASIS_AND_ORDER
518  */
519  void translate(int type);
520  /// Moves basic stuff to basic area
521  void moveToBasic(int which=15);
522  //@}
523public:
524  /**@name public methods */
525  //@{
526  /// Return region
527  inline double * solutionRegion() const {
528    return abcSolution_;
529  }
530  inline double * djRegion() const {
531    return abcDj_;
532  }
533  inline double * lowerRegion() const {
534    return abcLower_;
535  }
536  inline double * upperRegion() const {
537    return abcUpper_;
538  }
539  inline double * costRegion() const {
540    return abcCost_;
541  }
542  /// Return region
543  inline double * solutionRegion(int which) const {
544    return abcSolution_+which*maximumAbcNumberRows_;
545  }
546  inline double * djRegion(int which) const {
547    return abcDj_+which*maximumAbcNumberRows_;
548  }
549  inline double * lowerRegion(int which) const {
550    return abcLower_+which*maximumAbcNumberRows_;
551  }
552  inline double * upperRegion(int which) const {
553    return abcUpper_+which*maximumAbcNumberRows_;
554  }
555  inline double * costRegion(int which) const {
556    return abcCost_+which*maximumAbcNumberRows_;
557  }
558  /// Return region
559  inline double * solutionBasic() const {
560    return solutionBasic_;
561  }
562  inline double * djBasic() const {
563    return djBasic_;
564  }
565  inline double * lowerBasic() const {
566    return lowerBasic_;
567  }
568  inline double * upperBasic() const {
569    return upperBasic_;
570  }
571  inline double * costBasic() const {
572    return costBasic_;
573  }
574  /// Perturbation
575  inline double * abcPerturbation() const
576  { return abcPerturbation_;}
577  /// Fake djs
578  inline double * fakeDjs() const
579  { return djSaved_;}
580  inline unsigned char * internalStatus() const 
581  { return internalStatus_;}
582  inline AbcSimplex::Status getInternalStatus(int sequence) const {
583    return static_cast<Status> (internalStatus_[sequence] & 7);
584  }
585  inline AbcSimplex::Status getInternalColumnStatus(int sequence) const {
586    return static_cast<Status> (internalStatus_[sequence+maximumAbcNumberRows_] & 7);
587  }
588  inline void setInternalStatus(int sequence, AbcSimplex::Status newstatus) {
589    unsigned char & st_byte = internalStatus_[sequence];
590    st_byte = static_cast<unsigned char>(st_byte & ~7);
591    st_byte = static_cast<unsigned char>(st_byte | newstatus);
592  }
593  inline void setInternalColumnStatus(int sequence, AbcSimplex::Status newstatus) {
594    unsigned char & st_byte = internalStatus_[sequence+maximumAbcNumberRows_];
595    st_byte = static_cast<unsigned char>(st_byte & ~7);
596    st_byte = static_cast<unsigned char>(st_byte | newstatus);
597  }
598  /** Normally the first factorization does sparse coding because
599      the factorization could be singular.  This allows initial dense
600      factorization when it is known to be safe
601  */
602  void setInitialDenseFactorization(bool onOff);
603  bool  initialDenseFactorization() const;
604  /** Return sequence In or Out */
605  inline int sequenceIn() const {
606    return sequenceIn_;
607  }
608  inline int sequenceOut() const {
609    return sequenceOut_;
610  }
611  /** Set sequenceIn or Out */
612  inline void  setSequenceIn(int sequence) {
613    sequenceIn_ = sequence;
614  }
615  inline void  setSequenceOut(int sequence) {
616    sequenceOut_ = sequence;
617  }
618#if 0
619  /** Return sequenceInternal In or Out */
620  inline int sequenceInternalIn() const {
621    return sequenceInternalIn_;
622  }
623  inline int sequenceInternalOut() const {
624    return sequenceInternalOut_;
625  }
626  /** Set sequenceInternalIn or Out */
627  inline void  setSequenceInternalIn(int sequence) {
628    sequenceInternalIn_ = sequence;
629  }
630  inline void  setSequenceInternalOut(int sequence) {
631    sequenceInternalOut_ = sequence;
632  }
633#endif
634  /// Returns 1 if sequence indicates column
635  inline int isColumn(int sequence) const {
636    return sequence >= maximumAbcNumberRows_ ? 1 : 0;
637  }
638  /// Returns sequence number within section
639  inline int sequenceWithin(int sequence) const {
640    return sequence < maximumAbcNumberRows_ ? sequence : sequence - maximumAbcNumberRows_;
641  }
642  /// Current/last pivot row (set after END of choosing pivot row in dual)
643  inline int lastPivotRow() const
644  { return lastPivotRow_;}
645  /// First Free_
646  inline int firstFree() const
647  { return firstFree_;}
648  /// Last firstFree_
649  inline int lastFirstFree() const
650  { return lastFirstFree_;}
651  /// Free chosen vector
652  inline int freeSequenceIn() const
653  { return freeSequenceIn_;}
654  /// Acceptable pivot for this iteration
655  inline double currentAcceptablePivot() const
656  { return currentAcceptablePivot_;}
657#ifdef PAN
658  /** Returns
659      1 if fake superbasic
660      0 if free or true superbasic
661      -1 if was fake but has cleaned itself up (sets status)
662      -2 if wasn't fake
663   */
664  inline int fakeSuperBasic(int iSequence) {
665    if ((internalStatus_[iSequence]&7)==4)
666      return 0; // free
667    if ((internalStatus_[iSequence]&7)!=5)
668      return -2;
669    double value=abcSolution_[iSequence];
670    if (value<abcLower_[iSequence]+primalTolerance_) {
671      if(abcDj_[iSequence]>=-currentDualTolerance_) {
672        setInternalStatus(iSequence,atLowerBound);
673#if PRINT_PAN>1
674        printf("Pansetting %d to lb\n",iSequence);
675#endif
676        return -1;
677      } else {
678        return 1;
679      }
680    } else if (value>abcUpper_[iSequence]-primalTolerance_) {
681      if (abcDj_[iSequence]<=currentDualTolerance_) {
682        setInternalStatus(iSequence,atUpperBound);
683#if PRINT_PAN>1
684        printf("Pansetting %d to ub\n",iSequence);
685#endif
686        return -1;
687      } else {
688        return 1;
689      }
690    } else {
691      return 0;
692    }
693  }
694#endif
695  /// Return row or column values
696  inline double solution(int sequence) {
697    return abcSolution_[sequence];
698  }
699  /// Return address of row or column values
700  inline double & solutionAddress(int sequence) {
701    return abcSolution_[sequence];
702  }
703  inline double reducedCost(int sequence) {
704    return abcDj_[sequence];
705  }
706  inline double & reducedCostAddress(int sequence) {
707    return abcDj_[sequence];
708  }
709  inline double lower(int sequence) {
710    return abcLower_[sequence];
711  }
712  /// Return address of row or column lower bound
713  inline double & lowerAddress(int sequence) {
714    return abcLower_[sequence];
715  }
716  inline double upper(int sequence) {
717    return abcUpper_[sequence];
718  }
719  /// Return address of row or column upper bound
720  inline double & upperAddress(int sequence) {
721    return abcUpper_[sequence];
722  }
723  inline double cost(int sequence) {
724    return abcCost_[sequence];
725  }
726  /// Return address of row or column cost
727  inline double & costAddress(int sequence) {
728    return abcCost_[sequence];
729  }
730  /// Return original lower bound
731  inline double originalLower(int iSequence) const {
732    if (iSequence < numberColumns_) return columnLower_[iSequence];
733    else
734      return rowLower_[iSequence-numberColumns_];
735  }
736  /// Return original lower bound
737  inline double originalUpper(int iSequence) const {
738    if (iSequence < numberColumns_) return columnUpper_[iSequence];
739    else
740      return rowUpper_[iSequence-numberColumns_];
741  }
742  /// For dealing with all issues of cycling etc
743  inline AbcSimplexProgress * abcProgress()
744  { return &abcProgress_;}
745#ifdef ABC_SPRINT
746  /// Overwrite to create sub problem (just internal arrays) - save full stuff
747  AbcSimplex * createSubProblem(int numberColumns,const int * whichColumn);
748  /// Restore stuff from sub problem (and delete sub problem)
749  void restoreFromSubProblem(AbcSimplex * fullProblem, const int * whichColumn);
750#endif
751public:
752  /** Clears an array and says available (-1 does all)
753      when no possibility of going parallel */
754  inline void clearArraysPublic(int which)
755  { clearArrays(which);}
756  /** Returns first available empty array (and sets flag)
757      when no possibility of going parallel */
758  inline int getAvailableArrayPublic() const
759  { return getAvailableArray();}
760#if ABC_PARALLEL
761  /// get parallel mode
762  inline int parallelMode() const
763  { return parallelMode_;}
764  /// set parallel mode
765  inline void setParallelMode(int value)
766  { parallelMode_=value;}
767  /// Number of cpus
768  inline int numberCpus() const
769  { return parallelMode_+1;}
770#if ABC_PARALLEL==1
771  /// set stop start
772  inline void setStopStart(int value)
773  { stopStart_=value;}
774#endif
775#endif
776  //protected:
777  /// Clears an array and says available (-1 does all)
778  void clearArrays(int which);
779  /// Clears an array and says available
780  void clearArrays(CoinPartitionedVector * which);
781  /// Returns first available empty array (and sets flag)
782  int getAvailableArray() const;
783  /// Say array going to be used
784  inline void setUsedArray(int which) const 
785  {int check=1<<which;assert ((stateOfProblem_&check)==0);stateOfProblem_|=check;}
786  /// Say array going available
787  inline void setAvailableArray(int which) const
788  {int check=1<<which;assert ((stateOfProblem_&check)!=0);
789    assert (!usefulArray_[which].getNumElements());stateOfProblem_&=~check;}
790  /// Swaps primal stuff
791  void swapPrimalStuff();
792  /// Swaps dual stuff
793  void swapDualStuff(int lastSequenceOut,int lastDirectionOut);
794protected:
795  //@}
796  /**@name status methods */
797  //@{
798  /// Swaps two variables and does status
799  void swap(int pivotRow,int nonBasicPosition,Status newStatus);
800  inline void setFakeBound(int sequence, FakeBound fakeBound) {
801    unsigned char & st_byte = internalStatus_[sequence];
802    st_byte = static_cast<unsigned char>(st_byte & ~24);
803    st_byte = static_cast<unsigned char>(st_byte | (fakeBound << 3));
804  }
805  inline FakeBound getFakeBound(int sequence) const {
806    return static_cast<FakeBound> ((internalStatus_[sequence] >> 3) & 3);
807  }
808  bool atFakeBound(int sequence) const;
809  inline void setPivoted( int sequence) {
810    internalStatus_[sequence] = static_cast<unsigned char>(internalStatus_[sequence] | 32);
811  }
812  inline void clearPivoted( int sequence) {
813    internalStatus_[sequence] = static_cast<unsigned char>(internalStatus_[sequence] & ~32);
814  }
815  inline bool pivoted(int sequence) const {
816    return (((internalStatus_[sequence] >> 5) & 1) != 0);
817  }
818public:
819  /// Swaps two variables
820  void swap(int pivotRow,int nonBasicPosition);
821  /// To flag a variable
822  void setFlagged( int sequence);
823  inline void clearFlagged( int sequence) {
824    internalStatus_[sequence] = static_cast<unsigned char>(internalStatus_[sequence] & ~64);
825  }
826  inline bool flagged(int sequence) const {
827    return ((internalStatus_[sequence] & 64) != 0);
828  }
829protected:
830  /// To say row active in primal pivot row choice
831  inline void setActive( int iRow) {
832    internalStatus_[iRow] = static_cast<unsigned char>(internalStatus_[iRow] | 128);
833  }
834  inline void clearActive( int iRow) {
835    internalStatus_[iRow] = static_cast<unsigned char>(internalStatus_[iRow] & ~128);
836  }
837  inline bool active(int iRow) const {
838    return ((internalStatus_[iRow] & 128) != 0);
839  }
840public:
841  /** Set up status array (can be used by OsiAbc).
842      Also can be used to set up all slack basis */
843  void createStatus() ;
844  /// Does sort of crash
845  void crash(int type);
846  /** Puts more stuff in basis
847      1 bit set - do even if basis exists
848      2 bit set - don't bother staying triangular
849   */
850  void putStuffInBasis(int type);
851  /** Sets up all slack basis and resets solution to
852      as it was after initial load or readMps */
853  void allSlackBasis();
854  /// For debug - check pivotVariable consistent
855  void checkConsistentPivots() const;
856  /// Print stuff
857  void printStuff() const;
858  /// Common bits of coding for dual and primal
859  int startup(int ifValuesPass);
860 
861  /// Raw objective value (so always minimize in primal)
862  inline double rawObjectiveValue() const {
863    return objectiveValue_;
864  }
865  /// Compute objective value from solution and put in objectiveValue_
866  void computeObjectiveValue(bool useWorkingSolution = false);
867  /// Compute minimization objective value from internal solution without perturbation
868  double computeInternalObjectiveValue();
869  /// Move status and solution across
870  void moveInfo(const AbcSimplex & rhs, bool justStatus = false);
871#define NUMBER_THREADS 3
872#if ABC_PARALLEL==1
873  // For waking up thread
874  inline pthread_mutex_t * mutexPointer(int which,int thread=0) 
875  { return mutex_+which+3*thread;}
876  inline pthread_barrier_t * barrierPointer() 
877  { return &barrier_;}
878  inline int whichLocked(int thread=0) const
879  { return locked_[thread];}
880  inline CoinAbcThreadInfo * threadInfoPointer(int thread=0) 
881  { return threadInfo_+thread;}
882  void startParallelStuff(int type);
883  int stopParallelStuff(int type);
884  /// so thread can find out which one it is
885  int whichThread() const; 
886#elif ABC_PARALLEL==2
887  //inline CoinAbcThreadInfo * threadInfoPointer(int thread=0)
888  //{ return threadInfo_+thread;}
889#endif
890  //@}
891 
892  //-------------------------------------------------------------------------
893  /**@name Changing bounds on variables and constraints */
894  //@{
895  /** Set an objective function coefficient */
896  void setObjectiveCoefficient( int elementIndex, double elementValue );
897  /** Set an objective function coefficient */
898  inline void setObjCoeff( int elementIndex, double elementValue ) {
899    setObjectiveCoefficient( elementIndex, elementValue);
900  }
901 
902  /** Set a single column lower bound<br>
903      Use -DBL_MAX for -infinity. */
904  void setColumnLower( int elementIndex, double elementValue );
905 
906  /** Set a single column upper bound<br>
907      Use DBL_MAX for infinity. */
908  void setColumnUpper( int elementIndex, double elementValue );
909 
910  /** Set a single column lower and upper bound */
911  void setColumnBounds( int elementIndex,
912                        double lower, double upper );
913 
914  /** Set the bounds on a number of columns simultaneously<br>
915      The default implementation just invokes setColLower() and
916      setColUpper() over and over again.
917      @param indexFirst,indexLast pointers to the beginning and after the
918      end of the array of the indices of the variables whose
919      <em>either</em> bound changes
920      @param boundList the new lower/upper bound pairs for the variables
921  */
922  void setColumnSetBounds(const int* indexFirst,
923                          const int* indexLast,
924                          const double* boundList);
925 
926  /** Set a single column lower bound<br>
927      Use -DBL_MAX for -infinity. */
928  inline void setColLower( int elementIndex, double elementValue ) {
929    setColumnLower(elementIndex, elementValue);
930  }
931  /** Set a single column upper bound<br>
932      Use DBL_MAX for infinity. */
933  inline void setColUpper( int elementIndex, double elementValue ) {
934    setColumnUpper(elementIndex, elementValue);
935  }
936 
937  /** Set a single column lower and upper bound */
938  inline void setColBounds( int elementIndex,
939                            double newlower, double newupper ) {
940    setColumnBounds(elementIndex, newlower, newupper);
941  }
942 
943  /** Set the bounds on a number of columns simultaneously<br>
944      @param indexFirst,indexLast pointers to the beginning and after the
945      end of the array of the indices of the variables whose
946      <em>either</em> bound changes
947      @param boundList the new lower/upper bound pairs for the variables
948  */
949  inline void setColSetBounds(const int* indexFirst,
950                              const int* indexLast,
951                              const double* boundList) {
952    setColumnSetBounds(indexFirst, indexLast, boundList);
953  }
954 
955  /** Set a single row lower bound<br>
956      Use -DBL_MAX for -infinity. */
957  void setRowLower( int elementIndex, double elementValue );
958 
959  /** Set a single row upper bound<br>
960      Use DBL_MAX for infinity. */
961  void setRowUpper( int elementIndex, double elementValue ) ;
962 
963  /** Set a single row lower and upper bound */
964  void setRowBounds( int elementIndex,
965                     double lower, double upper ) ;
966 
967  /** Set the bounds on a number of rows simultaneously<br>
968      @param indexFirst,indexLast pointers to the beginning and after the
969      end of the array of the indices of the constraints whose
970      <em>either</em> bound changes
971      @param boundList the new lower/upper bound pairs for the constraints
972  */
973  void setRowSetBounds(const int* indexFirst,
974                       const int* indexLast,
975                       const double* boundList);
976  /// Resizes rim part of model
977  void resize (int newNumberRows, int newNumberColumns);
978 
979  //@}
980 
981  ////////////////// data //////////////////
982protected:
983 
984  /**@name data.  Many arrays have a row part and a column part.
985     There is a single array with both - columns then rows and
986     then normally two arrays pointing to rows and columns.  The
987     single array is the owner of memory
988  */
989  //@{
990  /// Sum of nonbasic costs
991  double sumNonBasicCosts_;
992  /// Sum of costs (raw objective value)
993  double rawObjectiveValue_;
994  /// Objective offset (from offset_)
995  double objectiveOffset_;
996  /**  Perturbation factor
997       If <0.0 then virtual
998       if 0.0 none
999       if >0.0 use this as factor */
1000  double perturbationFactor_;
1001  /// Current dualTolerance (will end up as dualTolerance_)
1002  double currentDualTolerance_;
1003  /// Current dualBound (will end up as dualBound_)
1004  double currentDualBound_;
1005  /// Largest gap
1006  double largestGap_;
1007  /// Last dual bound
1008  double lastDualBound_;
1009  /// Sum of infeasibilities when using fake perturbation tolerance
1010  double sumFakeInfeasibilities_;
1011  /// Last primal error
1012  double lastPrimalError_;
1013  /// Last dual error
1014  double lastDualError_;
1015  /// Acceptable pivot for this iteration
1016  double currentAcceptablePivot_;
1017  /// Movement of variable
1018  double movement_;
1019  /// Objective change
1020  double objectiveChange_;
1021  /// Btran alpha
1022  double btranAlpha_;
1023  /// FT alpha
1024#ifdef ABC_LONG_FACTORIZATION
1025  long
1026#endif
1027  double ftAlpha_;
1028  /// Minimum theta movement
1029  double minimumThetaMovement_;
1030  /// Initial sum of infeasibilities
1031  double initialSumInfeasibilities_;
1032public:
1033  /// Where we are in iteration
1034  int stateOfIteration_;
1035protected:
1036  /// Last firstFree_
1037  int lastFirstFree_;
1038  /// Free chosen vector
1039  int freeSequenceIn_;
1040  /// Maximum number rows
1041  int maximumAbcNumberRows_;
1042  /// Maximum number columns
1043  int maximumAbcNumberColumns_;
1044  /// Maximum numberTotal
1045  int maximumNumberTotal_;
1046  /// Current number of variables flagged
1047  int numberFlagged_;
1048  /// Iteration at which to do relaxed dualColumn
1049  int normalDualColumnIteration_;
1050  /** State of dual waffle
1051      -2 - in initial large tolerance phase
1052      -1 - in medium tolerance phase
1053      n - in correct tolerance phase and thought optimal n times
1054   */
1055  int stateDualColumn_;
1056  /*
1057    May want to put some arrays into struct
1058    Two arrays point to/from external
1059    Order is basic,unused basic, at lower, at upper, superbasic, free, fixed with starts
1060  */
1061  /// Number of variables (includes spare rows)
1062  int numberTotal_;
1063  /// Number of variables without fixed to zero (includes spare rows)
1064  int numberTotalWithoutFixed_;
1065  /// Start of variables at lower bound with no upper
1066#define startAtLowerNoOther_ maximumAbcNumberRows_
1067  /// Start of variables at lower bound with upper
1068  int startAtLowerOther_;
1069  /// Start of variables at upper bound with no lower
1070  int startAtUpperNoOther_;
1071  /// Start of variables at upper bound with lower
1072  int startAtUpperOther_;
1073  /// Start of superBasic, free or awkward bounds variables
1074  int startOther_;
1075  /// Start of fixed variables
1076  int startFixed_;
1077#ifdef EARLY_FACTORIZE
1078  /// Number of iterations to try factorizing early
1079  int numberEarly_;
1080#endif
1081  /**
1082     State of problem
1083     State of external arrays
1084     2048 - status OK
1085     4096 - row primal solution OK
1086     8192 - row dual solution OK
1087     16384 - column primal solution OK
1088     32768 - column dual solution OK
1089     65536 - Everything not going smoothly (when smooth we forget about tiny bad djs)
1090     131072 - when increasing rows add a bit
1091     262144 - scale matrix and create new one
1092     524288 - do basis and order
1093     1048576 - just status (and check if order needed)
1094     2097152 - just solution
1095     4194304 - just redo bounds (and offset)
1096     Bottom bits say if usefulArray in use
1097   */
1098#define ALL_STATUS_OK 2048
1099#define ROW_PRIMAL_OK 4096
1100#define ROW_DUAL_OK 8192
1101#define COLUMN_PRIMAL_OK 16384
1102#define COLUMN_DUAL_OK 32768
1103#define PESSIMISTIC 65536
1104#define ADD_A_BIT 131072
1105#define DO_SCALE_AND_MATRIX 262144
1106#define DO_BASIS_AND_ORDER 524288
1107#define DO_STATUS 1048576
1108#define DO_SOLUTION 2097152
1109#define DO_JUST_BOUNDS 0x400000
1110#define NEED_BASIS_SORT 0x800000
1111#define FAKE_SUPERBASIC 0x1000000
1112#define VALUES_PASS 0x2000000
1113#define VALUES_PASS2 0x4000000
1114  mutable int stateOfProblem_;
1115#if ABC_PARALLEL
1116public:
1117  /// parallel mode
1118  int parallelMode_;
1119protected:
1120#endif
1121  /// Number of ordinary (lo/up) in tableau row
1122  int numberOrdinary_;
1123  /// Set to 1 if no free or super basic
1124  int ordinaryVariables_;
1125  /// Number of free nonbasic variables
1126  int numberFreeNonBasic_;
1127  /// Last time cleaned up
1128  int lastCleaned_;
1129  /// Current/last pivot row (set after END of choosing pivot row in dual)
1130  int lastPivotRow_;
1131  /// Nonzero (probably 10) if swapped algorithms
1132  int swappedAlgorithm_;
1133  /// Initial number of infeasibilities
1134  int initialNumberInfeasibilities_;
1135  /// Points from external to internal
1136  //int * fromExternal_;
1137  /// Points from internal to external
1138  //int * toExternal_;
1139  /** Scale from primal external to internal (in external order) Or other way for dual
1140   */
1141  double * scaleFromExternal_;
1142  /** Scale from primal internal to external (in external order) Or other way for dual
1143   */
1144  double * scaleToExternal_;
1145  /// use this instead of columnScale
1146  double * columnUseScale_;
1147  /// use this instead of inverseColumnScale
1148  double * inverseColumnUseScale_;
1149  /** Primal offset (in external order)
1150      So internal value is (external-offset)*scaleFromExternal
1151   */
1152  double * offset_;
1153  /// Offset for accumulated offsets*matrix
1154  double * offsetRhs_;
1155  /// Useful array of numberTotal length
1156  double * tempArray_;
1157  /** Working status
1158      ? may be signed
1159      ? link pi_ to an indexed array?
1160      may have saved from last factorization at end */
1161  unsigned char * internalStatus_;
1162  /// Saved status
1163  unsigned char * internalStatusSaved_;
1164  /** Perturbation (fixed) - is just scaled random numbers
1165      If perturbationFactor_<0 then virtual perturbation */
1166  double * abcPerturbation_;
1167  /// saved perturbation
1168  double * perturbationSaved_;
1169  /// basic perturbation
1170  double * perturbationBasic_;
1171  /// Working matrix
1172  AbcMatrix * abcMatrix_;
1173  /** Working scaled copy of lower bounds
1174      has original scaled copy at end */
1175  double * abcLower_;
1176  /** Working scaled copy of upper bounds
1177      has original scaled copy at end */
1178  double * abcUpper_;
1179  /** Working scaled copy of objective
1180      ? where perturbed copy or can we
1181      always work with perturbed copy (in B&B) if we adjust increments/cutoffs
1182      ? should we save a fixed perturbation offset array
1183      has original scaled copy at end */
1184  double * abcCost_;
1185  /** Working scaled primal solution
1186      may have saved from last factorization at end */
1187  double * abcSolution_;
1188  /** Working scaled dual solution
1189      may have saved from last factorization at end */
1190  double * abcDj_;
1191  /// Saved scaled copy of  lower bounds
1192  double * lowerSaved_;
1193  /// Saved scaled copy of  upper bounds
1194  double * upperSaved_;
1195  /// Saved scaled copy of  objective
1196  double * costSaved_;
1197  /// Saved scaled  primal solution
1198  double * solutionSaved_;
1199  /// Saved scaled  dual solution
1200  double * djSaved_;
1201  /// Working scaled copy of basic lower bounds
1202  double * lowerBasic_;
1203  /// Working scaled copy of basic upper bounds
1204  double * upperBasic_;
1205  /// Working scaled copy of basic objective
1206  double * costBasic_;
1207  /// Working scaled basic primal solution
1208  double * solutionBasic_;
1209  /// Working scaled basic dual solution (want it to be zero)
1210  double * djBasic_;
1211  /// dual row pivot choice
1212  AbcDualRowPivot * abcDualRowPivot_;
1213  /// primal column pivot choice
1214  AbcPrimalColumnPivot * abcPrimalColumnPivot_;
1215  /** Basic variables pivoting on which rows
1216      followed by atLo/atUp then free/superbasic then fixed
1217  */
1218  int * abcPivotVariable_;
1219  /// Reverse abcPivotVariable_ for moving around
1220  int * reversePivotVariable_;
1221  /// factorization
1222  AbcSimplexFactorization * abcFactorization_;
1223#ifdef EARLY_FACTORIZE
1224  /// Alternative factorization
1225  AbcSimplexFactorization * abcEarlyFactorization_;
1226#endif
1227#ifdef TEMPORARY_FACTORIZATION
1228  /// Alternative factorization
1229  AbcSimplexFactorization * abcOtherFactorization_;
1230#endif
1231  /// Saved version of solution
1232  //double * savedSolution_;
1233  /// A copy of model with certain state - normally without cuts
1234  AbcSimplex * abcBaseModel_;
1235  /// A copy of model as ClpSimplex with certain state
1236  ClpSimplex * clpModel_;
1237  /** Very wasteful way of dealing with infeasibilities in primal.
1238      However it will allow non-linearities and use of dual
1239      analysis.  If it doesn't work it can easily be replaced.
1240  */
1241  AbcNonLinearCost * abcNonLinearCost_;
1242  /// Useful arrays (all of row+column+2 length)
1243  /* has secondary offset and counts so row goes first then column
1244     Probably back to CoinPartitionedVector as AbcMatrix has slacks
1245     also says if in use - so we can just get next available one */
1246#define ABC_NUMBER_USEFUL 8
1247  mutable CoinPartitionedVector usefulArray_[ABC_NUMBER_USEFUL];
1248  /// For dealing with all issues of cycling etc
1249  AbcSimplexProgress abcProgress_;
1250  /// For saving stuff at beginning
1251  ClpDataSave saveData_;
1252  /// upper theta from dual column
1253  double upperTheta_;
1254  /// Multiple sequence in
1255  int multipleSequenceIn_[4];
1256public:
1257  int arrayForDualColumn_;
1258  int arrayForReplaceColumn_;
1259  int arrayForFlipBounds_; //2
1260  int arrayForFlipRhs_; // if sequential can re-use
1261  int arrayForBtran_; // 0
1262  int arrayForFtran_; // 1
1263  int arrayForTableauRow_; //3
1264protected:
1265  int numberFlipped_;
1266  int numberDisasters_;
1267  //int nextCleanNonBasicIteration_;
1268#if ABC_PARALLEL==1
1269  // For waking up thread
1270  pthread_mutex_t mutex_[3*NUMBER_THREADS];
1271  pthread_barrier_t barrier_; 
1272  CoinAbcThreadInfo threadInfo_[NUMBER_THREADS];
1273  pthread_t abcThread_[NUMBER_THREADS];
1274  int locked_[NUMBER_THREADS];
1275  int stopStart_;
1276#elif ABC_PARALLEL==2
1277  //CoinAbcThreadInfo threadInfo_[NUMBER_THREADS];
1278#endif
1279  //@}
1280};
1281//#############################################################################
1282/** A function that tests the methods in the AbcSimplex class. The
1283    only reason for it not to be a member method is that this way it doesn't
1284    have to be compiled into the library. And that's a gain, because the
1285    library should be compiled with optimization on, but this method should be
1286    compiled with debugging.
1287   
1288    It also does some testing of AbcSimplexFactorization class
1289*/
1290void
1291AbcSimplexUnitTest(const std::string & mpsDir);
1292#endif
Note: See TracBrowser for help on using the repository browser.