source: branches/devel/Clp/src/ClpConstraintLinear.hpp @ 997

Last change on this file since 997 was 997, checked in by forrest, 13 years ago

for nonlinear

File size: 2.5 KB
Line 
1// Copyright (C) 2007, International Business Machines
2// Corporation and others.  All Rights Reserved.
3#ifndef ClpConstraintLinear_H
4#define ClpConstraintLinear_H
5
6#include "ClpConstraint.hpp"
7
8//#############################################################################
9
10/** Linear Constraint Class
11
12*/
13
14class ClpConstraintLinear : public ClpConstraint {
15 
16public:
17 
18  ///@name Stuff
19  //@{
20 
21 
22  /** Fills gradient.  If Linear then solution may be NULL,
23      also returns value of function
24      If refresh is false then uses last solution
25      Uses model for scaling
26      Returns non-zero if gradient udefined at current solution
27  */
28  virtual int gradient(const ClpSimplex * model,
29                       const double * solution,
30                       double * gradient,
31                       double & functionValue ,
32                       bool refresh=true) const ;
33  /// Resize constraint
34  virtual void resize(int newNumberColumns) ; 
35  /// Delete columns in  constraint
36  virtual void deleteSome(int numberToDelete, const int * which) ; 
37  /// Scale constraint
38  virtual void reallyScale(const double * columnScale) ;
39  /** Given a zeroed array sets nonlinear columns to 1.
40      Returns number of nonlinear columns
41   */
42  virtual int markNonlinear(char * which) const ;
43  //@}
44 
45 
46  ///@name Constructors and destructors
47  //@{
48  /// Default Constructor
49  ClpConstraintLinear(); 
50 
51  /// Constructor from constraint
52  ClpConstraintLinear(int numberCoefficients, int numberColumns,
53                      const int * column, const double * element);
54 
55  /** Copy constructor .
56  */
57  ClpConstraintLinear(const ClpConstraintLinear & rhs);
58
59  /// Assignment operator
60  ClpConstraintLinear & operator=(const ClpConstraintLinear& rhs);
61 
62  /// Destructor
63  virtual ~ClpConstraintLinear ();
64
65  /// Clone
66  virtual ClpConstraint * clone() const;
67  //@}
68  ///@name Gets and sets
69  //@{
70  /// Number of coefficients
71  inline int numberCoefficients() const
72  {return numberCoefficients_;};
73  /// Number of columns in linear constraint
74  inline int numberColumns() const
75  {return numberColumns_;};
76  /// Columns
77  inline const int * column() const
78  { return column_;};
79  /// Coefficients
80  inline const double * coefficient() const
81  { return coefficient_;};
82  //@}
83
84  //---------------------------------------------------------------------------
85 
86private:
87  ///@name Private member data
88  /// Column
89  int * column_;
90  /// Coefficients
91  double * coefficient_;
92  /// Useful to have number of columns about
93  int numberColumns_;
94  /// Number of coefficients
95  int numberCoefficients_;
96  //@}
97};
98
99#endif
Note: See TracBrowser for help on using the repository browser.