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

    r1665 r2385  
    1919
    2020public:
     21  ///@name Stuff
     22  //@{
    2123
    22      ///@name Stuff
    23      //@{
    24 
    25      /** Returns gradient.  If Quadratic then solution may be NULL,
     24  /** Returns gradient.  If Quadratic then solution may be NULL,
    2625         also returns an offset (to be added to current one)
    2726         If refresh is false then uses last solution
     
    2928         includeLinear 0 - no, 1 as is, 2 as feasible
    3029     */
    31      virtual double * gradient(const ClpSimplex * model,
    32                                const double * solution, double & offset, bool refresh,
    33                                int includeLinear = 2);
    34      /// Resize objective
    35      /** Returns reduced gradient.Returns an offset (to be added to current one).
     30  virtual double *gradient(const ClpSimplex *model,
     31    const double *solution, double &offset, bool refresh,
     32    int includeLinear = 2);
     33  /// Resize objective
     34  /** Returns reduced gradient.Returns an offset (to be added to current one).
    3635     */
    37      virtual double reducedGradient(ClpSimplex * model, double * region,
    38                                     bool useFeasibleCosts);
    39      /** Returns step length which gives minimum of objective for
     36  virtual double reducedGradient(ClpSimplex *model, double *region,
     37    bool useFeasibleCosts);
     38  /** Returns step length which gives minimum of objective for
    4039         solution + theta * change vector up to maximum theta.
    4140
     
    4342         Also sets current objective, predicted and at maximumTheta
    4443     */
    45      virtual double stepLength(ClpSimplex * model,
    46                                const double * solution,
    47                                const double * change,
    48                                double maximumTheta,
    49                                double & currentObj,
    50                                double & predictedObj,
    51                                double & thetaObj);
    52      /// Return objective value (without any ClpModel offset) (model may be NULL)
    53      virtual double objectiveValue(const ClpSimplex * model, const double * solution) const ;
    54      virtual void resize(int newNumberColumns) ;
    55      /// Delete columns in  objective
    56      virtual void deleteSome(int numberToDelete, const int * which) ;
    57      /// Scale objective
    58      virtual void reallyScale(const double * columnScale) ;
    59      /** Given a zeroed array sets nonlinear columns to 1.
     44  virtual double stepLength(ClpSimplex *model,
     45    const double *solution,
     46    const double *change,
     47    double maximumTheta,
     48    double &currentObj,
     49    double &predictedObj,
     50    double &thetaObj);
     51  /// Return objective value (without any ClpModel offset) (model may be NULL)
     52  virtual double objectiveValue(const ClpSimplex *model, const double *solution) const;
     53  virtual void resize(int newNumberColumns);
     54  /// Delete columns in  objective
     55  virtual void deleteSome(int numberToDelete, const int *which);
     56  /// Scale objective
     57  virtual void reallyScale(const double *columnScale);
     58  /** Given a zeroed array sets nonlinear columns to 1.
    6059         Returns number of nonlinear columns
    6160      */
    62      virtual int markNonlinear(char * which);
     61  virtual int markNonlinear(char *which);
    6362
    64      //@}
     63  //@}
    6564
     65  ///@name Constructors and destructors
     66  //@{
     67  /// Default Constructor
     68  ClpQuadraticObjective();
    6669
    67      ///@name Constructors and destructors
    68      //@{
    69      /// Default Constructor
    70      ClpQuadraticObjective();
     70  /// Constructor from objective
     71  ClpQuadraticObjective(const double *linearObjective, int numberColumns,
     72    const CoinBigIndex *start,
     73    const int *column, const double *element,
     74    int numberExtendedColumns_ = -1);
    7175
    72      /// Constructor from objective
    73      ClpQuadraticObjective(const double * linearObjective, int numberColumns,
    74                            const CoinBigIndex * start,
    75                            const int * column, const double * element,
    76                            int numberExtendedColumns_ = -1);
    77 
    78      /** Copy constructor .
     76  /** Copy constructor .
    7977         If type is -1 then make sure half symmetric,
    8078         if +1 then make sure full
    8179     */
    82      ClpQuadraticObjective(const ClpQuadraticObjective & rhs, int type = 0);
    83      /** Subset constructor.  Duplicates are allowed
     80  ClpQuadraticObjective(const ClpQuadraticObjective &rhs, int type = 0);
     81  /** Subset constructor.  Duplicates are allowed
    8482         and order is as given.
    8583     */
    86      ClpQuadraticObjective (const ClpQuadraticObjective &rhs, int numberColumns,
    87                             const int * whichColumns) ;
     84  ClpQuadraticObjective(const ClpQuadraticObjective &rhs, int numberColumns,
     85    const int *whichColumns);
    8886
    89      /// Assignment operator
    90      ClpQuadraticObjective & operator=(const ClpQuadraticObjective& rhs);
     87  /// Assignment operator
     88  ClpQuadraticObjective &operator=(const ClpQuadraticObjective &rhs);
    9189
    92      /// Destructor
    93      virtual ~ClpQuadraticObjective ();
     90  /// Destructor
     91  virtual ~ClpQuadraticObjective();
    9492
    95      /// Clone
    96      virtual ClpObjective * clone() const;
    97      /** Subset clone.  Duplicates are allowed
     93  /// Clone
     94  virtual ClpObjective *clone() const;
     95  /** Subset clone.  Duplicates are allowed
    9896         and order is as given.
    9997     */
    100      virtual ClpObjective * subsetClone (int numberColumns,
    101                                          const int * whichColumns) const;
     98  virtual ClpObjective *subsetClone(int numberColumns,
     99    const int *whichColumns) const;
    102100
    103      /** Load up quadratic objective.  This is stored as a CoinPackedMatrix */
    104      void loadQuadraticObjective(const int numberColumns,
    105                                  const CoinBigIndex * start,
    106                                  const int * column, const double * element,
    107                                  int numberExtendedColumns = -1);
    108      void loadQuadraticObjective (  const CoinPackedMatrix& matrix);
    109      /// Get rid of quadratic objective
    110      void deleteQuadraticObjective();
    111      //@}
    112      ///@name Gets and sets
    113      //@{
    114      /// Quadratic objective
    115      inline CoinPackedMatrix * quadraticObjective() const     {
    116           return quadraticObjective_;
    117      }
    118      /// Linear objective
    119      inline double * linearObjective() const     {
    120           return objective_;
    121      }
    122      /// Length of linear objective which could be bigger
    123      inline int numberExtendedColumns() const {
    124           return numberExtendedColumns_;
    125      }
    126      /// Number of columns in quadratic objective
    127      inline int numberColumns() const {
    128           return numberColumns_;
    129      }
    130      /// If a full or half matrix
    131      inline bool fullMatrix() const {
    132           return fullMatrix_;
    133      }
    134      //@}
     101  /** Load up quadratic objective.  This is stored as a CoinPackedMatrix */
     102  void loadQuadraticObjective(const int numberColumns,
     103    const CoinBigIndex *start,
     104    const int *column, const double *element,
     105    int numberExtendedColumns = -1);
     106  void loadQuadraticObjective(const CoinPackedMatrix &matrix);
     107  /// Get rid of quadratic objective
     108  void deleteQuadraticObjective();
     109  //@}
     110  ///@name Gets and sets
     111  //@{
     112  /// Quadratic objective
     113  inline CoinPackedMatrix *quadraticObjective() const
     114  {
     115    return quadraticObjective_;
     116  }
     117  /// Linear objective
     118  inline double *linearObjective() const
     119  {
     120    return objective_;
     121  }
     122  /// Length of linear objective which could be bigger
     123  inline int numberExtendedColumns() const
     124  {
     125    return numberExtendedColumns_;
     126  }
     127  /// Number of columns in quadratic objective
     128  inline int numberColumns() const
     129  {
     130    return numberColumns_;
     131  }
     132  /// If a full or half matrix
     133  inline bool fullMatrix() const
     134  {
     135    return fullMatrix_;
     136  }
     137  //@}
    135138
    136      //---------------------------------------------------------------------------
     139  //---------------------------------------------------------------------------
    137140
    138141private:
    139      ///@name Private member data
    140      /// Quadratic objective
    141      CoinPackedMatrix * quadraticObjective_;
    142      /// Objective
    143      double * objective_;
    144      /// Gradient
    145      double * gradient_;
    146      /// Useful to have number of columns about
    147      int numberColumns_;
    148      /// Also length of linear objective which could be bigger
    149      int numberExtendedColumns_;
    150      /// True if full symmetric matrix, false if half
    151      bool fullMatrix_;
    152      //@}
     142  ///@name Private member data
     143  /// Quadratic objective
     144  CoinPackedMatrix *quadraticObjective_;
     145  /// Objective
     146  double *objective_;
     147  /// Gradient
     148  double *gradient_;
     149  /// Useful to have number of columns about
     150  int numberColumns_;
     151  /// Also length of linear objective which could be bigger
     152  int numberExtendedColumns_;
     153  /// True if full symmetric matrix, false if half
     154  bool fullMatrix_;
     155  //@}
    153156};
    154157
    155158#endif
     159
     160/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
     161*/
Note: See TracChangeset for help on using the changeset viewer.