diff options
author | Harpreet | 2016-08-04 15:25:44 +0530 |
---|---|---|
committer | Harpreet | 2016-08-04 15:25:44 +0530 |
commit | 9fd2976931c088dc523974afb901e96bad20f73c (patch) | |
tree | 22502de6e6988d5cd595290d11266f8432ad825b /build/Bonmin/include/coin/ClpConstraintAmpl.hpp | |
download | FOSSEE-Optim-toolbox-development-9fd2976931c088dc523974afb901e96bad20f73c.tar.gz FOSSEE-Optim-toolbox-development-9fd2976931c088dc523974afb901e96bad20f73c.tar.bz2 FOSSEE-Optim-toolbox-development-9fd2976931c088dc523974afb901e96bad20f73c.zip |
initial add
Diffstat (limited to 'build/Bonmin/include/coin/ClpConstraintAmpl.hpp')
-rw-r--r-- | build/Bonmin/include/coin/ClpConstraintAmpl.hpp | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/build/Bonmin/include/coin/ClpConstraintAmpl.hpp b/build/Bonmin/include/coin/ClpConstraintAmpl.hpp new file mode 100644 index 0000000..1ca0ab4 --- /dev/null +++ b/build/Bonmin/include/coin/ClpConstraintAmpl.hpp @@ -0,0 +1,108 @@ +/* $Id: ClpConstraintAmpl.hpp 1899 2013-04-09 18:12:08Z stefan $ */ +// Copyright (C) 2007, International Business Machines +// Corporation and others. All Rights Reserved. +// This code is licensed under the terms of the Eclipse Public License (EPL). + +#ifndef ClpConstraintAmpl_H +#define ClpConstraintAmpl_H + +#include "ClpConstraint.hpp" + +//############################################################################# + +/** Ampl Constraint Class + +*/ + +class ClpConstraintAmpl : public ClpConstraint { + +public: + + ///@name Stuff + //@{ + + + /** Fills gradient. If Ampl then solution may be NULL, + also returns true value of function and offset so we can use x not deltaX in constraint + If refresh is false then uses last solution + Uses model for scaling + Returns non-zero if gradient udefined at current solution + */ + virtual int gradient(const ClpSimplex * model, + const double * solution, + double * gradient, + double & functionValue , + double & offset, + bool useScaling = false, + bool refresh = true) const ; + /// Resize constraint + virtual void resize(int newNumberColumns) ; + /// Delete columns in constraint + virtual void deleteSome(int numberToDelete, const int * which) ; + /// Scale constraint + virtual void reallyScale(const double * columnScale) ; + /** Given a zeroed array sets nonampl columns to 1. + Returns number of nonampl columns + */ + virtual int markNonlinear(char * which) const ; + /** Given a zeroed array sets possible nonzero coefficients to 1. + Returns number of nonzeros + */ + virtual int markNonzero(char * which) const; + /// Say we have new primal solution - so may need to recompute + virtual void newXValues() ; + //@} + + + ///@name Constructors and destructors + //@{ + /// Default Constructor + ClpConstraintAmpl(); + + /// Constructor from ampl + ClpConstraintAmpl(int row, void * amplInfo); + + /** Copy constructor . + */ + ClpConstraintAmpl(const ClpConstraintAmpl & rhs); + + /// Assignment operator + ClpConstraintAmpl & operator=(const ClpConstraintAmpl& rhs); + + /// Destructor + virtual ~ClpConstraintAmpl (); + + /// Clone + virtual ClpConstraint * clone() const; + //@} + ///@name Gets and sets + //@{ + /// Number of coefficients + virtual int numberCoefficients() const; + /// Columns + inline const int * column() const { + return column_; + } + /// Coefficients + inline const double * coefficient() const { + return coefficient_; + } + //@} + + //--------------------------------------------------------------------------- + +private: + ///@name Private member data + /// Ampl info + void * amplInfo_; + /// Column + int * column_; + /// Coefficients + double * coefficient_; + /// Number of coefficients in gradient + int numberCoefficients_; + //@} +}; + +#endif + |