Ignore:
Timestamp:
Jan 6, 2019 2:43:06 PM (3 months ago)
Author:
unxusr
Message:

formatting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Clp/src/ClpMatrixBase.hpp

    r2271 r2385  
    3636*/
    3737
    38 class ClpMatrixBase  {
     38class ClpMatrixBase {
    3939
    4040public:
    41      /**@name Virtual methods that the derived classes must provide */
    42      //@{
    43      /// Return a complete CoinPackedMatrix
    44      virtual CoinPackedMatrix * getPackedMatrix() const = 0;
    45      /** Whether the packed matrix is column major ordered or not. */
    46      virtual bool isColOrdered() const = 0;
    47      /** Number of entries in the packed matrix. */
    48      virtual CoinBigIndex getNumElements() const = 0;
    49      /** Number of columns. */
    50      virtual int getNumCols() const = 0;
    51      /** Number of rows. */
    52      virtual int getNumRows() const = 0;
    53 
    54      /** A vector containing the elements in the packed matrix. Note that there
     41  /**@name Virtual methods that the derived classes must provide */
     42  //@{
     43  /// Return a complete CoinPackedMatrix
     44  virtual CoinPackedMatrix *getPackedMatrix() const = 0;
     45  /** Whether the packed matrix is column major ordered or not. */
     46  virtual bool isColOrdered() const = 0;
     47  /** Number of entries in the packed matrix. */
     48  virtual CoinBigIndex getNumElements() const = 0;
     49  /** Number of columns. */
     50  virtual int getNumCols() const = 0;
     51  /** Number of rows. */
     52  virtual int getNumRows() const = 0;
     53
     54  /** A vector containing the elements in the packed matrix. Note that there
    5555         might be gaps in this list, entries that do not belong to any
    5656         major-dimension vector. To get the actual elements one should look at
    5757         this vector together with vectorStarts and vectorLengths. */
    58      virtual const double * getElements() const = 0;
    59      /** A vector containing the minor indices of the elements in the packed
     58  virtual const double *getElements() const = 0;
     59  /** A vector containing the minor indices of the elements in the packed
    6060         matrix. Note that there might be gaps in this list, entries that do not
    6161         belong to any major-dimension vector. To get the actual elements one
    6262         should look at this vector together with vectorStarts and
    6363         vectorLengths. */
    64      virtual const int * getIndices() const = 0;
    65 
    66      virtual const CoinBigIndex * getVectorStarts() const = 0;
    67      /** The lengths of the major-dimension vectors. */
    68      virtual const int * getVectorLengths() const = 0 ;
    69      /** The length of a single major-dimension vector. */
    70      virtual int getVectorLength(int index) const ;
    71      /** Delete the columns whose indices are listed in <code>indDel</code>. */
    72      virtual void deleteCols(const int numDel, const int * indDel) = 0;
    73      /** Delete the rows whose indices are listed in <code>indDel</code>. */
    74      virtual void deleteRows(const int numDel, const int * indDel) = 0;
     64  virtual const int *getIndices() const = 0;
     65
     66  virtual const CoinBigIndex *getVectorStarts() const = 0;
     67  /** The lengths of the major-dimension vectors. */
     68  virtual const int *getVectorLengths() const = 0;
     69  /** The length of a single major-dimension vector. */
     70  virtual int getVectorLength(int index) const;
     71  /** Delete the columns whose indices are listed in <code>indDel</code>. */
     72  virtual void deleteCols(const int numDel, const int *indDel) = 0;
     73  /** Delete the rows whose indices are listed in <code>indDel</code>. */
     74  virtual void deleteRows(const int numDel, const int *indDel) = 0;
    7575#ifndef CLP_NO_VECTOR
    76      /// Append Columns
    77      virtual void appendCols(int number, const CoinPackedVectorBase * const * columns);
    78      /// Append Rows
    79      virtual void appendRows(int number, const CoinPackedVectorBase * const * rows);
     76  /// Append Columns
     77  virtual void appendCols(int number, const CoinPackedVectorBase *const *columns);
     78  /// Append Rows
     79  virtual void appendRows(int number, const CoinPackedVectorBase *const *rows);
    8080#endif
    81      /** Modify one element of packed matrix.  An element may be added.
     81  /** Modify one element of packed matrix.  An element may be added.
    8282         This works for either ordering If the new element is zero it will be
    8383         deleted unless keepZero true */
    84      virtual void modifyCoefficient(int row, int column, double newElement,
    85                                     bool keepZero = false);
    86      /** Append a set of rows/columns to the end of the matrix. Returns number of errors
     84  virtual void modifyCoefficient(int row, int column, double newElement,
     85    bool keepZero = false);
     86  /** Append a set of rows/columns to the end of the matrix. Returns number of errors
    8787         i.e. if any of the new rows/columns contain an index that's larger than the
    8888         number of columns-1/rows-1 (if numberOther>0) or duplicates
    8989         If 0 then rows, 1 if columns */
    90      virtual int appendMatrix(int number, int type,
    91                               const CoinBigIndex * starts, const int * index,
    92                               const double * element, int numberOther = -1);
    93 
    94      /** Returns a new matrix in reverse order without gaps
     90  virtual int appendMatrix(int number, int type,
     91    const CoinBigIndex *starts, const int *index,
     92    const double *element, int numberOther = -1);
     93
     94  /** Returns a new matrix in reverse order without gaps
    9595         Is allowed to return NULL if doesn't want to have row copy */
    96      virtual ClpMatrixBase * reverseOrderedCopy() const {
    97           return NULL;
    98      }
    99 
    100      /// Returns number of elements in column part of basis
    101      virtual int countBasis(const int * whichColumn,
    102                                      int & numberColumnBasic) = 0;
    103      /// Fills in column part of basis
    104      virtual void fillBasis(ClpSimplex * model,
    105                             const int * whichColumn,
    106                             int & numberColumnBasic,
    107                             int * row, int * start,
    108                             int * rowCount, int * columnCount,
    109                             CoinFactorizationDouble * element) = 0;
    110      /** Creates scales for column copy (rowCopy in model may be modified)
     96  virtual ClpMatrixBase *reverseOrderedCopy() const
     97  {
     98    return NULL;
     99  }
     100
     101  /// Returns number of elements in column part of basis
     102  virtual int countBasis(const int *whichColumn,
     103    int &numberColumnBasic)
     104    = 0;
     105  /// Fills in column part of basis
     106  virtual void fillBasis(ClpSimplex *model,
     107    const int *whichColumn,
     108    int &numberColumnBasic,
     109    int *row, int *start,
     110    int *rowCount, int *columnCount,
     111    CoinFactorizationDouble *element)
     112    = 0;
     113  /** Creates scales for column copy (rowCopy in model may be modified)
    111114         default does not allow scaling
    112115         returns non-zero if no scaling done */
    113      virtual int scale(ClpModel * , ClpSimplex * = NULL) const {
    114           return 1;
    115      }
    116      /** Scales rowCopy if column copy scaled
     116  virtual int scale(ClpModel *, ClpSimplex * = NULL) const
     117  {
     118    return 1;
     119  }
     120  /** Scales rowCopy if column copy scaled
    117121         Only called if scales already exist */
    118      virtual void scaleRowCopy(ClpModel * ) const { }
    119      /// Returns true if can create row copy
    120      virtual bool canGetRowCopy() const {
    121           return true;
    122      }
    123      /** Realy really scales column copy
     122  virtual void scaleRowCopy(ClpModel *) const {}
     123  /// Returns true if can create row copy
     124  virtual bool canGetRowCopy() const
     125  {
     126    return true;
     127  }
     128  /** Realy really scales column copy
    124129         Only called if scales already exist.
    125130         Up to user to delete */
    126      inline virtual ClpMatrixBase * scaledColumnCopy(ClpModel * ) const {
    127           return this->clone();
    128      }
    129 
    130      /** Checks if all elements are in valid range.  Can just
     131  inline virtual ClpMatrixBase *scaledColumnCopy(ClpModel *) const
     132  {
     133    return this->clone();
     134  }
     135
     136  /** Checks if all elements are in valid range.  Can just
    131137         return true if you are not paranoid.  For Clp I will
    132138         probably expect no zeros.  Code can modify matrix to get rid of
     
    138144         8 - report on large and small
    139145     */
    140      virtual bool allElementsInRange(ClpModel * ,
    141                                      double , double ,
    142                                      int = 15) {
    143           return true;
    144      }
    145      /** Set the dimensions of the matrix. In effect, append new empty
     146  virtual bool allElementsInRange(ClpModel *,
     147    double, double,
     148    int = 15)
     149  {
     150    return true;
     151  }
     152  /** Set the dimensions of the matrix. In effect, append new empty
    146153         columns/rows to the matrix. A negative number for either dimension
    147154         means that that dimension doesn't change. Otherwise the new dimensions
    148155         MUST be at least as large as the current ones otherwise an exception
    149156         is thrown. */
    150      virtual void setDimensions(int numrows, int numcols);
    151      /** Returns largest and smallest elements of both signs.
     157  virtual void setDimensions(int numrows, int numcols);
     158  /** Returns largest and smallest elements of both signs.
    152159         Largest refers to largest absolute value.
    153160         If returns zeros then can't tell anything */
    154      virtual void rangeOfElements(double & smallestNegative, double & largestNegative,
    155                                   double & smallestPositive, double & largestPositive);
    156 
    157      /** Unpacks a column into an CoinIndexedvector
     161  virtual void rangeOfElements(double &smallestNegative, double &largestNegative,
     162    double &smallestPositive, double &largestPositive);
     163
     164  /** Unpacks a column into an CoinIndexedvector
    158165      */
    159      virtual void unpack(const ClpSimplex * model, CoinIndexedVector * rowArray,
    160                          int column) const = 0;
    161      /** Unpacks a column into an CoinIndexedvector
     166  virtual void unpack(const ClpSimplex *model, CoinIndexedVector *rowArray,
     167    int column) const = 0;
     168  /** Unpacks a column into an CoinIndexedvector
    162169      ** in packed format
    163170      Note that model is NOT const.  Bounds and objective could
    164171      be modified if doing column generation (just for this variable) */
    165      virtual void unpackPacked(ClpSimplex * model,
    166                                CoinIndexedVector * rowArray,
    167                                int column) const = 0;
    168      /** Purely for column generation and similar ideas.  Allows
     172  virtual void unpackPacked(ClpSimplex *model,
     173    CoinIndexedVector *rowArray,
     174    int column) const = 0;
     175  /** Purely for column generation and similar ideas.  Allows
    169176         matrix and any bounds or costs to be updated (sensibly).
    170177         Returns non-zero if any changes.
    171178     */
    172      virtual int refresh(ClpSimplex * ) {
    173           return 0;
    174      }
    175 
    176      // Really scale matrix
    177      virtual void reallyScale(const double * rowScale, const double * columnScale);
    178      /** Given positive integer weights for each row fills in sum of weights
     179  virtual int refresh(ClpSimplex *)
     180  {
     181    return 0;
     182  }
     183
     184  // Really scale matrix
     185  virtual void reallyScale(const double *rowScale, const double *columnScale);
     186  /** Given positive integer weights for each row fills in sum of weights
    179187         for each column (and slack).
    180188         Returns weights vector
    181189         Default returns vector of ones
    182190     */
    183      virtual CoinBigIndex * dubiousWeights(const ClpSimplex * model, int * inputWeights) const;
    184      /** Adds multiple of a column into an CoinIndexedvector
     191  virtual CoinBigIndex *dubiousWeights(const ClpSimplex *model, int *inputWeights) const;
     192  /** Adds multiple of a column into an CoinIndexedvector
    185193         You can use quickAdd to add to vector */
    186      virtual void add(const ClpSimplex * model, CoinIndexedVector * rowArray,
    187                       int column, double multiplier) const = 0;
    188      /** Adds multiple of a column into an array */
    189      virtual void add(const ClpSimplex * model, double * array,
    190                       int column, double multiplier) const = 0;
    191      /// Allow any parts of a created CoinPackedMatrix to be deleted
    192      virtual void releasePackedMatrix() const = 0;
    193      /// Says whether it can do partial pricing
    194      virtual bool canDoPartialPricing() const;
    195      /// Returns number of hidden rows e.g. gub
    196      virtual int hiddenRows() const;
    197      /// Partial pricing
    198      virtual void partialPricing(ClpSimplex * model, double start, double end,
    199                                  int & bestSequence, int & numberWanted);
    200      /** expands an updated column to allow for extra rows which the main
     194  virtual void add(const ClpSimplex *model, CoinIndexedVector *rowArray,
     195    int column, double multiplier) const = 0;
     196  /** Adds multiple of a column into an array */
     197  virtual void add(const ClpSimplex *model, double *array,
     198    int column, double multiplier) const = 0;
     199  /// Allow any parts of a created CoinPackedMatrix to be deleted
     200  virtual void releasePackedMatrix() const = 0;
     201  /// Says whether it can do partial pricing
     202  virtual bool canDoPartialPricing() const;
     203  /// Returns number of hidden rows e.g. gub
     204  virtual int hiddenRows() const;
     205  /// Partial pricing
     206  virtual void partialPricing(ClpSimplex *model, double start, double end,
     207    int &bestSequence, int &numberWanted);
     208  /** expands an updated column to allow for extra rows which the main
    201209         solver does not know about and returns number added.
    202210
     
    207215         mode 1 - delete etc
    208216     */
    209      virtual int extendUpdated(ClpSimplex * model, CoinIndexedVector * update, int mode);
    210      /**
     217  virtual int extendUpdated(ClpSimplex *model, CoinIndexedVector *update, int mode);
     218  /**
    211219        utility primal function for dealing with dynamic constraints
    212220        mode=0  - Set up before "update" and "times" for primal solution using extended rows
     
    214222        mode=2  - Check (or report on) primal infeasibilities
    215223     */
    216      virtual void primalExpanded(ClpSimplex * model, int mode);
    217      /**
     224  virtual void primalExpanded(ClpSimplex *model, int mode);
     225  /**
    218226         utility dual function for dealing with dynamic constraints
    219227         mode=0  - Set up before "updateTranspose" and "transposeTimes" for duals using extended
     
    224232         mode=4  - Modify before updateTranspose in partial pricing
    225233     */
    226      virtual void dualExpanded(ClpSimplex * model, CoinIndexedVector * array,
    227                                double * other, int mode);
    228      /**
     234  virtual void dualExpanded(ClpSimplex *model, CoinIndexedVector *array,
     235    double *other, int mode);
     236  /**
    229237         general utility function for dealing with dynamic constraints
    230238         mode=0  - Create list of non-key basics in pivotVariable_ using
     
    245253
    246254     */
    247      virtual int generalExpanded(ClpSimplex * model, int mode, int & number);
    248      /**
     255  virtual int generalExpanded(ClpSimplex *model, int mode, int &number);
     256  /**
    249257        update information for a pivot (and effective rhs)
    250258     */
    251      virtual int updatePivot(ClpSimplex * model, double oldInValue, double oldOutValue);
    252      /** Creates a variable.  This is called after partial pricing and may modify matrix.
     259  virtual int updatePivot(ClpSimplex *model, double oldInValue, double oldOutValue);
     260  /** Creates a variable.  This is called after partial pricing and may modify matrix.
    253261         May update bestSequence.
    254262     */
    255      virtual void createVariable(ClpSimplex * model, int & bestSequence);
    256      /** Just for debug if odd type matrix.
     263  virtual void createVariable(ClpSimplex *model, int &bestSequence);
     264  /** Just for debug if odd type matrix.
    257265         Returns number of primal infeasibilities. */
    258      virtual int checkFeasible(ClpSimplex * model, double & sum) const ;
    259      /// Returns reduced cost of a variable
    260      double reducedCost(ClpSimplex * model, int sequence) const;
    261      /// Correct sequence in and out to give true value (if both -1 maybe do whole matrix)
    262      virtual void correctSequence(const ClpSimplex * model, int & sequenceIn, int & sequenceOut) ;
    263      //@}
    264 
    265      //---------------------------------------------------------------------------
    266      /**@name Matrix times vector methods
     266  virtual int checkFeasible(ClpSimplex *model, double &sum) const;
     267  /// Returns reduced cost of a variable
     268  double reducedCost(ClpSimplex *model, int sequence) const;
     269  /// Correct sequence in and out to give true value (if both -1 maybe do whole matrix)
     270  virtual void correctSequence(const ClpSimplex *model, int &sequenceIn, int &sequenceOut);
     271  //@}
     272
     273  //---------------------------------------------------------------------------
     274  /**@name Matrix times vector methods
    267275        They can be faster if scalar is +- 1
    268276        Also for simplex I am not using basic/non-basic split */
    269      //@{
    270      /** Return <code>y + A * x * scalar</code> in <code>y</code>.
     277  //@{
     278  /** Return <code>y + A * x * scalar</code> in <code>y</code>.
    271279         @pre <code>x</code> must be of size <code>numColumns()</code>
    272280         @pre <code>y</code> must be of size <code>numRows()</code> */
    273      virtual void times(double scalar,
    274                         const double * COIN_RESTRICT x, double * COIN_RESTRICT y) const = 0;
    275      /** And for scaling - default aborts for when scaling not supported
     281  virtual void times(double scalar,
     282    const double *COIN_RESTRICT x, double *COIN_RESTRICT y) const = 0;
     283  /** And for scaling - default aborts for when scaling not supported
    276284         (unless pointers NULL when as normal)
    277285     */
    278      virtual void times(double scalar,
    279                         const double * COIN_RESTRICT x, double * COIN_RESTRICT y,
    280                         const double * COIN_RESTRICT rowScale,
    281                         const double * COIN_RESTRICT columnScale) const;
    282      /** Return <code>y + x * scalar * A</code> in <code>y</code>.
     286  virtual void times(double scalar,
     287    const double *COIN_RESTRICT x, double *COIN_RESTRICT y,
     288    const double *COIN_RESTRICT rowScale,
     289    const double *COIN_RESTRICT columnScale) const;
     290  /** Return <code>y + x * scalar * A</code> in <code>y</code>.
    283291         @pre <code>x</code> must be of size <code>numRows()</code>
    284292         @pre <code>y</code> must be of size <code>numColumns()</code> */
    285      virtual void transposeTimes(double scalar,
    286                                  const double * COIN_RESTRICT x, double * COIN_RESTRICT y) const = 0;
    287      /** And for scaling - default aborts for when scaling not supported
     293  virtual void transposeTimes(double scalar,
     294    const double *COIN_RESTRICT x, double *COIN_RESTRICT y) const = 0;
     295  /** And for scaling - default aborts for when scaling not supported
    288296         (unless pointers NULL when as normal)
    289297     */
    290      virtual void transposeTimes(double scalar,
    291                                  const double * COIN_RESTRICT x, double * COIN_RESTRICT y,
    292                                  const double * COIN_RESTRICT rowScale,
    293                                  const double * COIN_RESTRICT columnScale,
    294                                  double * COIN_RESTRICT spare = NULL) const;
     298  virtual void transposeTimes(double scalar,
     299    const double *COIN_RESTRICT x, double *COIN_RESTRICT y,
     300    const double *COIN_RESTRICT rowScale,
     301    const double *COIN_RESTRICT columnScale,
     302    double *COIN_RESTRICT spare = NULL) const;
    295303#if COIN_LONG_WORK
    296      // For long double versions (aborts if not supported)
    297      virtual void times(CoinWorkDouble scalar,
    298                         const CoinWorkDouble * COIN_RESTRICT x, CoinWorkDouble * COIN_RESTRICT y) const ;
    299      virtual void transposeTimes(CoinWorkDouble scalar,
    300                                  const CoinWorkDouble * COIN_RESTRICT x, CoinWorkDouble * COIN_RESTRICT y) const ;
     304  // For long double versions (aborts if not supported)
     305  virtual void times(CoinWorkDouble scalar,
     306    const CoinWorkDouble *COIN_RESTRICT x, CoinWorkDouble *COIN_RESTRICT y) const;
     307  virtual void transposeTimes(CoinWorkDouble scalar,
     308    const CoinWorkDouble *COIN_RESTRICT x, CoinWorkDouble *COIN_RESTRICT y) const;
    301309#endif
    302      /** Return <code>x * scalar *A + y</code> in <code>z</code>.
     310  /** Return <code>x * scalar *A + y</code> in <code>z</code>.
    303311         Can use y as temporary array (will be empty at end)
    304312         Note - If x packed mode - then z packed mode
    305313         Squashes small elements and knows about ClpSimplex */
    306      virtual void transposeTimes(const ClpSimplex * model, double scalar,
    307                                  const CoinIndexedVector * x,
    308                                  CoinIndexedVector * y,
    309                                  CoinIndexedVector * z) const = 0;
    310      /** Return <code>x *A</code> in <code>z</code> but
     314  virtual void transposeTimes(const ClpSimplex *model, double scalar,
     315    const CoinIndexedVector *x,
     316    CoinIndexedVector *y,
     317    CoinIndexedVector *z) const = 0;
     318  /** Return <code>x *A</code> in <code>z</code> but
    311319         just for indices in y.
    312320         This is only needed for primal steepest edge.
    313321         Note - z always packed mode */
    314      virtual void subsetTransposeTimes(const ClpSimplex * model,
    315                                        const CoinIndexedVector * x,
    316                                        const CoinIndexedVector * y,
    317                                        CoinIndexedVector * z) const = 0;
    318      /** Returns true if can combine transposeTimes and subsetTransposeTimes
     322  virtual void subsetTransposeTimes(const ClpSimplex *model,
     323    const CoinIndexedVector *x,
     324    const CoinIndexedVector *y,
     325    CoinIndexedVector *z) const = 0;
     326  /** Returns true if can combine transposeTimes and subsetTransposeTimes
    319327         and if it would be faster */
    320      virtual bool canCombine(const ClpSimplex * ,
    321                              const CoinIndexedVector * ) const {
    322           return false;
    323      }
    324      /** Updates two arrays for steepest and does devex weights
     328  virtual bool canCombine(const ClpSimplex *,
     329    const CoinIndexedVector *) const
     330  {
     331    return false;
     332  }
     333  /** Updates two arrays for steepest and does devex weights
    325334         (need not be coded)
    326335         Returns nonzero if updates reduced cost and infeas -
    327336         new infeas in dj1 */
    328      virtual int transposeTimes2(const ClpSimplex * model,
    329                                  const CoinIndexedVector * pi1, CoinIndexedVector * dj1,
    330                                  const CoinIndexedVector * pi2,
    331                                  CoinIndexedVector * spare,
    332                                  double * infeas, double * reducedCost,
    333                                   double referenceIn, double devex,
    334                                   // Array for exact devex to say what is in reference framework
    335                                   unsigned int * reference,
    336                                   double * weights, double scaleFactor);
    337      /// Updates second array for steepest and does devex weights (need not be coded)
    338      virtual void subsetTimes2(const ClpSimplex * model,
    339                                CoinIndexedVector * dj1,
    340                                const CoinIndexedVector * pi2, CoinIndexedVector * dj2,
    341                                double referenceIn, double devex,
    342                                // Array for exact devex to say what is in reference framework
    343                                unsigned int * reference,
    344                                double * weights, double scaleFactor);
    345      /** Return <code>x *A</code> in <code>z</code> but
     337  virtual int transposeTimes2(const ClpSimplex *model,
     338    const CoinIndexedVector *pi1, CoinIndexedVector *dj1,
     339    const CoinIndexedVector *pi2,
     340    CoinIndexedVector *spare,
     341    double *infeas, double *reducedCost,
     342    double referenceIn, double devex,
     343    // Array for exact devex to say what is in reference framework
     344    unsigned int *reference,
     345    double *weights, double scaleFactor);
     346  /// Updates second array for steepest and does devex weights (need not be coded)
     347  virtual void subsetTimes2(const ClpSimplex *model,
     348    CoinIndexedVector *dj1,
     349    const CoinIndexedVector *pi2, CoinIndexedVector *dj2,
     350    double referenceIn, double devex,
     351    // Array for exact devex to say what is in reference framework
     352    unsigned int *reference,
     353    double *weights, double scaleFactor);
     354  /** Return <code>x *A</code> in <code>z</code> but
    346355         just for number indices in y.
    347356         Default cheats with fake CoinIndexedVector and
    348357         then calls subsetTransposeTimes */
    349      virtual void listTransposeTimes(const ClpSimplex * model,
    350                                      double * x,
    351                                      int * y,
    352                                      int number,
    353                                      double * z) const;
    354      //@}
    355      //@{
    356      ///@name Other
    357      /// Clone
    358      virtual ClpMatrixBase * clone() const = 0;
    359      /** Subset clone (without gaps).  Duplicates are allowed
     358  virtual void listTransposeTimes(const ClpSimplex *model,
     359    double *x,
     360    int *y,
     361    int number,
     362    double *z) const;
     363  //@}
     364  //@{
     365  ///@name Other
     366  /// Clone
     367  virtual ClpMatrixBase *clone() const = 0;
     368  /** Subset clone (without gaps).  Duplicates are allowed
    360369         and order is as given.
    361370         Derived classes need not provide this as it may not always make
    362371         sense */
    363      virtual ClpMatrixBase * subsetClone (
    364           int numberRows, const int * whichRows,
    365           int numberColumns, const int * whichColumns) const;
    366      /// Gets rid of any mutable by products
    367      virtual void backToBasics() {}
    368      /** Returns type.
     372  virtual ClpMatrixBase *subsetClone(
     373    int numberRows, const int *whichRows,
     374    int numberColumns, const int *whichColumns) const;
     375  /// Gets rid of any mutable by products
     376  virtual void backToBasics() {}
     377  /** Returns type.
    369378         The types which code may need to know about are:
    370379         1  - ClpPackedMatrix
     
    372381         12 - ClpPlusMinusOneMatrix
    373382     */
    374      inline int type() const {
    375           return type_;
    376      }
    377      /// Sets type
    378      void setType(int newtype) {
    379           type_ = newtype;
    380      }
    381      /// Sets up an effective RHS
    382      void useEffectiveRhs(ClpSimplex * model);
    383      /** Returns effective RHS offset if it is being used.  This is used for long problems
     383  inline int type() const
     384  {
     385    return type_;
     386  }
     387  /// Sets type
     388  void setType(int newtype)
     389  {
     390    type_ = newtype;
     391  }
     392  /// Sets up an effective RHS
     393  void useEffectiveRhs(ClpSimplex *model);
     394  /** Returns effective RHS offset if it is being used.  This is used for long problems
    384395         or big gub or anywhere where going through full columns is
    385396         expensive.  This may re-compute */
    386      virtual double * rhsOffset(ClpSimplex * model, bool forceRefresh = false,
    387                                 bool check = false);
    388      /// If rhsOffset used this is iteration last refreshed
    389      inline int lastRefresh() const {
    390           return lastRefresh_;
    391      }
    392      /// If rhsOffset used this is refresh frequency (0==off)
    393      inline int refreshFrequency() const {
    394           return refreshFrequency_;
    395      }
    396      inline void setRefreshFrequency(int value) {
    397           refreshFrequency_ = value;
    398      }
    399      /// whether to skip dual checks most of time
    400      inline bool skipDualCheck() const {
    401           return skipDualCheck_;
    402      }
    403      inline void setSkipDualCheck(bool yes) {
    404           skipDualCheck_ = yes;
    405      }
    406      /** Partial pricing tuning parameter - minimum number of "objects" to scan.
     397  virtual double *rhsOffset(ClpSimplex *model, bool forceRefresh = false,
     398    bool check = false);
     399  /// If rhsOffset used this is iteration last refreshed
     400  inline int lastRefresh() const
     401  {
     402    return lastRefresh_;
     403  }
     404  /// If rhsOffset used this is refresh frequency (0==off)
     405  inline int refreshFrequency() const
     406  {
     407    return refreshFrequency_;
     408  }
     409  inline void setRefreshFrequency(int value)
     410  {
     411    refreshFrequency_ = value;
     412  }
     413  /// whether to skip dual checks most of time
     414  inline bool skipDualCheck() const
     415  {
     416    return skipDualCheck_;
     417  }
     418  inline void setSkipDualCheck(bool yes)
     419  {
     420    skipDualCheck_ = yes;
     421  }
     422  /** Partial pricing tuning parameter - minimum number of "objects" to scan.
    407423         e.g. number of Gub sets but could be number of variables */
    408      inline int minimumObjectsScan() const {
    409           return minimumObjectsScan_;
    410      }
    411      inline void setMinimumObjectsScan(int value) {
    412           minimumObjectsScan_ = value;
    413      }
    414      /// Partial pricing tuning parameter - minimum number of negative reduced costs to get
    415      inline int minimumGoodReducedCosts() const {
    416           return minimumGoodReducedCosts_;
    417      }
    418      inline void setMinimumGoodReducedCosts(int value) {
    419           minimumGoodReducedCosts_ = value;
    420      }
    421      /// Current start of search space in matrix (as fraction)
    422      inline double startFraction() const {
    423           return startFraction_;
    424      }
    425      inline void setStartFraction(double value) {
    426           startFraction_ = value;
    427      }
    428      /// Current end of search space in matrix (as fraction)
    429      inline double endFraction() const {
    430           return endFraction_;
    431      }
    432      inline void setEndFraction(double value) {
    433           endFraction_ = value;
    434      }
    435      /// Current best reduced cost
    436      inline double savedBestDj() const {
    437           return savedBestDj_;
    438      }
    439      inline void setSavedBestDj(double value) {
    440           savedBestDj_ = value;
    441      }
    442      /// Initial number of negative reduced costs wanted
    443      inline int originalWanted() const {
    444           return originalWanted_;
    445      }
    446      inline void setOriginalWanted(int value) {
    447           originalWanted_ = value;
    448      }
    449      /// Current number of negative reduced costs which we still need
    450      inline int currentWanted() const {
    451           return currentWanted_;
    452      }
    453      inline void setCurrentWanted(int value) {
    454           currentWanted_ = value;
    455      }
    456      /// Current best sequence
    457      inline int savedBestSequence() const {
    458           return savedBestSequence_;
    459      }
    460      inline void setSavedBestSequence(int value) {
    461           savedBestSequence_ = value;
    462      }
    463      //@}
    464 
     424  inline int minimumObjectsScan() const
     425  {
     426    return minimumObjectsScan_;
     427  }
     428  inline void setMinimumObjectsScan(int value)
     429  {
     430    minimumObjectsScan_ = value;
     431  }
     432  /// Partial pricing tuning parameter - minimum number of negative reduced costs to get
     433  inline int minimumGoodReducedCosts() const
     434  {
     435    return minimumGoodReducedCosts_;
     436  }
     437  inline void setMinimumGoodReducedCosts(int value)
     438  {
     439    minimumGoodReducedCosts_ = value;
     440  }
     441  /// Current start of search space in matrix (as fraction)
     442  inline double startFraction() const
     443  {
     444    return startFraction_;
     445  }
     446  inline void setStartFraction(double value)
     447  {
     448    startFraction_ = value;
     449  }
     450  /// Current end of search space in matrix (as fraction)
     451  inline double endFraction() const
     452  {
     453    return endFraction_;
     454  }
     455  inline void setEndFraction(double value)
     456  {
     457    endFraction_ = value;
     458  }
     459  /// Current best reduced cost
     460  inline double savedBestDj() const
     461  {
     462    return savedBestDj_;
     463  }
     464  inline void setSavedBestDj(double value)
     465  {
     466    savedBestDj_ = value;
     467  }
     468  /// Initial number of negative reduced costs wanted
     469  inline int originalWanted() const
     470  {
     471    return originalWanted_;
     472  }
     473  inline void setOriginalWanted(int value)
     474  {
     475    originalWanted_ = value;
     476  }
     477  /// Current number of negative reduced costs which we still need
     478  inline int currentWanted() const
     479  {
     480    return currentWanted_;
     481  }
     482  inline void setCurrentWanted(int value)
     483  {
     484    currentWanted_ = value;
     485  }
     486  /// Current best sequence
     487  inline int savedBestSequence() const
     488  {
     489    return savedBestSequence_;
     490  }
     491  inline void setSavedBestSequence(int value)
     492  {
     493    savedBestSequence_ = value;
     494  }
     495  //@}
    465496
    466497protected:
    467 
    468      /**@name Constructors, destructor<br>
     498  /**@name Constructors, destructor<br>
    469499        <strong>NOTE</strong>: All constructors are protected. There's no need
    470500        to expose them, after all, this is an abstract class. */
    471      //@{
    472      /** Default constructor. */
    473      ClpMatrixBase();
    474      /** Destructor (has to be public) */
     501  //@{
     502  /** Default constructor. */
     503  ClpMatrixBase();
     504  /** Destructor (has to be public) */
    475505public:
    476      virtual ~ClpMatrixBase();
     506  virtual ~ClpMatrixBase();
     507
    477508protected:
    478      // Copy
    479      ClpMatrixBase(const ClpMatrixBase&);
    480      // Assignment
    481      ClpMatrixBase& operator=(const ClpMatrixBase&);
    482      //@}
    483 
     509  // Copy
     510  ClpMatrixBase(const ClpMatrixBase &);
     511  // Assignment
     512  ClpMatrixBase &operator=(const ClpMatrixBase &);
     513  //@}
    484514
    485515protected:
    486      /**@name Data members
     516  /**@name Data members
    487517        The data members are protected to allow access for derived classes. */
    488      //@{
    489      /** Effective RHS offset if it is being used.  This is used for long problems
     518  //@{
     519  /** Effective RHS offset if it is being used.  This is used for long problems
    490520         or big gub or anywhere where going through full columns is
    491521         expensive */
    492      double * rhsOffset_;
    493      /// Current start of search space in matrix (as fraction)
    494      double startFraction_;
    495      /// Current end of search space in matrix (as fraction)
    496      double endFraction_;
    497      /// Best reduced cost so far
    498      double savedBestDj_;
    499      /// Initial number of negative reduced costs wanted
    500      int originalWanted_;
    501      /// Current number of negative reduced costs which we still need
    502      int currentWanted_;
    503      /// Saved best sequence in pricing
    504      int savedBestSequence_;
    505      /// type (may be useful)
    506      int type_;
    507      /// If rhsOffset used this is iteration last refreshed
    508      int lastRefresh_;
    509      /// If rhsOffset used this is refresh frequency (0==off)
    510      int refreshFrequency_;
    511      /// Partial pricing tuning parameter - minimum number of "objects" to scan
    512      int minimumObjectsScan_;
    513      /// Partial pricing tuning parameter - minimum number of negative reduced costs to get
    514      int minimumGoodReducedCosts_;
    515      /// True sequence in (i.e. from larger problem)
    516      int trueSequenceIn_;
    517      /// True sequence out (i.e. from larger problem)
    518      int trueSequenceOut_;
    519      /// whether to skip dual checks most of time
    520      bool skipDualCheck_;
    521      //@}
     522  double *rhsOffset_;
     523  /// Current start of search space in matrix (as fraction)
     524  double startFraction_;
     525  /// Current end of search space in matrix (as fraction)
     526  double endFraction_;
     527  /// Best reduced cost so far
     528  double savedBestDj_;
     529  /// Initial number of negative reduced costs wanted
     530  int originalWanted_;
     531  /// Current number of negative reduced costs which we still need
     532  int currentWanted_;
     533  /// Saved best sequence in pricing
     534  int savedBestSequence_;
     535  /// type (may be useful)
     536  int type_;
     537  /// If rhsOffset used this is iteration last refreshed
     538  int lastRefresh_;
     539  /// If rhsOffset used this is refresh frequency (0==off)
     540  int refreshFrequency_;
     541  /// Partial pricing tuning parameter - minimum number of "objects" to scan
     542  int minimumObjectsScan_;
     543  /// Partial pricing tuning parameter - minimum number of negative reduced costs to get
     544  int minimumGoodReducedCosts_;
     545  /// True sequence in (i.e. from larger problem)
     546  int trueSequenceIn_;
     547  /// True sequence out (i.e. from larger problem)
     548  int trueSequenceOut_;
     549  /// whether to skip dual checks most of time
     550  bool skipDualCheck_;
     551  //@}
    522552};
    523553// bias for free variables
     
    527557
    528558#endif
     559
     560/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
     561*/
Note: See TracChangeset for help on using the changeset viewer.