Loading...
Searching...
No Matches
ClpConstraintLinear.hpp
Go to the documentation of this file.
/* $Id$ */
// 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 ClpConstraintLinear_H
#define ClpConstraintLinear_H
#include "ClpConstraint.hpp"
//#############################################################################
class ClpConstraintLinear : public ClpConstraint {
public:
virtual int gradient(const ClpSimplex *model,
const double *solution,
double *gradient,
double &functionValue,
double &offset,
bool useScaling = false,
bool refresh = true) const;
virtual void resize(int newNumberColumns);
virtual void deleteSome(int numberToDelete, const int *which);
virtual void reallyScale(const double *columnScale);
virtual int markNonlinear(char *which) const;
virtual int markNonzero(char *which) const;
ClpConstraintLinear();
ClpConstraintLinear(int row, int numberCoefficients, int numberColumns,
const int *column, const double *element);
ClpConstraintLinear(const ClpConstraintLinear &rhs);
ClpConstraintLinear &operator=(const ClpConstraintLinear &rhs);
virtual ~ClpConstraintLinear();
virtual ClpConstraint *clone() const;
virtual int numberCoefficients() const;
inline int numberColumns() const
{
return numberColumns_;
}
inline const int *column() const
{
return column_;
}
inline const double *coefficient() const
{
return coefficient_;
}
//---------------------------------------------------------------------------
private:
int *column_;
double *coefficient_;
int numberColumns_;
int numberCoefficients_;
};
#endif
/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
*/
ClpConstraint.hpp
ClpConstraintLinear::reallyScale
virtual void reallyScale(const double *columnScale)
Scale constraint.
ClpConstraintLinear::deleteSome
virtual void deleteSome(int numberToDelete, const int *which)
Delete columns in constraint.
ClpConstraintLinear::markNonlinear
virtual int markNonlinear(char *which) const
Given a zeroed array sets nonlinear columns to 1.
ClpConstraintLinear::column_
int * column_
Definition ClpConstraintLinear.hpp:100
ClpConstraintLinear::ClpConstraintLinear
ClpConstraintLinear(int row, int numberCoefficients, int numberColumns, const int *column, const double *element)
Constructor from constraint.
ClpConstraintLinear::column
const int * column() const
Columns.
Definition ClpConstraintLinear.hpp:84
ClpConstraintLinear::coefficient
const double * coefficient() const
Coefficients.
Definition ClpConstraintLinear.hpp:89
ClpConstraintLinear::clone
virtual ClpConstraint * clone() const
Clone.
ClpConstraintLinear::ClpConstraintLinear
ClpConstraintLinear(const ClpConstraintLinear &rhs)
Copy constructor .
ClpConstraintLinear::markNonzero
virtual int markNonzero(char *which) const
Given a zeroed array sets possible nonzero coefficients to 1.
ClpConstraintLinear::~ClpConstraintLinear
virtual ~ClpConstraintLinear()
Destructor.
ClpConstraintLinear::operator=
ClpConstraintLinear & operator=(const ClpConstraintLinear &rhs)
Assignment operator.
ClpConstraintLinear::ClpConstraintLinear
ClpConstraintLinear()
Default Constructor.
ClpConstraintLinear::coefficient_
double * coefficient_
Coefficients.
Definition ClpConstraintLinear.hpp:102
ClpConstraintLinear::numberCoefficients
virtual int numberCoefficients() const
Number of coefficients.
ClpConstraintLinear::numberCoefficients_
int numberCoefficients_
Number of coefficients.
Definition ClpConstraintLinear.hpp:106
ClpConstraintLinear::gradient
virtual int gradient(const ClpSimplex *model, const double *solution, double *gradient, double &functionValue, double &offset, bool useScaling=false, bool refresh=true) const
Fills gradient.
ClpConstraintLinear::numberColumns_
int numberColumns_
Useful to have number of columns about.
Definition ClpConstraintLinear.hpp:104
ClpConstraintLinear::resize
virtual void resize(int newNumberColumns)
Resize constraint.
ClpConstraintLinear::numberColumns
int numberColumns() const
Number of columns in linear constraint.
Definition ClpConstraintLinear.hpp:79
ClpConstraint::functionValue
virtual double functionValue(const ClpSimplex *model, const double *solution, bool useScaling=false, bool refresh=true) const
Constraint function value.
ClpConstraint::offset
double offset() const
Constraint offset.
Definition ClpConstraint.hpp:100
ClpConstraint::ClpConstraint
ClpConstraint()
Default Constructor.
ClpSimplex
This solves LPs using the simplex method.
Definition ClpSimplex.hpp:106