Ignore:
Timestamp:
Jan 3, 2019 2:03:23 PM (21 months ago)
Author:
unxusr
Message:

.clang-format with proposal for formatting code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/CbcHeuristicGreedy.hpp

    r1585 r2464  
    1313class CbcHeuristicGreedyCover : public CbcHeuristic {
    1414public:
    15 
    16     // Default Constructor
    17     CbcHeuristicGreedyCover ();
    18 
    19     /* Constructor with model - assumed before cuts
     15  // Default Constructor
     16  CbcHeuristicGreedyCover();
     17
     18  /* Constructor with model - assumed before cuts
    2019       Initial version does not do Lps
    2120    */
    22     CbcHeuristicGreedyCover (CbcModel & model);
    23 
    24     // Copy constructor
    25     CbcHeuristicGreedyCover ( const CbcHeuristicGreedyCover &);
    26 
    27     // Destructor
    28     ~CbcHeuristicGreedyCover ();
    29 
    30     /// Clone
    31     virtual CbcHeuristic * clone() const;
    32     /// Assignment operator
    33     CbcHeuristicGreedyCover & operator=(const CbcHeuristicGreedyCover& rhs);
    34     /// Create C++ lines to get to current state
    35     virtual void generateCpp( FILE * fp) ;
    36 
    37     /// update model (This is needed if cliques update matrix etc)
    38     virtual void setModel(CbcModel * model);
    39 
    40     using CbcHeuristic::solution ;
    41     /** returns 0 if no solution, 1 if valid solution.
     21  CbcHeuristicGreedyCover(CbcModel &model);
     22
     23  // Copy constructor
     24  CbcHeuristicGreedyCover(const CbcHeuristicGreedyCover &);
     25
     26  // Destructor
     27  ~CbcHeuristicGreedyCover();
     28
     29  /// Clone
     30  virtual CbcHeuristic *clone() const;
     31  /// Assignment operator
     32  CbcHeuristicGreedyCover &operator=(const CbcHeuristicGreedyCover &rhs);
     33  /// Create C++ lines to get to current state
     34  virtual void generateCpp(FILE *fp);
     35
     36  /// update model (This is needed if cliques update matrix etc)
     37  virtual void setModel(CbcModel *model);
     38
     39  using CbcHeuristic::solution;
     40  /** returns 0 if no solution, 1 if valid solution.
    4241        Sets solution values if good, sets objective value (only if good)
    4342        We leave all variables which are at one at this node of the
     
    4948
    5049    */
    51     virtual int solution(double & objectiveValue,
    52                          double * newSolution);
    53     /// Validate model i.e. sets when_ to 0 if necessary (may be NULL)
    54     virtual void validate() ;
    55     /// Resets stuff if model changes
    56     virtual void resetModel(CbcModel * model);
    57     /* Algorithm
     50  virtual int solution(double &objectiveValue,
     51    double *newSolution);
     52  /// Validate model i.e. sets when_ to 0 if necessary (may be NULL)
     53  virtual void validate();
     54  /// Resets stuff if model changes
     55  virtual void resetModel(CbcModel *model);
     56  /* Algorithm
    5857       0 - use current upper bounds
    5958       1 - use original upper bounds
     
    6160       if 100 added round up all >=0.5
    6261    */
    63     inline int algorithm() const {
    64         return algorithm_;
    65     }
    66     inline void setAlgorithm(int value) {
    67         algorithm_ = value;
    68     }
    69     // Only do this many times
    70     inline int numberTimes() const {
    71         return numberTimes_;
    72     }
    73     inline void setNumberTimes(int value) {
    74         numberTimes_ = value;
    75     }
     62  inline int algorithm() const
     63  {
     64    return algorithm_;
     65  }
     66  inline void setAlgorithm(int value)
     67  {
     68    algorithm_ = value;
     69  }
     70  // Only do this many times
     71  inline int numberTimes() const
     72  {
     73    return numberTimes_;
     74  }
     75  inline void setNumberTimes(int value)
     76  {
     77    numberTimes_ = value;
     78  }
    7679
    7780protected:
    78     /// Guts of constructor from a CbcModel
    79     void gutsOfConstructor(CbcModel * model);
    80     // Data
    81 
    82     // Original matrix by column
    83     CoinPackedMatrix matrix_;
    84     // original number of rows
    85     int originalNumberRows_;
    86     /* Algorithm
    87        0 - use current upper bounds
    88        1 - use original upper bounds
    89        If 10 added perturb ratios more
    90     */
    91     int algorithm_;
    92     /// Do this many times
    93     int numberTimes_;
    94 
     81  /// Guts of constructor from a CbcModel
     82  void gutsOfConstructor(CbcModel *model);
     83  // Data
     84
     85  // Original matrix by column
     86  CoinPackedMatrix matrix_;
     87  // original number of rows
     88  int originalNumberRows_;
     89  /* Algorithm
     90       0 - use current upper bounds
     91       1 - use original upper bounds
     92       If 10 added perturb ratios more
     93    */
     94  int algorithm_;
     95  /// Do this many times
     96  int numberTimes_;
    9597};
    96 
    9798
    9899class CbcHeuristicGreedyEquality : public CbcHeuristic {
    99100public:
    100 
    101     // Default Constructor
    102     CbcHeuristicGreedyEquality ();
    103 
    104     /* Constructor with model - assumed before cuts
     101  // Default Constructor
     102  CbcHeuristicGreedyEquality();
     103
     104  /* Constructor with model - assumed before cuts
    105105       Initial version does not do Lps
    106106    */
    107     CbcHeuristicGreedyEquality (CbcModel & model);
    108 
    109     // Copy constructor
    110     CbcHeuristicGreedyEquality ( const CbcHeuristicGreedyEquality &);
    111 
    112     // Destructor
    113     ~CbcHeuristicGreedyEquality ();
    114 
    115     /// Clone
    116     virtual CbcHeuristic * clone() const;
    117     /// Assignment operator
    118     CbcHeuristicGreedyEquality & operator=(const CbcHeuristicGreedyEquality& rhs);
    119     /// Create C++ lines to get to current state
    120     virtual void generateCpp( FILE * fp) ;
    121 
    122     /// update model (This is needed if cliques update matrix etc)
    123     virtual void setModel(CbcModel * model);
    124 
    125     using CbcHeuristic::solution ;
    126     /** returns 0 if no solution, 1 if valid solution.
     107  CbcHeuristicGreedyEquality(CbcModel &model);
     108
     109  // Copy constructor
     110  CbcHeuristicGreedyEquality(const CbcHeuristicGreedyEquality &);
     111
     112  // Destructor
     113  ~CbcHeuristicGreedyEquality();
     114
     115  /// Clone
     116  virtual CbcHeuristic *clone() const;
     117  /// Assignment operator
     118  CbcHeuristicGreedyEquality &operator=(const CbcHeuristicGreedyEquality &rhs);
     119  /// Create C++ lines to get to current state
     120  virtual void generateCpp(FILE *fp);
     121
     122  /// update model (This is needed if cliques update matrix etc)
     123  virtual void setModel(CbcModel *model);
     124
     125  using CbcHeuristic::solution;
     126  /** returns 0 if no solution, 1 if valid solution.
    127127        Sets solution values if good, sets objective value (only if good)
    128128        We leave all variables which are at one at this node of the
     
    134134
    135135    */
    136     virtual int solution(double & objectiveValue,
    137                          double * newSolution);
    138     /// Validate model i.e. sets when_ to 0 if necessary (may be NULL)
    139     virtual void validate() ;
    140     /// Resets stuff if model changes
    141     virtual void resetModel(CbcModel * model);
    142     /* Algorithm
     136  virtual int solution(double &objectiveValue,
     137    double *newSolution);
     138  /// Validate model i.e. sets when_ to 0 if necessary (may be NULL)
     139  virtual void validate();
     140  /// Resets stuff if model changes
     141  virtual void resetModel(CbcModel *model);
     142  /* Algorithm
    143143       0 - use current upper bounds
    144144       1 - use original upper bounds
     
    146146       if 100 added round up all >=0.5
    147147    */
    148     inline int algorithm() const {
    149         return algorithm_;
    150     }
    151     inline void setAlgorithm(int value) {
    152         algorithm_ = value;
    153     }
    154     // Fraction of rhs to cover before branch and cut
    155     inline void setFraction(double value) {
    156         fraction_ = value;
    157     }
    158     inline double fraction() const {
    159         return fraction_;
    160     }
    161     // Only do this many times
    162     inline int numberTimes() const {
    163         return numberTimes_;
    164     }
    165     inline void setNumberTimes(int value) {
    166         numberTimes_ = value;
    167     }
     148  inline int algorithm() const
     149  {
     150    return algorithm_;
     151  }
     152  inline void setAlgorithm(int value)
     153  {
     154    algorithm_ = value;
     155  }
     156  // Fraction of rhs to cover before branch and cut
     157  inline void setFraction(double value)
     158  {
     159    fraction_ = value;
     160  }
     161  inline double fraction() const
     162  {
     163    return fraction_;
     164  }
     165  // Only do this many times
     166  inline int numberTimes() const
     167  {
     168    return numberTimes_;
     169  }
     170  inline void setNumberTimes(int value)
     171  {
     172    numberTimes_ = value;
     173  }
     174
    168175protected:
    169     /// Guts of constructor from a CbcModel
    170     void gutsOfConstructor(CbcModel * model);
    171     // Data
    172 
    173     // Original matrix by column
    174     CoinPackedMatrix matrix_;
    175     // Fraction of rhs to cover before branch and cut
    176     double fraction_;
    177     // original number of rows
    178     int originalNumberRows_;
    179     /* Algorithm
    180        0 - use current upper bounds
    181        1 - use original upper bounds
    182        If 10 added perturb ratios more
    183     */
    184     int algorithm_;
    185     /// Do this many times
    186     int numberTimes_;
    187 
     176  /// Guts of constructor from a CbcModel
     177  void gutsOfConstructor(CbcModel *model);
     178  // Data
     179
     180  // Original matrix by column
     181  CoinPackedMatrix matrix_;
     182  // Fraction of rhs to cover before branch and cut
     183  double fraction_;
     184  // original number of rows
     185  int originalNumberRows_;
     186  /* Algorithm
     187       0 - use current upper bounds
     188       1 - use original upper bounds
     189       If 10 added perturb ratios more
     190    */
     191  int algorithm_;
     192  /// Do this many times
     193  int numberTimes_;
    188194};
    189195
     
    193199class CbcHeuristicGreedySOS : public CbcHeuristic {
    194200public:
    195 
    196     // Default Constructor
    197     CbcHeuristicGreedySOS ();
    198 
    199     /* Constructor with model - assumed before cuts
     201  // Default Constructor
     202  CbcHeuristicGreedySOS();
     203
     204  /* Constructor with model - assumed before cuts
    200205       Initial version does not do Lps
    201206    */
    202     CbcHeuristicGreedySOS (CbcModel & model);
    203 
    204     // Copy constructor
    205     CbcHeuristicGreedySOS ( const CbcHeuristicGreedySOS &);
    206 
    207     // Destructor
    208     ~CbcHeuristicGreedySOS ();
    209 
    210     /// Clone
    211     virtual CbcHeuristic * clone() const;
    212     /// Assignment operator
    213     CbcHeuristicGreedySOS & operator=(const CbcHeuristicGreedySOS& rhs);
    214     /// Create C++ lines to get to current state
    215     virtual void generateCpp( FILE * fp) ;
    216 
    217     /// update model (This is needed if cliques update matrix etc)
    218     virtual void setModel(CbcModel * model);
    219 
    220     using CbcHeuristic::solution ;
    221     /** returns 0 if no solution, 1 if valid solution.
     207  CbcHeuristicGreedySOS(CbcModel &model);
     208
     209  // Copy constructor
     210  CbcHeuristicGreedySOS(const CbcHeuristicGreedySOS &);
     211
     212  // Destructor
     213  ~CbcHeuristicGreedySOS();
     214
     215  /// Clone
     216  virtual CbcHeuristic *clone() const;
     217  /// Assignment operator
     218  CbcHeuristicGreedySOS &operator=(const CbcHeuristicGreedySOS &rhs);
     219  /// Create C++ lines to get to current state
     220  virtual void generateCpp(FILE *fp);
     221
     222  /// update model (This is needed if cliques update matrix etc)
     223  virtual void setModel(CbcModel *model);
     224
     225  using CbcHeuristic::solution;
     226  /** returns 0 if no solution, 1 if valid solution.
    222227        Sets solution values if good, sets objective value (only if good)
    223228        We leave all variables which are at one at this node of the
     
    229234
    230235    */
    231     virtual int solution(double & objectiveValue,
    232                          double * newSolution);
    233     /// Validate model i.e. sets when_ to 0 if necessary (may be NULL)
    234     virtual void validate() ;
    235     /// Resets stuff if model changes
    236     virtual void resetModel(CbcModel * model);
    237     /* Algorithm
     236  virtual int solution(double &objectiveValue,
     237    double *newSolution);
     238  /// Validate model i.e. sets when_ to 0 if necessary (may be NULL)
     239  virtual void validate();
     240  /// Resets stuff if model changes
     241  virtual void resetModel(CbcModel *model);
     242  /* Algorithm
    238243       Bits
    239244       1 bit - use current model, otherwise original
     
    243248       16 - use duals on GUB/SOS in special way
    244249    */
    245     inline int algorithm() const {
    246         return algorithm_;
    247     }
    248     inline void setAlgorithm(int value) {
    249         algorithm_ = value;
    250     }
    251     // Only do this many times
    252     inline int numberTimes() const {
    253         return numberTimes_;
    254     }
    255     inline void setNumberTimes(int value) {
    256         numberTimes_ = value;
    257     }
     250  inline int algorithm() const
     251  {
     252    return algorithm_;
     253  }
     254  inline void setAlgorithm(int value)
     255  {
     256    algorithm_ = value;
     257  }
     258  // Only do this many times
     259  inline int numberTimes() const
     260  {
     261    return numberTimes_;
     262  }
     263  inline void setNumberTimes(int value)
     264  {
     265    numberTimes_ = value;
     266  }
    258267
    259268protected:
    260     /// Guts of constructor from a CbcModel
    261     void gutsOfConstructor(CbcModel * model);
    262     // Data
    263 
    264     // Original RHS - if -1.0 then SOS otherwise <= value
    265     double * originalRhs_;
    266     // Original matrix by column
    267     CoinPackedMatrix matrix_;
    268     // original number of rows
    269     int originalNumberRows_;
    270     /* Algorithm
    271     */
    272     int algorithm_;
    273     /// Do this many times
    274     int numberTimes_;
    275 
     269  /// Guts of constructor from a CbcModel
     270  void gutsOfConstructor(CbcModel *model);
     271  // Data
     272
     273  // Original RHS - if -1.0 then SOS otherwise <= value
     274  double *originalRhs_;
     275  // Original matrix by column
     276  CoinPackedMatrix matrix_;
     277  // original number of rows
     278  int originalNumberRows_;
     279  /* Algorithm
     280    */
     281  int algorithm_;
     282  /// Do this many times
     283  int numberTimes_;
    276284};
    277285
    278 
    279286#endif
    280 
Note: See TracChangeset for help on using the changeset viewer.