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/ClpObjective.hpp

    r1825 r2385  
    66#ifndef ClpObjective_H
    77#define ClpObjective_H
    8 
    98
    109//#############################################################################
     
    1716
    1817*/
    19 class ClpObjective  {
     18class ClpObjective {
    2019
    2120public:
     21  ///@name Stuff
     22  //@{
    2223
    23      ///@name Stuff
    24      //@{
    25 
    26      /** Returns gradient.  If Linear then solution may be NULL,
     24  /** Returns gradient.  If Linear then solution may be NULL,
    2725         also returns an offset (to be added to current one)
    2826         If refresh is false then uses last solution
     
    3028         includeLinear 0 - no, 1 as is, 2 as feasible
    3129     */
    32      virtual double * gradient(const ClpSimplex * model,
    33                                const double * solution,
    34                                double & offset, bool refresh,
    35                                int includeLinear = 2) = 0;
    36      /** Returns reduced gradient.Returns an offset (to be added to current one).
     30  virtual double *gradient(const ClpSimplex *model,
     31    const double *solution,
     32    double &offset, bool refresh,
     33    int includeLinear = 2)
     34    = 0;
     35  /** Returns reduced gradient.Returns an offset (to be added to current one).
    3736     */
    38      virtual double reducedGradient(ClpSimplex * model, double * region,
    39                                     bool useFeasibleCosts) = 0;
    40      /** Returns step length which gives minimum of objective for
     37  virtual double reducedGradient(ClpSimplex *model, double *region,
     38    bool useFeasibleCosts)
     39    = 0;
     40  /** Returns step length which gives minimum of objective for
    4141         solution + theta * change vector up to maximum theta.
    4242
     
    4444         Also sets current objective, predicted  and at maximumTheta
    4545     */
    46      virtual double stepLength(ClpSimplex * model,
    47                                const double * solution,
    48                                const double * change,
    49                                double maximumTheta,
    50                                double & currentObj,
    51                                double & predictedObj,
    52                                double & thetaObj) = 0;
    53      /// Return objective value (without any ClpModel offset) (model may be NULL)
    54      virtual double objectiveValue(const ClpSimplex * model, const double * solution) const = 0;
    55      /// Resize objective
    56      virtual void resize(int newNumberColumns) = 0;
    57      /// Delete columns in  objective
    58      virtual void deleteSome(int numberToDelete, const int * which) = 0;
    59      /// Scale objective
    60      virtual void reallyScale(const double * columnScale) = 0;
    61      /** Given a zeroed array sets nonlinear columns to 1.
     46  virtual double stepLength(ClpSimplex *model,
     47    const double *solution,
     48    const double *change,
     49    double maximumTheta,
     50    double &currentObj,
     51    double &predictedObj,
     52    double &thetaObj)
     53    = 0;
     54  /// Return objective value (without any ClpModel offset) (model may be NULL)
     55  virtual double objectiveValue(const ClpSimplex *model, const double *solution) const = 0;
     56  /// Resize objective
     57  virtual void resize(int newNumberColumns) = 0;
     58  /// Delete columns in  objective
     59  virtual void deleteSome(int numberToDelete, const int *which) = 0;
     60  /// Scale objective
     61  virtual void reallyScale(const double *columnScale) = 0;
     62  /** Given a zeroed array sets nonlinear columns to 1.
    6263         Returns number of nonlinear columns
    6364      */
    64      virtual int markNonlinear(char * which);
    65      /// Say we have new primal solution - so may need to recompute
    66      virtual void newXValues() {}
    67      //@}
     65  virtual int markNonlinear(char *which);
     66  /// Say we have new primal solution - so may need to recompute
     67  virtual void newXValues() {}
     68  //@}
    6869
     70  ///@name Constructors and destructors
     71  //@{
     72  /// Default Constructor
     73  ClpObjective();
    6974
    70      ///@name Constructors and destructors
    71      //@{
    72      /// Default Constructor
    73      ClpObjective();
     75  /// Copy constructor
     76  ClpObjective(const ClpObjective &);
    7477
    75      /// Copy constructor
    76      ClpObjective(const ClpObjective &);
     78  /// Assignment operator
     79  ClpObjective &operator=(const ClpObjective &rhs);
    7780
    78      /// Assignment operator
    79      ClpObjective & operator=(const ClpObjective& rhs);
     81  /// Destructor
     82  virtual ~ClpObjective();
    8083
    81      /// Destructor
    82      virtual ~ClpObjective ();
    83 
    84      /// Clone
    85      virtual ClpObjective * clone() const = 0;
    86      /** Subset clone.  Duplicates are allowed
     84  /// Clone
     85  virtual ClpObjective *clone() const = 0;
     86  /** Subset clone.  Duplicates are allowed
    8787         and order is as given.
    8888         Derived classes need not provide this as it may not always make
    8989         sense */
    90      virtual ClpObjective * subsetClone (int numberColumns,
    91                                          const int * whichColumns) const;
     90  virtual ClpObjective *subsetClone(int numberColumns,
     91    const int *whichColumns) const;
    9292
    93      //@}
     93  //@}
    9494
    95      ///@name Other
    96      //@{
    97      /// Returns type (above 63 is extra information)
    98      inline int type() const {
    99           return type_;
    100      }
    101      /// Sets type (above 63 is extra information)
    102      inline void setType(int value) {
    103           type_ = value;
    104      }
    105      /// Whether activated
    106      inline int activated() const {
    107           return activated_;
    108      }
    109      /// Set whether activated
    110      inline void setActivated(int value) {
    111           activated_ = value;
    112      }
     95  ///@name Other
     96  //@{
     97  /// Returns type (above 63 is extra information)
     98  inline int type() const
     99  {
     100    return type_;
     101  }
     102  /// Sets type (above 63 is extra information)
     103  inline void setType(int value)
     104  {
     105    type_ = value;
     106  }
     107  /// Whether activated
     108  inline int activated() const
     109  {
     110    return activated_;
     111  }
     112  /// Set whether activated
     113  inline void setActivated(int value)
     114  {
     115    activated_ = value;
     116  }
    113117
    114      /// Objective offset
    115      inline double nonlinearOffset () const {
    116           return offset_;
    117      }
    118      //@}
     118  /// Objective offset
     119  inline double nonlinearOffset() const
     120  {
     121    return offset_;
     122  }
     123  //@}
    119124
    120      //---------------------------------------------------------------------------
     125  //---------------------------------------------------------------------------
    121126
    122127protected:
    123      ///@name Protected member data
    124      //@{
    125      /// Value of non-linear part of objective
    126      double offset_;
    127      /// Type of objective - linear is 1
    128      int type_;
    129      /// Whether activated
    130      int activated_;
    131      //@}
     128  ///@name Protected member data
     129  //@{
     130  /// Value of non-linear part of objective
     131  double offset_;
     132  /// Type of objective - linear is 1
     133  int type_;
     134  /// Whether activated
     135  int activated_;
     136  //@}
    132137};
    133138
    134139#endif
     140
     141/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
     142*/
Note: See TracChangeset for help on using the changeset viewer.