source: stable/2.4/Cbc/src/ClpAmplObjective.hpp @ 1271

Last change on this file since 1271 was 1271, checked in by forrest, 10 years ago

Creating new stable branch 2.4 from trunk (rev 1270)

File size: 3.0 KB
Line 
1/* $Id: ClpAmplObjective.hpp 1173 2009-06-04 09:44:10Z forrest $ */
2// Copyright (C) 2007, International Business Machines
3// Corporation and others.  All Rights Reserved.
4#ifndef ClpAmplObjective_H
5#define ClpAmplObjective_H
6
7#include "ClpObjective.hpp"
8#include "CoinPackedMatrix.hpp"
9
10//#############################################################################
11
12/** Ampl Objective Class
13
14*/
15
16class ClpAmplObjective : public ClpObjective {
17 
18public:
19 
20  ///@name Stuff
21  //@{
22 
23  /** Returns gradient.  If Ampl then solution may be NULL,
24      also returns an offset (to be added to current one)
25      If refresh is false then uses last solution
26      Uses model for scaling
27      includeLinear 0 - no, 1 as is, 2 as feasible
28  */
29  virtual double * gradient(const ClpSimplex * model,
30                            const double * solution, double & offset,bool refresh,
31                            int includeLinear=2);
32  /// Resize objective
33  /** Returns reduced gradient.Returns an offset (to be added to current one).
34  */
35  virtual double reducedGradient(ClpSimplex * model, double * region,
36                                 bool useFeasibleCosts);
37  /** Returns step length which gives minimum of objective for
38      solution + theta * change vector up to maximum theta.
39
40      arrays are numberColumns+numberRows
41      Also sets current objective, predicted and at maximumTheta
42  */
43  virtual double stepLength(ClpSimplex * model,
44                            const double * solution,
45                            const double * change,
46                            double maximumTheta,
47                            double & currentObj,
48                            double & predictedObj,
49                            double & thetaObj);
50  /// Return objective value (without any ClpModel offset) (model may be NULL)
51  virtual double objectiveValue(const ClpSimplex * model, const double * solution) const ;
52  virtual void resize(int newNumberColumns) ; 
53  /// Delete columns in  objective
54  virtual void deleteSome(int numberToDelete, const int * which) ; 
55  /// Scale objective
56  virtual void reallyScale(const double * columnScale) ;
57  /** Given a zeroed array sets nonlinear columns to 1.
58      Returns number of nonlinear columns
59   */
60  virtual int markNonlinear(char * which);
61 
62  /// Say we have new primal solution - so may need to recompute
63  virtual void newXValues() ;
64  //@}
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
Note: See TracBrowser for help on using the repository browser.