Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

ClpLinearObjective Class Reference

#include <ClpLinearObjective.hpp>

Inheritance diagram for ClpLinearObjective:

ClpObjective List of all members.

Public Member Functions

Stuff
virtual double * gradient (const double *solution, double &offset, bool refresh)
virtual void resize (int newNumberColumns)
 Resize objective.

virtual void deleteSome (int numberToDelete, const int *which)
 Delete columns in objective.

Constructors and destructors
 ClpLinearObjective ()
 Default Constructor.

 ClpLinearObjective (const double *objective, int numberColumns)
 Constructor from objective.

 ClpLinearObjective (const ClpLinearObjective &)
 Copy constructor.

 ClpLinearObjective (const ClpLinearObjective &rhs, int numberColumns, const int *whichColumns)
ClpLinearObjectiveoperator= (const ClpLinearObjective &rhs)
 Assignment operator.

virtual ~ClpLinearObjective ()
 Destructor.

virtual ClpObjectiveclone () const
 Clone.

virtual ClpObjectivesubsetClone (int numberColumns, const int *whichColumns) const

Private Attributes

Private member data
Objective

double * objective_
int numberColumns_
 number of columns


Detailed Description

Linear Objective Class

Definition at line 14 of file ClpLinearObjective.hpp.


Constructor & Destructor Documentation

ClpLinearObjective::ClpLinearObjective const ClpLinearObjective rhs,
int  numberColumns,
const int *  whichColumns
 

Subset constructor. Duplicates are allowed and order is as given.

Definition at line 58 of file ClpLinearObjective.cpp.

References numberColumns_, and objective_.

00061 : ClpObjective(rhs)
00062 {
00063   objective_=NULL;
00064   numberColumns_=0;
00065   if (numberColumns>0) {
00066     // check valid lists
00067     int numberBad=0;
00068     int i;
00069     for (i=0;i<numberColumns;i++)
00070       if (whichColumn[i]<0||whichColumn[i]>=rhs.numberColumns_)
00071         numberBad++;
00072     if (numberBad)
00073       throw CoinError("bad column list", "subset constructor", 
00074                       "ClpLinearObjective");
00075     numberColumns_ = numberColumns;
00076     objective_ = new double[numberColumns_];
00077     for (i=0;i<numberColumns_;i++) 
00078       objective_[i]=rhs.objective_[whichColumn[i]];
00079   }
00080 }


Member Function Documentation

double * ClpLinearObjective::gradient const double *  solution,
double &  offset,
bool  refresh
[virtual]
 

Returns gradient. If Linear then solution may be NULL, also returns an offset (to be added to current one) If refresh is false then uses last solution

Implements ClpObjective.

Definition at line 112 of file ClpLinearObjective.cpp.

00113 {
00114   offset=0.0;
00115   return objective_;
00116 }

ClpObjective * ClpLinearObjective::subsetClone int  numberColumns,
const int *  whichColumns
const [virtual]
 

Subset clone. Duplicates are allowed and order is as given.

Reimplemented from ClpObjective.

Definition at line 129 of file ClpLinearObjective.cpp.

References ClpLinearObjective().

00131 {
00132   return new ClpLinearObjective(*this, numberColumns, whichColumns);
00133 }


The documentation for this class was generated from the following files:
Generated on Wed Dec 3 14:37:38 2003 for CLP by doxygen 1.3.5