source: trunk/Cbc/src/ClpAmplObjective.hpp

Last change on this file was 2465, checked in by unxusr, 5 months ago

script to format sources

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.0 KB
Line 
1/* $Id: ClpAmplObjective.hpp 2465 2019-01-03 19:26:52Z forrest $ */
2// Copyright (C) 2007, International Business Machines
3// Corporation and others.  All Rights Reserved.
4// This code is licensed under the terms of the Eclipse Public License (EPL).
5
6#ifndef ClpAmplObjective_H
7#define ClpAmplObjective_H
8
9#include "ClpObjective.hpp"
10#include "CoinPackedMatrix.hpp"
11
12//#############################################################################
13
14/** Ampl Objective Class
15
16*/
17
18class ClpAmplObjective : public ClpObjective {
19
20public:
21  ///@name Stuff
22  //@{
23
24  /** Returns gradient.  If Ampl then solution may be NULL,
25        also returns an offset (to be added to current one)
26        If refresh is false then uses last solution
27        Uses model for scaling
28        includeLinear 0 - no, 1 as is, 2 as feasible
29    */
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).
35    */
36  virtual double reducedGradient(ClpSimplex *model, double *region,
37    bool useFeasibleCosts);
38  /** Returns step length which gives minimum of objective for
39        solution + theta * change vector up to maximum theta.
40
41        arrays are numberColumns+numberRows
42        Also sets current objective, predicted and at maximumTheta
43    */
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.
59        Returns number of nonlinear columns
60     */
61  virtual int markNonlinear(char *which);
62
63  /// Say we have new primal solution - so may need to recompute
64  virtual void newXValues();
65  //@}
66
67  ///@name Constructors and destructors
68  //@{
69  /// Default Constructor
70  ClpAmplObjective();
71
72  /// Constructor from ampl info
73  ClpAmplObjective(void *amplInfo);
74
75  /** Copy constructor .
76    */
77  ClpAmplObjective(const ClpAmplObjective &rhs);
78
79  /// Assignment operator
80  ClpAmplObjective &operator=(const ClpAmplObjective &rhs);
81
82  /// Destructor
83  virtual ~ClpAmplObjective();
84
85  /// Clone
86  virtual ClpObjective *clone() const;
87
88  //@}
89  ///@name Gets and sets
90  //@{
91  /// Linear objective
92  double *linearObjective() const;
93  //@}
94
95  //---------------------------------------------------------------------------
96
97private:
98  ///@name Private member data
99  /// Saved offset
100  double offset_;
101  /// Ampl info
102  void *amplObjective_;
103  /// Objective
104  double *objective_;
105  /// Gradient
106  double *gradient_;
107  //@}
108};
109
110#endif
111
112/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
113*/
Note: See TracBrowser for help on using the repository browser.