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

formatting

File:
1 edited

Legend:

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

    r2271 r2385  
    66#ifndef ClpDynamicExampleMatrix_H
    77#define ClpDynamicExampleMatrix_H
    8 
    98
    109#include "CoinPragma.hpp"
     
    3433
    3534public:
    36      /**@name Main functions provided */
    37      //@{
    38      /// Partial pricing
    39      virtual void partialPricing(ClpSimplex * model, double start, double end,
    40                                  int & bestSequence, int & numberWanted);
     35  /**@name Main functions provided */
     36  //@{
     37  /// Partial pricing
     38  virtual void partialPricing(ClpSimplex *model, double start, double end,
     39    int &bestSequence, int &numberWanted);
    4140
    42      /** Creates a variable.  This is called after partial pricing and will modify matrix.
     41  /** Creates a variable.  This is called after partial pricing and will modify matrix.
    4342         Will update bestSequence.
    4443     */
    45      virtual void createVariable(ClpSimplex * model, int & bestSequence);
    46      /** If addColumn forces compression then this allows descendant to know what to do.
     44  virtual void createVariable(ClpSimplex *model, int &bestSequence);
     45  /** If addColumn forces compression then this allows descendant to know what to do.
    4746         If >= then entry stayed in, if -1 then entry went out to lower bound.of zero.
    4847         Entries at upper bound (really nonzero) never go out (at present).
    4948     */
    50      virtual void packDown(const int * in, int numberToPack);
    51      //@}
     49  virtual void packDown(const int *in, int numberToPack);
     50  //@}
    5251
    53 
    54 
    55      /**@name Constructors, destructor */
    56      //@{
    57      /** Default constructor. */
    58      ClpDynamicExampleMatrix();
    59      /** This is the real constructor.
     52  /**@name Constructors, destructor */
     53  //@{
     54  /** Default constructor. */
     55  ClpDynamicExampleMatrix();
     56  /** This is the real constructor.
    6057         It assumes factorization frequency will not be changed.
    6158         This resizes model !!!!
     
    6360         will be sanitized so can be deleted (to avoid a very small memory leak)
    6461      */
    65      ClpDynamicExampleMatrix(ClpSimplex * model, int numberSets,
    66                              int numberColumns, const CoinBigIndex * starts,
    67                              const double * lower, const double * upper,
    68                              const CoinBigIndex * startColumn, const int * row,
    69                              const double * element, const double * cost,
    70                              const double * columnLower = NULL, const double * columnUpper = NULL,
    71                              const unsigned char * status = NULL,
    72                              const unsigned char * dynamicStatus = NULL,
    73                              int numberIds = 0, const int *ids = NULL);
     62  ClpDynamicExampleMatrix(ClpSimplex *model, int numberSets,
     63    int numberColumns, const CoinBigIndex *starts,
     64    const double *lower, const double *upper,
     65    const CoinBigIndex *startColumn, const int *row,
     66    const double *element, const double *cost,
     67    const double *columnLower = NULL, const double *columnUpper = NULL,
     68    const unsigned char *status = NULL,
     69    const unsigned char *dynamicStatus = NULL,
     70    int numberIds = 0, const int *ids = NULL);
    7471#if 0
    7572     /// This constructor just takes over ownership (except for lower, upper)
     
    8481                             int numberIds = 0, const int *ids = NULL);
    8582#endif
    86      /** Destructor */
    87      virtual ~ClpDynamicExampleMatrix();
    88      //@}
     83  /** Destructor */
     84  virtual ~ClpDynamicExampleMatrix();
     85  //@}
    8986
    90      /**@name Copy method */
    91      //@{
    92      /** The copy constructor. */
    93      ClpDynamicExampleMatrix(const ClpDynamicExampleMatrix&);
    94      ClpDynamicExampleMatrix& operator=(const ClpDynamicExampleMatrix&);
    95      /// Clone
    96      virtual ClpMatrixBase * clone() const ;
    97      //@}
    98      /**@name gets and sets */
    99      //@{
    100      /// Starts of each column
    101      inline CoinBigIndex * startColumnGen() const {
    102           return startColumnGen_;
    103      }
    104      /// rows
    105      inline int * rowGen() const {
    106           return rowGen_;
    107      }
    108      /// elements
    109      inline double * elementGen() const {
    110           return elementGen_;
    111      }
    112      /// costs
    113      inline double * costGen() const {
    114           return costGen_;
    115      }
    116      /// full starts
    117      inline CoinBigIndex * fullStartGen() const {
    118           return fullStartGen_;
    119      }
    120      /// ids in next level matrix
    121      inline int * idGen() const {
    122           return idGen_;
    123      }
    124      /// Optional lower bounds on columns
    125      inline double * columnLowerGen() const {
    126           return columnLowerGen_;
    127      }
    128      /// Optional upper bounds on columns
    129      inline double * columnUpperGen() const {
    130           return columnUpperGen_;
    131      }
    132      /// size
    133      inline int numberColumns() const {
    134           return numberColumns_;
    135      }
    136      inline void setDynamicStatusGen(int sequence, DynamicStatus status) {
    137           unsigned char & st_byte = dynamicStatusGen_[sequence];
    138           st_byte = static_cast<unsigned char>(st_byte & ~7);
    139           st_byte = static_cast<unsigned char>(st_byte | status);
    140      }
    141      inline DynamicStatus getDynamicStatusGen(int sequence) const {
    142           return static_cast<DynamicStatus> (dynamicStatusGen_[sequence] & 7);
    143      }
    144      /// Whether flagged
    145      inline bool flaggedGen(int i) const {
    146           return (dynamicStatusGen_[i] & 8) != 0;
    147      }
    148      inline void setFlaggedGen(int i) {
    149           dynamicStatusGen_[i] = static_cast<unsigned char>(dynamicStatusGen_[i] | 8);
    150      }
    151      inline void unsetFlagged(int i) {
    152           dynamicStatusGen_[i] = static_cast<unsigned char>(dynamicStatusGen_[i] & ~8);
    153      }
    154      //@}
    155 
     87  /**@name Copy method */
     88  //@{
     89  /** The copy constructor. */
     90  ClpDynamicExampleMatrix(const ClpDynamicExampleMatrix &);
     91  ClpDynamicExampleMatrix &operator=(const ClpDynamicExampleMatrix &);
     92  /// Clone
     93  virtual ClpMatrixBase *clone() const;
     94  //@}
     95  /**@name gets and sets */
     96  //@{
     97  /// Starts of each column
     98  inline CoinBigIndex *startColumnGen() const
     99  {
     100    return startColumnGen_;
     101  }
     102  /// rows
     103  inline int *rowGen() const
     104  {
     105    return rowGen_;
     106  }
     107  /// elements
     108  inline double *elementGen() const
     109  {
     110    return elementGen_;
     111  }
     112  /// costs
     113  inline double *costGen() const
     114  {
     115    return costGen_;
     116  }
     117  /// full starts
     118  inline CoinBigIndex *fullStartGen() const
     119  {
     120    return fullStartGen_;
     121  }
     122  /// ids in next level matrix
     123  inline int *idGen() const
     124  {
     125    return idGen_;
     126  }
     127  /// Optional lower bounds on columns
     128  inline double *columnLowerGen() const
     129  {
     130    return columnLowerGen_;
     131  }
     132  /// Optional upper bounds on columns
     133  inline double *columnUpperGen() const
     134  {
     135    return columnUpperGen_;
     136  }
     137  /// size
     138  inline int numberColumns() const
     139  {
     140    return numberColumns_;
     141  }
     142  inline void setDynamicStatusGen(int sequence, DynamicStatus status)
     143  {
     144    unsigned char &st_byte = dynamicStatusGen_[sequence];
     145    st_byte = static_cast< unsigned char >(st_byte & ~7);
     146    st_byte = static_cast< unsigned char >(st_byte | status);
     147  }
     148  inline DynamicStatus getDynamicStatusGen(int sequence) const
     149  {
     150    return static_cast< DynamicStatus >(dynamicStatusGen_[sequence] & 7);
     151  }
     152  /// Whether flagged
     153  inline bool flaggedGen(int i) const
     154  {
     155    return (dynamicStatusGen_[i] & 8) != 0;
     156  }
     157  inline void setFlaggedGen(int i)
     158  {
     159    dynamicStatusGen_[i] = static_cast< unsigned char >(dynamicStatusGen_[i] | 8);
     160  }
     161  inline void unsetFlagged(int i)
     162  {
     163    dynamicStatusGen_[i] = static_cast< unsigned char >(dynamicStatusGen_[i] & ~8);
     164  }
     165  //@}
    156166
    157167protected:
    158      /**@name Data members
     168  /**@name Data members
    159169        The data members are protected to allow access for derived classes. */
    160      //@{
    161      /// size
    162      int numberColumns_;
    163      /// Starts of each column
    164      CoinBigIndex * startColumnGen_;
    165      /// rows
    166      int * rowGen_;
    167      /// elements
    168      double * elementGen_;
    169      /// costs
    170      double * costGen_;
    171      /// start of each set
    172      CoinBigIndex * fullStartGen_;
    173      /// for status and which bound
    174      unsigned char * dynamicStatusGen_;
    175      /** identifier for each variable up one level (startColumn_, etc).  This is
     170  //@{
     171  /// size
     172  int numberColumns_;
     173  /// Starts of each column
     174  CoinBigIndex *startColumnGen_;
     175  /// rows
     176  int *rowGen_;
     177  /// elements
     178  double *elementGen_;
     179  /// costs
     180  double *costGen_;
     181  /// start of each set
     182  CoinBigIndex *fullStartGen_;
     183  /// for status and which bound
     184  unsigned char *dynamicStatusGen_;
     185  /** identifier for each variable up one level (startColumn_, etc).  This is
    176186         of length maximumGubColumns_.  For this version it is just sequence number
    177187         at this level */
    178      int * idGen_;
    179      /// Optional lower bounds on columns
    180      double * columnLowerGen_;
    181      /// Optional upper bounds on columns
    182      double * columnUpperGen_;
    183      //@}
     188  int *idGen_;
     189  /// Optional lower bounds on columns
     190  double *columnLowerGen_;
     191  /// Optional upper bounds on columns
     192  double *columnUpperGen_;
     193  //@}
    184194};
    185195
    186196#endif
     197
     198/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
     199*/
Note: See TracChangeset for help on using the changeset viewer.