Classes | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Friends

ExpandedModelInterface Class Reference

The representation of a a submodel (block) in the expanded model which is passed to the solver to allow it to calculate values. More...

#include <ExpandedModelInterface.h>

Inheritance diagram for ExpandedModelInterface:
ExpandedModel

List of all members.

Classes

class  ancestor_iterator
 Ancestor iterator. More...
class  child_iterator
 Depth first iterator. More...

Public Member Functions

child_iterator cbegin ()
child_iterator cend ()
ancestor_iterator abegin ()
ancestor_iterator aend ()
virtual int getNLocalVars () const =0
 Returns the number of local variables.
virtual const std::list
< std::string > & 
getLocalVarNames () const =0
 Returns the names of local variables.
virtual int getNLocalCons () const =0
 Returns the number of local constraints.
virtual const std::list
< std::string > & 
getLocalConNames () const =0
 Returns the names of local constraints.
virtual int getNzJacobianOfIntersection (ExpandedModelInterface *emcol)=0
 Returns the nonzeros in the Jacobian of a section of the model.
virtual void getJacobianOfIntersection (ExpandedModelInterface *emcol, int *colbeg, int *collen, int *rownbs, double *el)=0
 Returns the nonzeros in the Jacobian of a section of the model.
virtual void getRowBounds (double *lower, double *upper) const =0
 Return the arrays of bounds for the constraints in this model.
virtual void getColLowBounds (double *elts)=0
 Returns the vector of lower bounds for the local variables in this model.
virtual void getColUpBounds (double *elts)=0
 Returns the vector of upper bounds for the local variables in this model.
virtual void getObjGradient (double *elts)=0
 Returns the objective gradient for the local model w.r.t. local vars.
virtual void setPrimalSolColumns (const double *elts)=0
 Upload the local variable solutions.
virtual void setDualSolColumns (const double *elts)=0
 Upload the local variable duals (multipliers on bounds).
virtual void setPrimalSolRows (const double *elts)=0
 Upload the local constraints slacks.
virtual void setDualSolRows (const double *elts)=0
 Upload the local constraints duals (multipliers on constraints).
virtual std::string getName () const =0
 Returns the unique name of this block.
virtual void outputSolution (std::ostream &out, int indent=0)=0
 Outputs the solution to the supplied stream at given indent.
virtual ~ExpandedModelInterface ()

Public Attributes

std::vector
< ExpandedModelInterface * > 
children
 List of child nodes (vector, so that it can be indexed).

Protected Member Functions

 ExpandedModelInterface ()

Protected Attributes

ExpandedModelInterfaceparent
 Parent node.

Friends

class AmplModel

Detailed Description

The representation of a a submodel (block) in the expanded model which is passed to the solver to allow it to calculate values.

The class offers two iterators to allow access to all nodes we may interact with:

  1. child_iterator: iterates over descendants in depth-first order
  2. ancestor_iterator: iterates back to root Descendants are submodels contained within this one, and ancestors are models in which this model is contained.

Constructor & Destructor Documentation

ExpandedModelInterface::ExpandedModelInterface (  )  [inline, protected]
virtual ExpandedModelInterface::~ExpandedModelInterface (  )  [inline, virtual]

Member Function Documentation

ancestor_iterator ExpandedModelInterface::abegin (  )  [inline]

References parent.

ancestor_iterator ExpandedModelInterface::aend (  )  [inline]
child_iterator ExpandedModelInterface::cbegin (  )  [inline]
child_iterator ExpandedModelInterface::cend (  )  [inline]
virtual void ExpandedModelInterface::getColLowBounds ( double *  elts  )  [pure virtual]

Returns the vector of lower bounds for the local variables in this model.

Implemented in ExpandedModel.

virtual void ExpandedModelInterface::getColUpBounds ( double *  elts  )  [pure virtual]

Returns the vector of upper bounds for the local variables in this model.

Implemented in ExpandedModel.

virtual void ExpandedModelInterface::getJacobianOfIntersection ( ExpandedModelInterface emcol,
int *  colbeg,
int *  collen,
int *  rownbs,
double *  el 
) [pure virtual]

Returns the nonzeros in the Jacobian of a section of the model.

Implemented in ExpandedModel.

virtual const std::list<std::string>& ExpandedModelInterface::getLocalConNames (  )  const [pure virtual]

Returns the names of local constraints.

Implemented in ExpandedModel.

virtual const std::list<std::string>& ExpandedModelInterface::getLocalVarNames (  )  const [pure virtual]

Returns the names of local variables.

Implemented in ExpandedModel.

virtual std::string ExpandedModelInterface::getName (  )  const [pure virtual]

Returns the unique name of this block.

Implemented in ExpandedModel.

Referenced by ExpandedModel::outputSolution().

virtual int ExpandedModelInterface::getNLocalCons (  )  const [pure virtual]

Returns the number of local constraints.

Implemented in ExpandedModel.

virtual int ExpandedModelInterface::getNLocalVars (  )  const [pure virtual]

Returns the number of local variables.

Implemented in ExpandedModel.

virtual int ExpandedModelInterface::getNzJacobianOfIntersection ( ExpandedModelInterface emcol  )  [pure virtual]

Returns the nonzeros in the Jacobian of a section of the model.

Implemented in ExpandedModel.

virtual void ExpandedModelInterface::getObjGradient ( double *  elts  )  [pure virtual]

Returns the objective gradient for the local model w.r.t. local vars.

Implemented in ExpandedModel.

virtual void ExpandedModelInterface::getRowBounds ( double *  lower,
double *  upper 
) const [pure virtual]

Return the arrays of bounds for the constraints in this model.

Implemented in ExpandedModel.

virtual void ExpandedModelInterface::outputSolution ( std::ostream &  out,
int  indent = 0 
) [pure virtual]

Outputs the solution to the supplied stream at given indent.

Implemented in ExpandedModel.

virtual void ExpandedModelInterface::setDualSolColumns ( const double *  elts  )  [pure virtual]

Upload the local variable duals (multipliers on bounds).

Implemented in ExpandedModel.

virtual void ExpandedModelInterface::setDualSolRows ( const double *  elts  )  [pure virtual]

Upload the local constraints duals (multipliers on constraints).

Implemented in ExpandedModel.

virtual void ExpandedModelInterface::setPrimalSolColumns ( const double *  elts  )  [pure virtual]

Upload the local variable solutions.

Implemented in ExpandedModel.

virtual void ExpandedModelInterface::setPrimalSolRows ( const double *  elts  )  [pure virtual]

Upload the local constraints slacks.

Implemented in ExpandedModel.


Friends And Related Function Documentation

friend class AmplModel [friend]

Member Data Documentation


The documentation for this class was generated from the following file: