- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

# /home/coin/svn-release/Blis-0.93.10/Clp/src/ClpModel.hpp

Go to the documentation of this file.

    00001 /* $Id: ClpModel.hpp 1941 2013-04-10 16:52:27Z stefan $ */
    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
    00267      void dropNames();
    00269      void copyNames(const std::vector<std::string> & rowNames,
    00270                     const 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
    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      inline double * swapRowScale(double * newScale) {
    00619           double * oldScale = rowScale_;
    00620           rowScale_ = newScale;
    00621           return oldScale;
    00622      }
    00623      void setRowScale(double * scale) ;
    00624      void setColumnScale(double * scale);
    00626      inline double objectiveScale() const {
    00627           return objectiveScale_;
    00628      }
    00629      inline void setObjectiveScale(double value) {
    00630           objectiveScale_ = value;
    00631      }
    00633      inline double rhsScale() const {
    00634           return rhsScale_;
    00635      }
    00636      inline void setRhsScale(double value) {
    00637           rhsScale_ = value;
    00638      }
    00640      void scaling(int mode = 1);
    00643      void unscale();
    00645      inline int scalingFlag() const {
    00646           return scalingFlag_;
    00647      }
    00649      inline double * objective() const {
    00650           if (objective_) {
    00651                double offset;
    00652                return objective_->gradient(NULL, NULL, offset, false);
    00653           } else {
    00654                return NULL;
    00655           }
    00656      }
    00657      inline double * objective(const double * solution, double & offset, bool refresh = true) const {
    00658           offset = 0.0;
    00659           if (objective_) {
    00660                return objective_->gradient(NULL, solution, offset, refresh);
    00661           } else {
    00662                return NULL;
    00663           }
    00664      }
    00665      inline const double * getObjCoefficients() const {
    00666           if (objective_) {
    00667                double offset;
    00668                return objective_->gradient(NULL, NULL, offset, false);
    00669           } else {
    00670                return NULL;
    00671           }
    00672      }
    00674      inline double * rowObjective() const         {
    00675           return rowObjective_;
    00676      }
    00677      inline const double * getRowObjCoefficients() const {
    00678           return rowObjective_;
    00679      }
    00681      inline double * columnLower() const          {
    00682           return columnLower_;
    00683      }
    00684      inline const double * getColLower() const    {
    00685           return columnLower_;
    00686      }
    00688      inline double * columnUpper() const          {
    00689           return columnUpper_;
    00690      }
    00691      inline const double * getColUpper() const    {
    00692           return columnUpper_;
    00693      }
    00695      inline CoinPackedMatrix * matrix() const {
    00696           if ( matrix_ == NULL ) return NULL;
    00697           else return matrix_->getPackedMatrix();
    00698      }
    00700      inline int getNumElements() const {
    00701           return matrix_->getNumElements();
    00702      }
    00705      inline double getSmallElementValue() const {
    00706           return smallElement_;
    00707      }
    00708      inline void setSmallElementValue(double value) {
    00709           smallElement_ = value;
    00710      }
    00712      inline ClpMatrixBase * rowCopy() const       {
    00713           return rowCopy_;
    00714      }
    00716      void setNewRowCopy(ClpMatrixBase * newCopy);
    00718      inline ClpMatrixBase * clpMatrix() const     {
    00719           return matrix_;
    00720      }
    00722      inline ClpPackedMatrix * clpScaledMatrix() const     {
    00723           return scaledMatrix_;
    00724      }
    00726      inline void setClpScaledMatrix(ClpPackedMatrix * scaledMatrix) {
    00727           delete scaledMatrix_;
    00728           scaledMatrix_ = scaledMatrix;
    00729      }
    00731      inline ClpPackedMatrix * swapScaledMatrix(ClpPackedMatrix * scaledMatrix) {
    00732           ClpPackedMatrix * oldMatrix = scaledMatrix_;
    00733           scaledMatrix_ = scaledMatrix;
    00734           return oldMatrix;
    00735      }
    00741      void replaceMatrix(ClpMatrixBase * matrix, bool deleteCurrent = false);
    00747      inline void replaceMatrix(CoinPackedMatrix * newmatrix,
    00748                                bool deleteCurrent = false) {
    00749           replaceMatrix(new ClpPackedMatrix(newmatrix), deleteCurrent);
    00750      }
    00752      inline double objectiveValue() const {
    00753           return objectiveValue_ * optimizationDirection_ - dblParam_[ClpObjOffset];
    00754      }
    00755      inline void setObjectiveValue(double value) {
    00756           objectiveValue_ = (value + dblParam_[ClpObjOffset]) / optimizationDirection_;
    00757      }
    00758      inline double getObjValue() const {
    00759           return objectiveValue_ * optimizationDirection_ - dblParam_[ClpObjOffset];
    00760      }
    00762      inline char * integerInformation() const     {
    00763           return integerType_;
    00764      }
    00767      double * infeasibilityRay(bool fullRay=false) const;
    00768      double * unboundedRay() const;
    00770      inline double * ray() const
    00771      { return ray_;}
    00773      inline bool rayExists() const {
    00774          return (ray_!=NULL);
    00775      }
    00777      inline void deleteRay() {
    00778          delete [] ray_;
    00779          ray_=NULL;
    00780      }
    00782          inline const double * internalRay() const {
    00783                  return ray_;
    00784          }
    00786      inline bool statusExists() const {
    00787           return (status_ != NULL);
    00788      }
    00790      inline unsigned char *  statusArray() const {
    00791           return status_;
    00792      }
    00795      unsigned char *  statusCopy() const;
    00797      void copyinStatus(const unsigned char * statusArray);
    00798
    00800      inline void setUserPointer (void * pointer) {
    00801           userPointer_ = pointer;
    00802      }
    00803      inline void * getUserPointer () const {
    00804           return userPointer_;
    00805      }
    00807      inline void setTrustedUserPointer (ClpTrustedData * pointer) {
    00808           trustedUserPointer_ = pointer;
    00809      }
    00810      inline ClpTrustedData * getTrustedUserPointer () const {
    00811           return trustedUserPointer_;
    00812      }
    00814      inline int whatsChanged() const {
    00815           return whatsChanged_;
    00816      }
    00817      inline void setWhatsChanged(int value) {
    00818           whatsChanged_ = value;
    00819      }
    00821      inline int numberThreads() const {
    00822           return numberThreads_;
    00823      }
    00824      inline void setNumberThreads(int value) {
    00825           numberThreads_ = value;
    00826      }
    00828
    00830
    00831      void passInMessageHandler(CoinMessageHandler * handler);
    00833      CoinMessageHandler * pushMessageHandler(CoinMessageHandler * handler,
    00834                                              bool & oldDefault);
    00836      void popMessageHandler(CoinMessageHandler * oldHandler, bool oldDefault);
    00838      void newLanguage(CoinMessages::Language language);
    00839      inline void setLanguage(CoinMessages::Language language) {
    00840           newLanguage(language);
    00841      }
    00843      void setDefaultMessageHandler();
    00845      inline CoinMessageHandler * messageHandler() const       {
    00846           return handler_;
    00847      }
    00849      inline CoinMessages messages() const                     {
    00850           return messages_;
    00851      }
    00853      inline CoinMessages * messagesPointer()                  {
    00854           return & messages_;
    00855      }
    00857      inline CoinMessages coinMessages() const                  {
    00858           return coinMessages_;
    00859      }
    00861      inline CoinMessages * coinMessagesPointer()                  {
    00862           return & coinMessages_;
    00863      }
    00872      inline void setLogLevel(int value)    {
    00873           handler_->setLogLevel(value);
    00874      }
    00875      inline int logLevel() const           {
    00876           return handler_->logLevel();
    00877      }
    00879      inline bool defaultHandler() const {
    00880           return defaultHandler_;
    00881      }
    00883      void passInEventHandler(const ClpEventHandler * eventHandler);
    00885      inline ClpEventHandler * eventHandler() const {
    00886           return eventHandler_;
    00887      }
    00889      inline CoinThreadRandom * randomNumberGenerator() {
    00890           return &randomNumberGenerator_;
    00891      }
    00893      inline CoinThreadRandom & mutableRandomNumberGenerator() {
    00894           return randomNumberGenerator_;
    00895      }
    00897      inline void setRandomSeed(int value) {
    00898           randomNumberGenerator_.setSeed(value);
    00899      }
    00901      inline int lengthNames() const {
    00902           return lengthNames_;
    00903      }
    00904 #ifndef CLP_NO_STD
    00906      inline void setLengthNames(int value) {
    00907           lengthNames_ = value;
    00908      }
    00910      inline const std::vector<std::string> * rowNames() const {
    00911           return &rowNames_;
    00912      }
    00913      inline const std::string& rowName(int iRow) const {
    00914           return rowNames_[iRow];
    00915      }
    00917      std::string getRowName(int iRow) const;
    00919      inline const std::vector<std::string> * columnNames() const {
    00920           return &columnNames_;
    00921      }
    00922      inline const std::string& columnName(int iColumn) const {
    00923           return columnNames_[iColumn];
    00924      }
    00926      std::string getColumnName(int iColumn) const;
    00927 #endif
    00929      inline ClpObjective * objectiveAsObject() const {
    00930           return objective_;
    00931      }
    00932      void setObjective(ClpObjective * objective);
    00933      inline void setObjectivePointer(ClpObjective * newobjective) {
    00934           objective_ = newobjective;
    00935      }
    00938      int emptyProblem(int * infeasNumber = NULL, double * infeasSum = NULL, bool printMessage = true);
    00939
    00941
    00950      void times(double scalar,
    00951                 const double * x, double * y) const;
    00955      void transposeTimes(double scalar,
    00956                          const double * x, double * y) const ;
    00958
    00959
    00960      //---------------------------------------------------------------------------
    00978
    00979      bool setIntParam(ClpIntParam key, int value) ;
    00981      bool setDblParam(ClpDblParam key, double value) ;
    00982 #ifndef CLP_NO_STD
    00984      bool setStrParam(ClpStrParam key, const std::string & value);
    00985 #endif
    00986      // Get an integer parameter
    00987      inline bool getIntParam(ClpIntParam key, int& value) const {
    00988           if (key < ClpLastIntParam) {
    00989                value = intParam_[key];
    00990                return true;
    00991           } else {
    00992                return false;
    00993           }
    00994      }
    00995      // Get an double parameter
    00996      inline bool getDblParam(ClpDblParam key, double& value) const {
    00997           if (key < ClpLastDblParam) {
    00998                value = dblParam_[key];
    00999                return true;
    01000           } else {
    01001                return false;
    01002           }
    01003      }
    01004 #ifndef CLP_NO_STD
    01005      // Get a string parameter
    01006      inline bool getStrParam(ClpStrParam key, std::string& value) const {
    01007           if (key < ClpLastStrParam) {
    01008                value = strParam_[key];
    01009                return true;
    01010           } else {
    01011                return false;
    01012           }
    01013      }
    01014 #endif
    01016      void generateCpp( FILE * fp);
    01017
    01050      inline unsigned int specialOptions() const {
    01051           return specialOptions_;
    01052      }
    01053      void setSpecialOptions(unsigned int value);
    01054 #define COIN_CBC_USING_CLP 0x01000000
    01055      inline bool inCbcBranchAndBound() const {
    01056           return (specialOptions_ & COIN_CBC_USING_CLP) != 0;
    01057      }
    01059
    01062 protected:
    01064      void gutsOfDelete(int type);
    01068      void gutsOfCopy(const ClpModel & rhs, int trueCopy = 1);
    01070      void getRowBound(int iRow, double& lower, double& upper) const;
    01072      void gutsOfLoadModel ( int numberRows, int numberColumns,
    01073                             const double* collb, const double* colub,
    01074                             const double* obj,
    01075                             const double* rowlb, const double* rowub,
    01076                             const double * rowObjective = NULL);
    01078      void gutsOfScaling();
    01080      inline double rawObjectiveValue() const {
    01081           return objectiveValue_;
    01082      }
    01084      inline bool permanentArrays() const {
    01085           return (specialOptions_ & 65536) != 0;
    01086      }
    01088      void startPermanentArrays();
    01090      void stopPermanentArrays();
    01092      const char * const * rowNamesAsChar() const;
    01094      const char * const * columnNamesAsChar() const;
    01096      void deleteNamesAsChar(const char * const * names, int number) const;
    01098      void onStopped();
    01100
    01101
    01103 protected:
    01104
    01107
    01108      double optimizationDirection_;
    01110      double dblParam_[ClpLastDblParam];
    01112      double objectiveValue_;
    01114      double smallElement_;
    01116      double objectiveScale_;
    01118      double rhsScale_;
    01120      int numberRows_;
    01122      int numberColumns_;
    01124      double * rowActivity_;
    01126      double * columnActivity_;
    01128      double * dual_;
    01130      double * reducedCost_;
    01132      double* rowLower_;
    01134      double* rowUpper_;
    01136      ClpObjective * objective_;
    01138      double * rowObjective_;
    01140      double * columnLower_;
    01142      double * columnUpper_;
    01144      ClpMatrixBase * matrix_;
    01146      ClpMatrixBase * rowCopy_;
    01148      ClpPackedMatrix * scaledMatrix_;
    01150      double * ray_;
    01152      double * rowScale_;
    01154      double * columnScale_;
    01156      double * inverseRowScale_;
    01158      double * inverseColumnScale_;
    01161      int scalingFlag_;
    01169      unsigned char * status_;
    01171      char * integerType_;
    01173      void * userPointer_;
    01175      ClpTrustedData * trustedUserPointer_;
    01177      int intParam_[ClpLastIntParam];
    01179      int numberIterations_;
    01181      int solveType_;
    01198 #define ROW_COLUMN_COUNTS_SAME 1
    01199 #define MATRIX_SAME 2
    01200 #define MATRIX_JUST_ROWS_ADDED 4
    01201 #define MATRIX_JUST_COLUMNS_ADDED 8
    01202 #define ROW_LOWER_SAME 16
    01203 #define ROW_UPPER_SAME 32
    01204 #define OBJECTIVE_SAME 64
    01205 #define COLUMN_LOWER_SAME 128
    01206 #define COLUMN_UPPER_SAME 256
    01207 #define BASIS_SAME 512
    01208 #define ALL_SAME 65339
    01209 #define ALL_SAME_EXCEPT_COLUMN_BOUNDS 65337
    01210      unsigned int whatsChanged_;
    01212      int problemStatus_;
    01214      int secondaryStatus_;
    01216      int lengthNames_;
    01218      int numberThreads_;
    01222      unsigned int specialOptions_;
    01224      CoinMessageHandler * handler_;
    01226      bool defaultHandler_;
    01228      CoinThreadRandom randomNumberGenerator_;
    01230      ClpEventHandler * eventHandler_;
    01231 #ifndef CLP_NO_STD
    01233      std::vector<std::string> rowNames_;
    01235      std::vector<std::string> columnNames_;
    01236 #endif
    01238      CoinMessages messages_;
    01240      CoinMessages coinMessages_;
    01242      int maximumColumns_;
    01244      int maximumRows_;
    01246      int maximumInternalColumns_;
    01248      int maximumInternalRows_;
    01250      CoinPackedMatrix baseMatrix_;
    01252      CoinPackedMatrix baseRowCopy_;
    01254      double * savedRowScale_;
    01256      double * savedColumnScale_;
    01257 #ifndef CLP_NO_STD
    01259      std::string strParam_[ClpLastStrParam];
    01260 #endif
    01261
    01262 };
    01265 class ClpDataSave {
    01266
    01267 public:
    01271
    01272      ClpDataSave (  );
    01273
    01275      ClpDataSave(const ClpDataSave &);
    01277      ClpDataSave & operator=(const ClpDataSave & rhs);
    01279      ~ClpDataSave (  );
    01280
    01282
    01284 public:
    01285
    01288      double dualBound_;
    01289      double infeasibilityCost_;
    01290      double pivotTolerance_;
    01291      double zeroFactorizationTolerance_;
    01292      double zeroSimplexTolerance_;
    01293      double acceptablePivot_;
    01294      double objectiveScale_;
    01295      int sparseThreshold_;
    01296      int perturbation_;
    01297      int forceFactorization_;
    01298      int scalingFlag_;
    01299      unsigned int specialOptions_;
    01301 };
    01302
    01303 #endif