source: branches/devel/Cbc/src/ClpAmplObjective.hpp @ 642

Last change on this file since 642 was 642, checked in by forrest, 12 years ago

update branches/devel for threads

File size: 2.9 KB
Line 
1// Copyright (C) 2007, International Business Machines
2// Corporation and others.  All Rights Reserved.
3#ifndef ClpAmplObjective_H
4#define ClpAmplObjective_H
5
6#include "ClpObjective.hpp"
7#include "CoinPackedMatrix.hpp"
8
9//#############################################################################
10
11/** Ampl Objective Class
12
13*/
14
15class ClpAmplObjective : public ClpObjective {
16 
17public:
18 
19  ///@name Stuff
20  //@{
21 
22  /** Returns gradient.  If Ampl then solution may be NULL,
23      also returns an offset (to be added to current one)
24      If refresh is false then uses last solution
25      Uses model for scaling
26      includeLinear 0 - no, 1 as is, 2 as feasible
27  */
28  virtual double * gradient(const ClpSimplex * model,
29                            const double * solution, double & offset,bool refresh,
30                            int includeLinear=2);
31  /// Resize objective
32  /** Returns reduced gradient.Returns an offset (to be added to current one).
33  */
34  virtual double reducedGradient(ClpSimplex * model, double * region,
35                                 bool useFeasibleCosts);
36  /** Returns step length which gives minimum of objective for
37      solution + theta * change vector up to maximum theta.
38
39      arrays are numberColumns+numberRows
40      Also sets current objective, predicted and at maximumTheta
41  */
42  virtual double stepLength(ClpSimplex * model,
43                            const double * solution,
44                            const double * change,
45                            double maximumTheta,
46                            double & currentObj,
47                            double & predictedObj,
48                            double & thetaObj);
49  /// Return objective value (without any ClpModel offset) (model may be NULL)
50  virtual double objectiveValue(const ClpSimplex * model, const double * solution) const ;
51  virtual void resize(int newNumberColumns) ; 
52  /// Delete columns in  objective
53  virtual void deleteSome(int numberToDelete, const int * which) ; 
54  /// Scale objective
55  virtual void reallyScale(const double * columnScale) ;
56  /** Given a zeroed array sets nonlinear columns to 1.
57      Returns number of nonlinear columns
58   */
59  virtual int markNonlinear(char * which);
60 
61  /// Say we have new primal solution - so may need to recompute
62  virtual void newXValues() ;
63  //@}
64 
65 
66  ///@name Constructors and destructors
67  //@{
68  /// Default Constructor
69  ClpAmplObjective(); 
70 
71  /// Constructor from ampl info
72  ClpAmplObjective(void * amplInfo);
73 
74  /** Copy constructor .
75  */
76  ClpAmplObjective(const ClpAmplObjective & rhs);
77 
78  /// Assignment operator
79  ClpAmplObjective & operator=(const ClpAmplObjective& rhs);
80 
81  /// Destructor
82  virtual ~ClpAmplObjective ();
83
84  /// Clone
85  virtual ClpObjective * clone() const;
86
87  //@}
88  ///@name Gets and sets
89  //@{
90   /// Linear objective
91  double * linearObjective() const;
92  //@}
93
94  //---------------------------------------------------------------------------
95 
96private:
97  ///@name Private member data
98  /// Saved offset
99  double offset_;
100  /// Ampl info
101  void * amplObjective_;
102  /// Objective
103  double * objective_;
104  /// Gradient
105  double * gradient_;
106  //@}
107};
108
109#endif
Note: See TracBrowser for help on using the repository browser.