Changeset 2385 for trunk/Clp/src/ClpConstraintQuadratic.hpp
 Timestamp:
 Jan 6, 2019 2:43:06 PM (3 months ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/Clp/src/ClpConstraintQuadratic.hpp
r1665 r2385 18 18 19 19 public: 20 ///@name Stuff 21 //@{ 20 22 21 ///@name Stuff 22 //@{ 23 24 25 /** Fills gradient. If Quadratic then solution may be NULL, 23 /** Fills gradient. If Quadratic then solution may be NULL, 26 24 also returns true value of function and offset so we can use x not deltaX in constraint 27 25 If refresh is false then uses last solution … … 29 27 Returns nonzero if gradient udefined at current solution 30 28 */ 31 virtual int gradient(const ClpSimplex *model,32 const double *solution,33 double *gradient,34 double & functionValue,35 double &offset,36 37 bool refresh = true) const;38 39 virtual void resize(int newNumberColumns);40 41 virtual void deleteSome(int numberToDelete, const int * which);42 43 virtual void reallyScale(const double * columnScale);44 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; 36 /// Resize constraint 37 virtual void resize(int newNumberColumns); 38 /// Delete columns in constraint 39 virtual void deleteSome(int numberToDelete, const int *which); 40 /// Scale constraint 41 virtual void reallyScale(const double *columnScale); 42 /** Given a zeroed array sets nonquadratic columns to 1. 45 43 Returns number of nonquadratic columns 46 44 */ 47 virtual int markNonlinear(char * which) const;48 45 virtual int markNonlinear(char *which) const; 46 /** Given a zeroed array sets possible nonzero coefficients to 1. 49 47 Returns number of nonzeros 50 48 */ 51 virtual int markNonzero(char *which) const;52 49 virtual int markNonzero(char *which) const; 50 //@} 53 51 52 ///@name Constructors and destructors 53 //@{ 54 /// Default Constructor 55 ClpConstraintQuadratic(); 54 56 55 ///@name Constructors and destructors56 //@{57 /// Default Constructor58 ClpConstraintQuadratic();57 /// Constructor from quadratic 58 ClpConstraintQuadratic(int row, int numberQuadraticColumns, int numberColumns, 59 const CoinBigIndex *start, 60 const int *column, const double *element); 59 61 60 /// Constructor from quadratic 61 ClpConstraintQuadratic(int row, int numberQuadraticColumns, int numberColumns, 62 const CoinBigIndex * start, 63 const int * column, const double * element); 62 /** Copy constructor . 63 */ 64 ClpConstraintQuadratic(const ClpConstraintQuadratic &rhs); 64 65 65 /** Copy constructor . 66 */ 67 ClpConstraintQuadratic(const ClpConstraintQuadratic & rhs); 66 /// Assignment operator 67 ClpConstraintQuadratic &operator=(const ClpConstraintQuadratic &rhs); 68 68 69 /// Assignment operator70 ClpConstraintQuadratic & operator=(const ClpConstraintQuadratic& rhs);69 /// Destructor 70 virtual ~ClpConstraintQuadratic(); 71 71 72 /// Destructor 73 virtual ~ClpConstraintQuadratic (); 72 /// Clone 73 virtual ClpConstraint *clone() const; 74 //@} 75 ///@name Gets and sets 76 //@{ 77 /// Number of coefficients 78 virtual int numberCoefficients() const; 79 /// Number of columns in constraint 80 inline int numberColumns() const 81 { 82 return numberColumns_; 83 } 84 /// Column starts 85 inline CoinBigIndex *start() const 86 { 87 return start_; 88 } 89 /// Columns 90 inline const int *column() const 91 { 92 return column_; 93 } 94 /// Coefficients 95 inline const double *coefficient() const 96 { 97 return coefficient_; 98 } 99 //@} 74 100 75 /// Clone 76 virtual ClpConstraint * clone() const; 77 //@} 78 ///@name Gets and sets 79 //@{ 80 /// Number of coefficients 81 virtual int numberCoefficients() const; 82 /// Number of columns in constraint 83 inline int numberColumns() const { 84 return numberColumns_; 85 } 86 /// Column starts 87 inline CoinBigIndex * start() const { 88 return start_; 89 } 90 /// Columns 91 inline const int * column() const { 92 return column_; 93 } 94 /// Coefficients 95 inline const double * coefficient() const { 96 return coefficient_; 97 } 98 //@} 99 100 // 101 // 101 102 102 103 private: 103 104 105 CoinBigIndex *start_;106 107 int *column_;108 109 double *coefficient_;110 111 112 113 114 115 116 104 ///@name Private member data 105 /// Column starts 106 CoinBigIndex *start_; 107 /// Column (if 1 then linear coefficient) 108 int *column_; 109 /// Coefficients 110 double *coefficient_; 111 /// Useful to have number of columns about 112 int numberColumns_; 113 /// Number of coefficients in gradient 114 int numberCoefficients_; 115 /// Number of quadratic columns 116 int numberQuadraticColumns_; 117 //@} 117 118 }; 118 119 119 120 #endif 121 122 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2 123 */
Note: See TracChangeset
for help on using the changeset viewer.