Clp  trunk
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
ClpModel.hpp
Go to the documentation of this file.
00001 /* $Id$ */
00002 // Copyright (C) 2002, International Business Machines
00003 // Corporation and others.  All Rights Reserved.
00004 // This code is licensed under the terms of the Eclipse Public License (EPL).
00005 
00006 #ifndef ClpModel_H
00007 #define ClpModel_H
00008 
00009 #include "ClpConfig.h"
00010 
00011 #include <iostream>
00012 #include <cassert>
00013 #include <cmath>
00014 #include <vector>
00015 #include <string>
00016 //#ifndef COIN_USE_CLP
00017 //#define COIN_USE_CLP
00018 //#endif
00019 #include "ClpPackedMatrix.hpp"
00020 #include "CoinMessageHandler.hpp"
00021 #include "CoinHelperFunctions.hpp"
00022 #include "CoinTypes.hpp"
00023 #include "CoinFinite.hpp"
00024 #include "ClpParameters.hpp"
00025 #include "ClpObjective.hpp"
00026 class ClpEventHandler;
00036 class CoinBuild;
00037 class CoinModel;
00038 class ClpModel {
00039 
00040 public:
00041 
00047 
00048      ClpModel (bool emptyMessages = false  );
00049 
00054      ClpModel(const ClpModel & rhs, int scalingMode = -1);
00056      ClpModel & operator=(const ClpModel & rhs);
00061      ClpModel (const ClpModel * wholeModel,
00062                int numberRows, const int * whichRows,
00063                int numberColumns, const int * whichColumns,
00064                bool dropNames = true, bool dropIntegers = true);
00066      ~ClpModel (  );
00068 
00082      void loadProblem (  const ClpMatrixBase& matrix,
00083                          const double* collb, const double* colub,
00084                          const double* obj,
00085                          const double* rowlb, const double* rowub,
00086                          const double * rowObjective = NULL);
00087      void loadProblem (  const CoinPackedMatrix& matrix,
00088                          const double* collb, const double* colub,
00089                          const double* obj,
00090                          const double* rowlb, const double* rowub,
00091                          const double * rowObjective = NULL);
00092 
00095      void loadProblem (  const int numcols, const int numrows,
00096                          const CoinBigIndex* start, const int* index,
00097                          const double* value,
00098                          const double* collb, const double* colub,
00099                          const double* obj,
00100                          const double* rowlb, const double* rowub,
00101                          const double * rowObjective = NULL);
00107      int loadProblem (  CoinModel & modelObject, bool tryPlusMinusOne = false);
00109      void loadProblem (  const int numcols, const int numrows,
00110                          const CoinBigIndex* start, const int* index,
00111                          const double* value, const int * length,
00112                          const double* collb, const double* colub,
00113                          const double* obj,
00114                          const double* rowlb, const double* rowub,
00115                          const double * rowObjective = NULL);
00117      void loadQuadraticObjective(const int numberColumns,
00118                                  const CoinBigIndex * start,
00119                                  const int * column, const double * element);
00120      void loadQuadraticObjective (  const CoinPackedMatrix& matrix);
00122      void deleteQuadraticObjective();
00124      void setRowObjective(const double * rowObjective);
00126      int readMps(const char *filename,
00127                  bool keepNames = false,
00128                  bool ignoreErrors = false);
00130      int readGMPL(const char *filename, const char * dataName,
00131                   bool keepNames = false);
00133      void copyInIntegerInformation(const char * information);
00135      void deleteIntegerInformation();
00137      void setContinuous(int index);
00139      void setInteger(int index);
00141      bool isInteger(int index) const;
00143      void resize (int newNumberRows, int newNumberColumns);
00145      void deleteRows(int number, const int * which);
00147      void addRow(int numberInRow, const int * columns,
00148                  const double * elements, double rowLower = -COIN_DBL_MAX,
00149                  double rowUpper = COIN_DBL_MAX);
00151      void addRows(int number, const double * rowLower,
00152                   const double * rowUpper,
00153                   const CoinBigIndex * rowStarts, const int * columns,
00154                   const double * elements);
00156      void addRows(int number, const double * rowLower,
00157                   const double * rowUpper,
00158                   const CoinBigIndex * rowStarts, const int * rowLengths,
00159                   const int * columns,
00160                   const double * elements);
00161 #ifndef CLP_NO_VECTOR
00162      void addRows(int number, const double * rowLower,
00163                   const double * rowUpper,
00164                   const CoinPackedVectorBase * const * rows);
00165 #endif
00166 
00171      int addRows(const CoinBuild & buildObject, bool tryPlusMinusOne = false,
00172                  bool checkDuplicates = true);
00181      int addRows(CoinModel & modelObject, bool tryPlusMinusOne = false,
00182                  bool checkDuplicates = true);
00183 
00185      void deleteColumns(int number, const int * which);
00187      void deleteRowsAndColumns(int numberRows, const int * whichRows,
00188                                int numberColumns, const int * whichColumns);
00190      void addColumn(int numberInColumn,
00191                     const int * rows,
00192                     const double * elements,
00193                     double columnLower = 0.0,
00194                     double  columnUpper = COIN_DBL_MAX,
00195                     double  objective = 0.0);
00197      void addColumns(int number, const double * columnLower,
00198                      const double * columnUpper,
00199                      const double * objective,
00200                      const CoinBigIndex * columnStarts, const int * rows,
00201                      const double * elements);
00202      void addColumns(int number, const double * columnLower,
00203                      const double * columnUpper,
00204                      const double * objective,
00205                      const CoinBigIndex * columnStarts, const int * columnLengths,
00206                      const int * rows,
00207                      const double * elements);
00208 #ifndef CLP_NO_VECTOR
00209      void addColumns(int number, const double * columnLower,
00210                      const double * columnUpper,
00211                      const double * objective,
00212                      const CoinPackedVectorBase * const * columns);
00213 #endif
00214 
00219      int addColumns(const CoinBuild & buildObject, bool tryPlusMinusOne = false,
00220                     bool checkDuplicates = true);
00228      int addColumns(CoinModel & modelObject, bool tryPlusMinusOne = false,
00229                     bool checkDuplicates = true);
00231      inline void modifyCoefficient(int row, int column, double newElement,
00232                                    bool keepZero = false) {
00233           matrix_->modifyCoefficient(row, column, newElement, keepZero);
00234      }
00236      void chgRowLower(const double * rowLower);
00238      void chgRowUpper(const double * rowUpper);
00240      void chgColumnLower(const double * columnLower);
00242      void chgColumnUpper(const double * columnUpper);
00244      void chgObjCoefficients(const double * objIn);
00248      void borrowModel(ClpModel & otherModel);
00251      void returnModel(ClpModel & otherModel);
00252 
00254      void createEmptyMatrix();
00262      int cleanMatrix(double threshold = 1.0e-20);
00264      void copy(const ClpMatrixBase * from, ClpMatrixBase * & to);
00265 #ifndef CLP_NO_STD
00266 
00267      void dropNames();
00269      void copyNames(std::vector<std::string> & rowNames,
00270                     std::vector<std::string> & columnNames);
00272      void copyRowNames(const std::vector<std::string> & rowNames, int first, int last);
00274      void copyColumnNames(const std::vector<std::string> & columnNames, int first, int last);
00276      void copyRowNames(const char * const * rowNames, int first, int last);
00278      void copyColumnNames(const char * const * columnNames, int first, int last);
00280      void setRowName(int rowIndex, std::string & name) ;
00282      void setColumnName(int colIndex, std::string & name) ;
00283 #endif
00284 
00291      int findNetwork(char * rotate, double fractionNeeded = 0.75);
00294      CoinModel * createCoinModel() const;
00295 
00308      int writeMps(const char *filename,
00309                   int formatType = 0, int numberAcross = 2,
00310                   double objSense = 0.0) const ;
00312 
00314 
00315      inline int numberRows() const {
00316           return numberRows_;
00317      }
00318      inline int getNumRows() const {
00319           return numberRows_;
00320      }
00322      inline int getNumCols() const {
00323           return numberColumns_;
00324      }
00325      inline int numberColumns() const {
00326           return numberColumns_;
00327      }
00329      inline double primalTolerance() const {
00330           return dblParam_[ClpPrimalTolerance];
00331      }
00332      void setPrimalTolerance( double value) ;
00334      inline double dualTolerance() const  {
00335           return dblParam_[ClpDualTolerance];
00336      }
00337      void setDualTolerance( double value) ;
00339      inline double primalObjectiveLimit() const {
00340           return dblParam_[ClpPrimalObjectiveLimit];
00341      }
00342      void setPrimalObjectiveLimit(double value);
00344      inline double dualObjectiveLimit() const {
00345           return dblParam_[ClpDualObjectiveLimit];
00346      }
00347      void setDualObjectiveLimit(double value);
00349      inline double objectiveOffset() const {
00350           return dblParam_[ClpObjOffset];
00351      }
00352      void setObjectiveOffset(double value);
00354      inline double presolveTolerance() const {
00355           return dblParam_[ClpPresolveTolerance];
00356      }
00357 #ifndef CLP_NO_STD
00358      inline const std::string & problemName() const {
00359           return strParam_[ClpProbName];
00360      }
00361 #endif
00362 
00363      inline int numberIterations() const  {
00364           return numberIterations_;
00365      }
00366      inline int getIterationCount() const {
00367           return numberIterations_;
00368      }
00369      inline void setNumberIterations(int numberIterationsNew) {
00370           numberIterations_ = numberIterationsNew;
00371      }
00373      inline int solveType() const {
00374           return solveType_;
00375      }
00376      inline void setSolveType(int type) {
00377           solveType_ = type;
00378      }
00380      inline int maximumIterations() const {
00381           return intParam_[ClpMaxNumIteration];
00382      }
00383      void setMaximumIterations(int value);
00385      inline double maximumSeconds() const {
00386           return dblParam_[ClpMaxSeconds];
00387      }
00388      void setMaximumSeconds(double value);
00390      bool hitMaximumIterations() const;
00400      inline int status() const            {
00401           return problemStatus_;
00402      }
00403      inline int problemStatus() const            {
00404           return problemStatus_;
00405      }
00407      inline void setProblemStatus(int problemStatusNew) {
00408           problemStatus_ = problemStatusNew;
00409      }
00424      inline int secondaryStatus() const            {
00425           return secondaryStatus_;
00426      }
00427      inline void setSecondaryStatus(int newstatus) {
00428           secondaryStatus_ = newstatus;
00429      }
00431      inline bool isAbandoned() const             {
00432           return problemStatus_ == 4;
00433      }
00435      inline bool isProvenOptimal() const         {
00436           return problemStatus_ == 0;
00437      }
00439      inline bool isProvenPrimalInfeasible() const {
00440           return problemStatus_ == 1;
00441      }
00443      inline bool isProvenDualInfeasible() const  {
00444           return problemStatus_ == 2;
00445      }
00447      bool isPrimalObjectiveLimitReached() const ;
00449      bool isDualObjectiveLimitReached() const ;
00451      inline bool isIterationLimitReached() const {
00452           return problemStatus_ == 3;
00453      }
00455      inline double optimizationDirection() const {
00456           return  optimizationDirection_;
00457      }
00458      inline double getObjSense() const    {
00459           return optimizationDirection_;
00460      }
00461      void setOptimizationDirection(double value);
00463      inline double * primalRowSolution() const    {
00464           return rowActivity_;
00465      }
00466      inline const double * getRowActivity() const {
00467           return rowActivity_;
00468      }
00470      inline double * primalColumnSolution() const {
00471           return columnActivity_;
00472      }
00473      inline const double * getColSolution() const {
00474           return columnActivity_;
00475      }
00476      inline void setColSolution(const double * input) {
00477           memcpy(columnActivity_, input, numberColumns_ * sizeof(double));
00478      }
00480      inline double * dualRowSolution() const      {
00481           return dual_;
00482      }
00483      inline const double * getRowPrice() const    {
00484           return dual_;
00485      }
00487      inline double * dualColumnSolution() const   {
00488           return reducedCost_;
00489      }
00490      inline const double * getReducedCost() const {
00491           return reducedCost_;
00492      }
00494      inline double* rowLower() const              {
00495           return rowLower_;
00496      }
00497      inline const double* getRowLower() const     {
00498           return rowLower_;
00499      }
00501      inline double* rowUpper() const              {
00502           return rowUpper_;
00503      }
00504      inline const double* getRowUpper() const     {
00505           return rowUpper_;
00506      }
00507      //-------------------------------------------------------------------------
00511      void setObjectiveCoefficient( int elementIndex, double elementValue );
00513      inline void setObjCoeff( int elementIndex, double elementValue ) {
00514           setObjectiveCoefficient( elementIndex, elementValue);
00515      }
00516 
00519      void setColumnLower( int elementIndex, double elementValue );
00520 
00523      void setColumnUpper( int elementIndex, double elementValue );
00524 
00526      void setColumnBounds( int elementIndex,
00527                            double lower, double upper );
00528 
00537      void setColumnSetBounds(const int* indexFirst,
00538                              const int* indexLast,
00539                              const double* boundList);
00540 
00543      inline void setColLower( int elementIndex, double elementValue ) {
00544           setColumnLower(elementIndex, elementValue);
00545      }
00548      inline void setColUpper( int elementIndex, double elementValue ) {
00549           setColumnUpper(elementIndex, elementValue);
00550      }
00551 
00553      inline void setColBounds( int elementIndex,
00554                                double lower, double upper ) {
00555           setColumnBounds(elementIndex, lower, upper);
00556      }
00557 
00564      inline void setColSetBounds(const int* indexFirst,
00565                                  const int* indexLast,
00566                                  const double* boundList) {
00567           setColumnSetBounds(indexFirst, indexLast, boundList);
00568      }
00569 
00572      void setRowLower( int elementIndex, double elementValue );
00573 
00576      void setRowUpper( int elementIndex, double elementValue ) ;
00577 
00579      void setRowBounds( int elementIndex,
00580                         double lower, double upper ) ;
00581 
00588      void setRowSetBounds(const int* indexFirst,
00589                           const int* indexLast,
00590                           const double* boundList);
00591 
00593 
00594      inline const double * rowScale() const {
00595           return rowScale_;
00596      }
00597      inline const double * columnScale() const {
00598           return columnScale_;
00599      }
00600      inline const double * inverseRowScale() const {
00601           return inverseRowScale_;
00602      }
00603      inline const double * inverseColumnScale() const {
00604           return inverseColumnScale_;
00605      }
00606      inline double * mutableRowScale() const {
00607           return rowScale_;
00608      }
00609      inline double * mutableColumnScale() const {
00610           return columnScale_;
00611      }
00612      inline double * mutableInverseRowScale() const {
00613           return inverseRowScale_;
00614      }
00615      inline double * mutableInverseColumnScale() const {
00616           return inverseColumnScale_;
00617      }
00618      void setRowScale(double * scale) ;
00619      void setColumnScale(double * scale);
00621      inline double objectiveScale() const {
00622           return objectiveScale_;
00623      }
00624      inline void setObjectiveScale(double value) {
00625           objectiveScale_ = value;
00626      }
00628      inline double rhsScale() const {
00629           return rhsScale_;
00630      }
00631      inline void setRhsScale(double value) {
00632           rhsScale_ = value;
00633      }
00635      void scaling(int mode = 1);
00638      void unscale();
00640      inline int scalingFlag() const {
00641           return scalingFlag_;
00642      }
00644      inline double * objective() const {
00645           if (objective_) {
00646                double offset;
00647                return objective_->gradient(NULL, NULL, offset, false);
00648           } else {
00649                return NULL;
00650           }
00651      }
00652      inline double * objective(const double * solution, double & offset, bool refresh = true) const {
00653           offset = 0.0;
00654           if (objective_) {
00655                return objective_->gradient(NULL, solution, offset, refresh);
00656           } else {
00657                return NULL;
00658           }
00659      }
00660      inline const double * getObjCoefficients() const {
00661           if (objective_) {
00662                double offset;
00663                return objective_->gradient(NULL, NULL, offset, false);
00664           } else {
00665                return NULL;
00666           }
00667      }
00669      inline double * rowObjective() const         {
00670           return rowObjective_;
00671      }
00672      inline const double * getRowObjCoefficients() const {
00673           return rowObjective_;
00674      }
00676      inline double * columnLower() const          {
00677           return columnLower_;
00678      }
00679      inline const double * getColLower() const    {
00680           return columnLower_;
00681      }
00683      inline double * columnUpper() const          {
00684           return columnUpper_;
00685      }
00686      inline const double * getColUpper() const    {
00687           return columnUpper_;
00688      }
00690      inline CoinPackedMatrix * matrix() const {
00691           if ( matrix_ == NULL ) return NULL;
00692           else return matrix_->getPackedMatrix();
00693      }
00695      inline int getNumElements() const {
00696           return matrix_->getNumElements();
00697      }
00700      inline double getSmallElementValue() const {
00701           return smallElement_;
00702      }
00703      inline void setSmallElementValue(double value) {
00704           smallElement_ = value;
00705      }
00707      inline ClpMatrixBase * rowCopy() const       {
00708           return rowCopy_;
00709      }
00711      void setNewRowCopy(ClpMatrixBase * newCopy);
00713      inline ClpMatrixBase * clpMatrix() const     {
00714           return matrix_;
00715      }
00717      inline ClpPackedMatrix * clpScaledMatrix() const     {
00718           return scaledMatrix_;
00719      }
00721      inline void setClpScaledMatrix(ClpPackedMatrix * scaledMatrix) {
00722           delete scaledMatrix_;
00723           scaledMatrix_ = scaledMatrix;
00724      }
00730      void replaceMatrix(ClpMatrixBase * matrix, bool deleteCurrent = false);
00736      inline void replaceMatrix(CoinPackedMatrix * newmatrix,
00737                                bool deleteCurrent = false) {
00738           replaceMatrix(new ClpPackedMatrix(newmatrix), deleteCurrent);
00739      }
00741      inline double objectiveValue() const {
00742           return objectiveValue_ * optimizationDirection_ - dblParam_[ClpObjOffset];
00743      }
00744      inline void setObjectiveValue(double value) {
00745           objectiveValue_ = (value + dblParam_[ClpObjOffset]) / optimizationDirection_;
00746      }
00747      inline double getObjValue() const {
00748           return objectiveValue_ * optimizationDirection_ - dblParam_[ClpObjOffset];
00749      }
00751      inline char * integerInformation() const     {
00752           return integerType_;
00753      }
00756      double * infeasibilityRay() const;
00757      double * unboundedRay() const;
00759      inline bool rayExists() const {
00760          return (ray_!=NULL);
00761      }
00763      inline void deleteRay() {
00764          delete [] ray_;
00765          ray_=NULL;
00766      }
00768          inline const double * internalRay() const {
00769                  return ray_;
00770          }
00772      inline bool statusExists() const {
00773           return (status_ != NULL);
00774      }
00776      inline unsigned char *  statusArray() const {
00777           return status_;
00778      }
00781      unsigned char *  statusCopy() const;
00783      void copyinStatus(const unsigned char * statusArray);
00784 
00786      inline void setUserPointer (void * pointer) {
00787           userPointer_ = pointer;
00788      }
00789      inline void * getUserPointer () const {
00790           return userPointer_;
00791      }
00793      inline void setTrustedUserPointer (ClpTrustedData * pointer) {
00794           trustedUserPointer_ = pointer;
00795      }
00796      inline ClpTrustedData * getTrustedUserPointer () const {
00797           return trustedUserPointer_;
00798      }
00800      inline int whatsChanged() const {
00801           return whatsChanged_;
00802      }
00803      inline void setWhatsChanged(int value) {
00804           whatsChanged_ = value;
00805      }
00807      inline int numberThreads() const {
00808           return numberThreads_;
00809      }
00810      inline void setNumberThreads(int value) {
00811           numberThreads_ = value;
00812      }
00814 
00816 
00817      void passInMessageHandler(CoinMessageHandler * handler);
00819      CoinMessageHandler * pushMessageHandler(CoinMessageHandler * handler,
00820                                              bool & oldDefault);
00822      void popMessageHandler(CoinMessageHandler * oldHandler, bool oldDefault);
00824      void newLanguage(CoinMessages::Language language);
00825      inline void setLanguage(CoinMessages::Language language) {
00826           newLanguage(language);
00827      }
00829      inline CoinMessageHandler * messageHandler() const       {
00830           return handler_;
00831      }
00833      inline CoinMessages messages() const                     {
00834           return messages_;
00835      }
00837      inline CoinMessages * messagesPointer()                  {
00838           return & messages_;
00839      }
00841      inline CoinMessages coinMessages() const                  {
00842           return coinMessages_;
00843      }
00845      inline CoinMessages * coinMessagesPointer()                  {
00846           return & coinMessages_;
00847      }
00856      inline void setLogLevel(int value)    {
00857           handler_->setLogLevel(value);
00858      }
00859      inline int logLevel() const           {
00860           return handler_->logLevel();
00861      }
00863      inline bool defaultHandler() const {
00864           return defaultHandler_;
00865      }
00867      void passInEventHandler(const ClpEventHandler * eventHandler);
00869      inline ClpEventHandler * eventHandler() const {
00870           return eventHandler_;
00871      }
00873      inline CoinThreadRandom * randomNumberGenerator() {
00874           return &randomNumberGenerator_;
00875      }
00877      inline CoinThreadRandom & mutableRandomNumberGenerator() {
00878           return randomNumberGenerator_;
00879      }
00881      inline void setRandomSeed(int value) {
00882           randomNumberGenerator_.setSeed(value);
00883      }
00885      inline int lengthNames() const {
00886           return lengthNames_;
00887      }
00888 #ifndef CLP_NO_STD
00889 
00890      inline void setLengthNames(int value) {
00891           lengthNames_ = value;
00892      }
00894      inline const std::vector<std::string> * rowNames() const {
00895           return &rowNames_;
00896      }
00897      inline const std::string& rowName(int iRow) const {
00898           return rowNames_[iRow];
00899      }
00901      std::string getRowName(int iRow) const;
00903      inline const std::vector<std::string> * columnNames() const {
00904           return &columnNames_;
00905      }
00906      inline const std::string& columnName(int iColumn) const {
00907           return columnNames_[iColumn];
00908      }
00910      std::string getColumnName(int iColumn) const;
00911 #endif
00912 
00913      inline ClpObjective * objectiveAsObject() const {
00914           return objective_;
00915      }
00916      void setObjective(ClpObjective * objective);
00917      inline void setObjectivePointer(ClpObjective * newobjective) {
00918           objective_ = newobjective;
00919      }
00922      int emptyProblem(int * infeasNumber = NULL, double * infeasSum = NULL, bool printMessage = true);
00923 
00925 
00934      void times(double scalar,
00935                 const double * x, double * y) const;
00939      void transposeTimes(double scalar,
00940                          const double * x, double * y) const ;
00942 
00943 
00944      //---------------------------------------------------------------------------
00962 
00963      bool setIntParam(ClpIntParam key, int value) ;
00965      bool setDblParam(ClpDblParam key, double value) ;
00966 #ifndef CLP_NO_STD
00967 
00968      bool setStrParam(ClpStrParam key, const std::string & value);
00969 #endif
00970      // Get an integer parameter
00971      inline bool getIntParam(ClpIntParam key, int& value) const {
00972           if (key < ClpLastIntParam) {
00973                value = intParam_[key];
00974                return true;
00975           } else {
00976                return false;
00977           }
00978      }
00979      // Get an double parameter
00980      inline bool getDblParam(ClpDblParam key, double& value) const {
00981           if (key < ClpLastDblParam) {
00982                value = dblParam_[key];
00983                return true;
00984           } else {
00985                return false;
00986           }
00987      }
00988 #ifndef CLP_NO_STD
00989      // Get a string parameter
00990      inline bool getStrParam(ClpStrParam key, std::string& value) const {
00991           if (key < ClpLastStrParam) {
00992                value = strParam_[key];
00993                return true;
00994           } else {
00995                return false;
00996           }
00997      }
00998 #endif
00999 
01000      void generateCpp( FILE * fp);
01034      inline unsigned int specialOptions() const {
01035           return specialOptions_;
01036      }
01037      void setSpecialOptions(unsigned int value);
01038 #define COIN_CBC_USING_CLP 0x01000000
01039      inline bool inCbcBranchAndBound() const {
01040           return (specialOptions_ & COIN_CBC_USING_CLP) != 0;
01041      }
01043 
01046 protected:
01048      void gutsOfDelete(int type);
01052      void gutsOfCopy(const ClpModel & rhs, int trueCopy = 1);
01054      void getRowBound(int iRow, double& lower, double& upper) const;
01056      void gutsOfLoadModel ( int numberRows, int numberColumns,
01057                             const double* collb, const double* colub,
01058                             const double* obj,
01059                             const double* rowlb, const double* rowub,
01060                             const double * rowObjective = NULL);
01062      void gutsOfScaling();
01064      inline double rawObjectiveValue() const {
01065           return objectiveValue_;
01066      }
01068      inline bool permanentArrays() const {
01069           return (specialOptions_ & 65536) != 0;
01070      }
01072      void startPermanentArrays();
01074      void stopPermanentArrays();
01076      const char * const * rowNamesAsChar() const;
01078      const char * const * columnNamesAsChar() const;
01080      void deleteNamesAsChar(const char * const * names, int number) const;
01082      void onStopped();
01084 
01085 
01087 protected:
01088 
01091 
01092      double optimizationDirection_;
01094      double dblParam_[ClpLastDblParam];
01096      double objectiveValue_;
01098      double smallElement_;
01100      double objectiveScale_;
01102      double rhsScale_;
01104      int numberRows_;
01106      int numberColumns_;
01108      double * rowActivity_;
01110      double * columnActivity_;
01112      double * dual_;
01114      double * reducedCost_;
01116      double* rowLower_;
01118      double* rowUpper_;
01120      ClpObjective * objective_;
01122      double * rowObjective_;
01124      double * columnLower_;
01126      double * columnUpper_;
01128      ClpMatrixBase * matrix_;
01130      ClpMatrixBase * rowCopy_;
01132      ClpPackedMatrix * scaledMatrix_;
01134      double * ray_;
01136      double * rowScale_;
01138      double * columnScale_;
01140      double * inverseRowScale_;
01142      double * inverseColumnScale_;
01145      int scalingFlag_;
01153      unsigned char * status_;
01155      char * integerType_;
01157      void * userPointer_;
01159      ClpTrustedData * trustedUserPointer_;
01161      int intParam_[ClpLastIntParam];
01163      int numberIterations_;
01165      int solveType_;
01182 #define ROW_COLUMN_COUNTS_SAME 1
01183 #define MATRIX_SAME 2
01184 #define MATRIX_JUST_ROWS_ADDED 4
01185 #define MATRIX_JUST_COLUMNS_ADDED 8
01186 #define ROW_LOWER_SAME 16
01187 #define ROW_UPPER_SAME 32
01188 #define OBJECTIVE_SAME 64 
01189 #define COLUMN_LOWER_SAME 128
01190 #define COLUMN_UPPER_SAME 256
01191 #define BASIS_SAME 512
01192 #define ALL_SAME 65339
01193 #define ALL_SAME_EXCEPT_COLUMN_BOUNDS 65337
01194      unsigned int whatsChanged_;
01196      int problemStatus_;
01198      int secondaryStatus_;
01200      int lengthNames_;
01202      int numberThreads_;
01206      unsigned int specialOptions_;
01208      CoinMessageHandler * handler_;
01210      bool defaultHandler_;
01212      CoinThreadRandom randomNumberGenerator_;
01214      ClpEventHandler * eventHandler_;
01215 #ifndef CLP_NO_STD
01216 
01217      std::vector<std::string> rowNames_;
01219      std::vector<std::string> columnNames_;
01220 #endif
01221 
01222      CoinMessages messages_;
01224      CoinMessages coinMessages_;
01226      int maximumColumns_;
01228      int maximumRows_;
01230      int maximumInternalColumns_;
01232      int maximumInternalRows_;
01234      CoinPackedMatrix baseMatrix_;
01236      CoinPackedMatrix baseRowCopy_;
01238      double * savedRowScale_;
01240      double * savedColumnScale_;
01241 #ifndef CLP_NO_STD
01242 
01243      std::string strParam_[ClpLastStrParam];
01244 #endif
01245 
01246 };
01249 class ClpDataSave {
01250 
01251 public:
01255 
01256      ClpDataSave (  );
01257 
01259      ClpDataSave(const ClpDataSave &);
01261      ClpDataSave & operator=(const ClpDataSave & rhs);
01263      ~ClpDataSave (  );
01264 
01266 
01268 public:
01269 
01272      double dualBound_;
01273      double infeasibilityCost_;
01274      double pivotTolerance_;
01275      double zeroFactorizationTolerance_;
01276      double zeroSimplexTolerance_;
01277      double acceptablePivot_;
01278      double objectiveScale_;
01279      int sparseThreshold_;
01280      int perturbation_;
01281      int forceFactorization_;
01282      int scalingFlag_;
01283      unsigned int specialOptions_;
01285 };
01286 
01287 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines