ClpConstraintAmpl.hpp
Go to the documentation of this file.
1 /* $Id: ClpConstraintAmpl.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 ClpConstraintAmpl_H
5 #define ClpConstraintAmpl_H
6 
7 #include "ClpConstraint.hpp"
8 
9 //#############################################################################
10 
15 class ClpConstraintAmpl : public ClpConstraint {
16 
17 public:
18 
20 
21 
22 
29  virtual int gradient(const ClpSimplex * model,
30  const double * solution,
31  double * gradient,
32  double & functionValue ,
33  double & offset,
34  bool useScaling = false,
35  bool refresh = true) const ;
37  virtual void resize(int newNumberColumns) ;
39  virtual void deleteSome(int numberToDelete, const int * which) ;
41  virtual void reallyScale(const double * columnScale) ;
45  virtual int markNonlinear(char * which) const ;
49  virtual int markNonzero(char * which) const;
51  virtual void newXValues() ;
53 
54 
56 
59 
61  ClpConstraintAmpl(int row, void * amplInfo);
62 
66 
69 
71  virtual ~ClpConstraintAmpl ();
72 
74  virtual ClpConstraint * clone() const;
76 
78  virtual int numberCoefficients() const;
81  inline const int * column() const {
82  return column_;
83  }
85  inline const double * coefficient() const {
86  return coefficient_;
87  }
89 
90  //---------------------------------------------------------------------------
91 
92 private:
95  void * amplInfo_;
97  int * column_;
99  double * coefficient_;
103 };
104 
105 #endif
106 
ClpConstraintAmpl & operator=(const ClpConstraintAmpl &rhs)
Assignment operator.
virtual int numberCoefficients() const
Number of coefficients.
virtual int gradient(const ClpSimplex *model, const double *solution, double *gradient, double &functionValue, double &offset, bool useScaling=false, bool refresh=true) const
Fills gradient.
const double * coefficient() const
Coefficients.
const int * column() const
Columns.
int numberCoefficients_
Number of coefficients in gradient.
virtual void resize(int newNumberColumns)
Resize constraint.
virtual int markNonzero(char *which) const
Given a zeroed array sets possible nonzero coefficients to 1.
ClpConstraintAmpl()
Default Constructor.
Ampl Constraint Class.
double * coefficient_
Coefficients.
virtual void reallyScale(const double *columnScale)
Scale constraint.
virtual ~ClpConstraintAmpl()
Destructor.
virtual void newXValues()
Say we have new primal solution - so may need to recompute.
virtual int markNonlinear(char *which) const
Given a zeroed array sets nonampl columns to 1.
virtual ClpConstraint * clone() const
Clone.
virtual void deleteSome(int numberToDelete, const int *which)
Delete columns in constraint.
void * amplInfo_
Column.