Bcps 0.95.1
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
BcpsNodeDesc Class Reference

For a given type, the objectVecStorage_ structure holds the description. More...

#include <BcpsNodeDesc.h>

+ Inheritance diagram for BcpsNodeDesc:
+ Collaboration diagram for BcpsNodeDesc:

Public Member Functions

 BcpsNodeDesc ()
 Default constructor.
 
 BcpsNodeDesc (BcpsModel *m)
 Useful constructor.
 
virtual ~BcpsNodeDesc ()
 Destructor.
 
void initToNull ()
 Initialize member data.
 
void setVars (int numRem, const int *posRem, int numAdd, const BcpsObject **objects, bool relvlh, int numvlh, const int *vlhp, const double *vlhe, bool relvuh, int numvuh, const int *vuhp, const double *vuhe, bool relvls, int numvls, const int *vlsp, const double *vlse, bool relvus, int numvus, const int *vusp, const double *vuse)
 Set variable objects.
 
void assignVars (int numRem, int *&posRem, int numAdd, BcpsObject **&objects, bool relvlh, int numvlh, int *&vlhp, double *&vlhe, bool relvuh, int numvuh, int *&vuhp, double *&vuhe, bool relvls, int numvls, int *&vlsp, double *&vlse, bool relvus, int numvus, int *&vusp, double *&vuse)
 Assign variable objects.
 
void setCons (int numRem, const int *posRem, int numAdd, const BcpsObject **objects, bool relclh, int numclh, const int *clhp, const double *clhe, bool relcuh, int numcuh, const int *cuhp, const double *cuhe, bool relcls, int numcls, const int *clsp, const double *clse, bool relcus, int numcus, const int *cusp, const double *cuse)
 Set constraint objects.
 
void assignCons (int numRem, int *&posRem, int numAdd, BcpsObject **&objects, bool relclh, int numclh, int *&clhp, double *&clhe, bool relcuh, int numcuh, int *&cuhp, double *&cuhe, bool relcls, int numcls, int *&clsp, double *&clse, bool relcus, int numcus, int *&cusp, double *&cuse)
 Assign constraint objects.
 
BcpsObjectListModgetVars () const
 Get variable objects.
 
BcpsObjectListModgetCons () const
 Get constraint objects.
 
BcpsObjectListModvars ()
 Accesss varaibles.
 
BcpsObjectListModcons ()
 Accesss constraints.
 
void assignVarSoftBound (int numModSoftVarLB, int *&varLBi, double *&varLBv, int numModSoftVarUB, int *&varUBi, double *&varUBv)
 Set variable soft bounds.
 
void setVarSoftBound (int numModSoftVarLB, const int *varLBi, const double *varLBv, int numModSoftVarUB, const int *varUBi, const double *varUBv)
 Set variable soft bounds.
 
void assignVarHardBound (int numModHardVarLB, int *&varLBi, double *&varLBv, int numModHardVarUB, int *&varUBi, double *&varUBv)
 Set variable hard bounds.
 
void setConSoftBound (int numModSoftConLB, const int *conLBi, const double *conLBv, int numModSoftConUB, const int *conUBi, const double *conUBv)
 Set constraint soft bounds.
 
void setVarHardBound (int numModHardVarLB, const int *varLBi, const double *varLBv, int numModHardVarUB, const int *varUBi, const double *varUBv)
 Set variable hard bounds.
 
void setConHardBound (int numModHardConLB, const int *conLBi, const double *conLBv, int numModHardConUB, const int *conUBi, const double *conUBv)
 Set constraint hard bounds.
 
void appendAddedConstraints (int numAdd, BcpsObject **addCons)
 Recode the added constraints.
 
void setAddedConstraints (int numAdd, BcpsObject **addCons)
 Recode the added constraints.
 
void delConstraints (int numDel, int *indices)
 Record the constraints are deleted.
 
void addVariables (int numAdd, BcpsObject **addVars)
 Record added variables.
 
void delVariables (int numDel, int *indices)
 Record deleted variables.
 
AlpsReturnStatus encodeBcps (AlpsEncoded *encoded) const
 Pack bcps node description into an encoded.
 
AlpsReturnStatus decodeBcps (AlpsEncoded &encoded)
 Unpack bcps node description into an encoded.
 

Protected Member Functions

AlpsReturnStatus encodeDblFieldMods (AlpsEncoded *encoded, BcpsFieldListMod< double > *field) const
 Pack a double field into an encoded object.
 
AlpsReturnStatus encodeIntFieldMods (AlpsEncoded *encoded, BcpsFieldListMod< int > *field) const
 Pack a integer field into an encoded object.
 
AlpsReturnStatus encodeObjectMods (AlpsEncoded *encoded, BcpsObjectListMod *objMod) const
 Pack object modifications to an encoded object.
 
AlpsReturnStatus decodeDblFieldMods (AlpsEncoded &encoded, BcpsFieldListMod< double > *field)
 Unpack a double field from an encoded object.
 
AlpsReturnStatus decodeIntFieldMods (AlpsEncoded &encoded, BcpsFieldListMod< int > *field)
 Unpack a integer field from an encoded object.
 
AlpsReturnStatus decodeObjectMods (AlpsEncoded &encoded, BcpsObjectListMod *objMod)
 Unpack object modifications to an encoded object.
 

Protected Attributes

BcpsObjectListModvars_
 Variable objects.
 
BcpsObjectListModcons_
 Constraint objects.
 

Detailed Description

For a given type, the objectVecStorage_ structure holds the description.

This description is explicit if the numRemoved member is -1. In this case, the objects member holds the full list of objects of the given type. If an explicit description of the parent is given together with a relative description of the current node then the process of reconstructing the explicit description of the current node is as follows:

  1. initialize the explicit list L to be the parent's list;
  2. remove the objects on the indicated positions from L;
  3. modify the appropriate members of the objects in L according to the vectorMod_ members of the objectVecStorage_ structure;
  4. append the objects to be added to L.

If the numRemoved field is -1, that means that the current description is explicit. In this case, the contents of the vectorMod_ members are largely irrelevant, except for the relative fields which indicate whether the appropriate vectorMod_ member can ever be expressed as a relative description or not.

If the numRemoved field is >=0, then the current description is considered relative even if every vectorMod_ member contains explicit data. The description of a node can be either explicit or relative to its parent. In the node there are a number of object types and for each object type the explicit/relative description is considered separately.

If the information on an object type is relative, it means that at least one of the fields (lbHard, ubHard, etc.) has a relative description.

Definition at line 129 of file BcpsNodeDesc.h.

Constructor & Destructor Documentation

◆ BcpsNodeDesc() [1/2]

BcpsNodeDesc::BcpsNodeDesc ( )
inline

Default constructor.

Definition at line 142 of file BcpsNodeDesc.h.

◆ BcpsNodeDesc() [2/2]

BcpsNodeDesc::BcpsNodeDesc ( BcpsModel * m)
inline

Useful constructor.

Definition at line 145 of file BcpsNodeDesc.h.

◆ ~BcpsNodeDesc()

virtual BcpsNodeDesc::~BcpsNodeDesc ( )
virtual

Destructor.

Member Function Documentation

◆ initToNull()

void BcpsNodeDesc::initToNull ( )

Initialize member data.

◆ setVars()

void BcpsNodeDesc::setVars ( int numRem,
const int * posRem,
int numAdd,
const BcpsObject ** objects,
bool relvlh,
int numvlh,
const int * vlhp,
const double * vlhe,
bool relvuh,
int numvuh,
const int * vuhp,
const double * vuhe,
bool relvls,
int numvls,
const int * vlsp,
const double * vlse,
bool relvus,
int numvus,
const int * vusp,
const double * vuse )

Set variable objects.

◆ assignVars()

void BcpsNodeDesc::assignVars ( int numRem,
int *& posRem,
int numAdd,
BcpsObject **& objects,
bool relvlh,
int numvlh,
int *& vlhp,
double *& vlhe,
bool relvuh,
int numvuh,
int *& vuhp,
double *& vuhe,
bool relvls,
int numvls,
int *& vlsp,
double *& vlse,
bool relvus,
int numvus,
int *& vusp,
double *& vuse )

Assign variable objects.

Take over memory ownership.

◆ setCons()

void BcpsNodeDesc::setCons ( int numRem,
const int * posRem,
int numAdd,
const BcpsObject ** objects,
bool relclh,
int numclh,
const int * clhp,
const double * clhe,
bool relcuh,
int numcuh,
const int * cuhp,
const double * cuhe,
bool relcls,
int numcls,
const int * clsp,
const double * clse,
bool relcus,
int numcus,
const int * cusp,
const double * cuse )

Set constraint objects.

◆ assignCons()

void BcpsNodeDesc::assignCons ( int numRem,
int *& posRem,
int numAdd,
BcpsObject **& objects,
bool relclh,
int numclh,
int *& clhp,
double *& clhe,
bool relcuh,
int numcuh,
int *& cuhp,
double *& cuhe,
bool relcls,
int numcls,
int *& clsp,
double *& clse,
bool relcus,
int numcus,
int *& cusp,
double *& cuse )

Assign constraint objects.

Take over memory ownership.

◆ getVars()

BcpsObjectListMod * BcpsNodeDesc::getVars ( ) const
inline

Get variable objects.

Definition at line 244 of file BcpsNodeDesc.h.

◆ getCons()

BcpsObjectListMod * BcpsNodeDesc::getCons ( ) const
inline

Get constraint objects.

Definition at line 247 of file BcpsNodeDesc.h.

◆ vars()

BcpsObjectListMod * BcpsNodeDesc::vars ( )
inline

Accesss varaibles.

Definition at line 250 of file BcpsNodeDesc.h.

◆ cons()

BcpsObjectListMod * BcpsNodeDesc::cons ( )
inline

Accesss constraints.

Definition at line 253 of file BcpsNodeDesc.h.

◆ assignVarSoftBound()

void BcpsNodeDesc::assignVarSoftBound ( int numModSoftVarLB,
int *& varLBi,
double *& varLBv,
int numModSoftVarUB,
int *& varUBi,
double *& varUBv )

Set variable soft bounds.

Take ownerships of arraies.

◆ setVarSoftBound()

void BcpsNodeDesc::setVarSoftBound ( int numModSoftVarLB,
const int * varLBi,
const double * varLBv,
int numModSoftVarUB,
const int * varUBi,
const double * varUBv )

Set variable soft bounds.

Don't take ownerships of arraies.

◆ assignVarHardBound()

void BcpsNodeDesc::assignVarHardBound ( int numModHardVarLB,
int *& varLBi,
double *& varLBv,
int numModHardVarUB,
int *& varUBi,
double *& varUBv )

Set variable hard bounds.

Take ownerships of arraies.

◆ setConSoftBound()

void BcpsNodeDesc::setConSoftBound ( int numModSoftConLB,
const int * conLBi,
const double * conLBv,
int numModSoftConUB,
const int * conUBi,
const double * conUBv )

Set constraint soft bounds.

Don't take ownerships of arraies.

◆ setVarHardBound()

void BcpsNodeDesc::setVarHardBound ( int numModHardVarLB,
const int * varLBi,
const double * varLBv,
int numModHardVarUB,
const int * varUBi,
const double * varUBv )

Set variable hard bounds.

Don't take ownerships of arraies.

◆ setConHardBound()

void BcpsNodeDesc::setConHardBound ( int numModHardConLB,
const int * conLBi,
const double * conLBv,
int numModHardConUB,
const int * conUBi,
const double * conUBv )

Set constraint hard bounds.

Don't take ownerships of arraies.

◆ appendAddedConstraints()

void BcpsNodeDesc::appendAddedConstraints ( int numAdd,
BcpsObject ** addCons )
inline

Recode the added constraints.

Take over the memory ownship of aguments. Append to previous constraints.

Definition at line 305 of file BcpsNodeDesc.h.

◆ setAddedConstraints()

void BcpsNodeDesc::setAddedConstraints ( int numAdd,
BcpsObject ** addCons )
inline

Recode the added constraints.

Take over the memory ownship of aguments. Delete already added constraints.

Definition at line 324 of file BcpsNodeDesc.h.

◆ delConstraints()

void BcpsNodeDesc::delConstraints ( int numDel,
int * indices )
inline

Record the constraints are deleted.

Take over the memory ownship of arguments.

Definition at line 338 of file BcpsNodeDesc.h.

◆ addVariables()

void BcpsNodeDesc::addVariables ( int numAdd,
BcpsObject ** addVars )
inline

Record added variables.

Take over the memory ownship of arguments.

Definition at line 345 of file BcpsNodeDesc.h.

◆ delVariables()

void BcpsNodeDesc::delVariables ( int numDel,
int * indices )
inline

Record deleted variables.

Take over the memory ownship of arguemnts.

Definition at line 358 of file BcpsNodeDesc.h.

◆ encodeDblFieldMods()

AlpsReturnStatus BcpsNodeDesc::encodeDblFieldMods ( AlpsEncoded * encoded,
BcpsFieldListMod< double > * field ) const
protected

Pack a double field into an encoded object.

◆ encodeIntFieldMods()

AlpsReturnStatus BcpsNodeDesc::encodeIntFieldMods ( AlpsEncoded * encoded,
BcpsFieldListMod< int > * field ) const
protected

Pack a integer field into an encoded object.

◆ encodeObjectMods()

AlpsReturnStatus BcpsNodeDesc::encodeObjectMods ( AlpsEncoded * encoded,
BcpsObjectListMod * objMod ) const
protected

Pack object modifications to an encoded object.

◆ decodeDblFieldMods()

AlpsReturnStatus BcpsNodeDesc::decodeDblFieldMods ( AlpsEncoded & encoded,
BcpsFieldListMod< double > * field )
protected

Unpack a double field from an encoded object.

◆ decodeIntFieldMods()

AlpsReturnStatus BcpsNodeDesc::decodeIntFieldMods ( AlpsEncoded & encoded,
BcpsFieldListMod< int > * field )
protected

Unpack a integer field from an encoded object.

◆ decodeObjectMods()

AlpsReturnStatus BcpsNodeDesc::decodeObjectMods ( AlpsEncoded & encoded,
BcpsObjectListMod * objMod )
protected

Unpack object modifications to an encoded object.

◆ encodeBcps()

AlpsReturnStatus BcpsNodeDesc::encodeBcps ( AlpsEncoded * encoded) const

Pack bcps node description into an encoded.

◆ decodeBcps()

AlpsReturnStatus BcpsNodeDesc::decodeBcps ( AlpsEncoded & encoded)

Unpack bcps node description into an encoded.

Member Data Documentation

◆ vars_

BcpsObjectListMod* BcpsNodeDesc::vars_
protected

Variable objects.

Definition at line 134 of file BcpsNodeDesc.h.

◆ cons_

BcpsObjectListMod* BcpsNodeDesc::cons_
protected

Constraint objects.

Definition at line 137 of file BcpsNodeDesc.h.


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