coco::model_gid Class Reference
[Models]

Model Group Data Class (middle class in the model hierarchy). More...

#include <model.h>

Collaboration diagram for coco::model_gid:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void remove_node_ref (unsigned int _n)
void remove_var_ref (unsigned int _n)
void remove_const_ref (unsigned int _n)
 model_gid (model &__m, model_iddata *__i=NULL)
 model_gid (model &__m, unsigned int n, model_iddata *__i=NULL)
 model_gid (model &__mr, const model_gid &__m)
 ~model_gid ()
Methods for accessing model group information
These methods can be used for accessing important information about a model group and its nodes, variables, constraints,...

unsigned int number_of_nodes () const
unsigned int number_of_variables () const
unsigned int number_of_constraints () const
void number_of_nodes (unsigned int _n)
void number_of_variables (unsigned int _n)
void number_of_constraints (unsigned int _n)
void mk_globref (unsigned int n, const model::walker &__w)
void mk_gvarref (unsigned int n, const model::walker &__w)
void mk_gconstref (unsigned int n, const model::walker &__w)
void make_const_back_ref (unsigned int node, unsigned int cnum)
unsigned int get_node_id ()
void remove_node_id (unsigned int n)
unsigned int get_var_id ()
void remove_var_id (unsigned int n)
unsigned int get_const_id ()
void remove_const_id (unsigned int n)
void compress_numbers (bool renumber_vars=false, bool renumber_const=false)
const model::walkernode (unsigned int i) const
const model::walkervariable (unsigned int i) const
const model::walkerconstraint (unsigned int i) const
bool empty (const model::walker &__x) const
bool its_me (const model &__m) const
model::walker empty_reference () const
bool have_glob_ref (unsigned int _nnum) const
bool have_gvar_ref (unsigned int _vnum) const
bool have_gconst_ref (unsigned int _cnum) const
Methods for handling modeling information
These methods return names of variables and constants and other data which is irrelevant for the solution process but necessary for user interaction.

const std::string model_name () const
void model_name (const std::string &n)
void model_name (const char *n)
const std::string var_name (unsigned int n) const
void var_name (unsigned int n, const std::string &vn)
void var_name (unsigned int n, const char *vn)
const std::string const_name (unsigned int n) const
void const_name (unsigned int n, const std::string &vn)
void const_name (unsigned int n, const char *vn)
bool get_const_num (unsigned int node_num, unsigned int &const_num)
const std::string obj_name () const
void obj_name (const std::string &vn)
void obj_name (const char *vn)
double obj_adj () const
void obj_adj (double adj)
double obj_mult () const
void obj_mult (double mult)
size_t n_fixed_vars () const
std::pair< const std::string,
double > 
fixed_var (unsigned int n) const
void fixed_var (const std::string &vn, double val)
void fixed_var (const char *vn, double val)
size_t n_unused_vars () const
const std::string & unused_var (unsigned int n) const
void unused_var (const std::string &vn)
void unused_var (const char *vn)
size_t n_unused_constrs () const
const std::string & unused_constr (unsigned int n) const
void unused_constr (const std::string &vn)
void unused_constr (const char *vn)
const std::map< int,
std::vector< double > > & 
trace_points () const
const std::map< int,
std::vector< double > > & 
optima () const
void add_trace_point (int nr, const std::vector< double > &d)
void add_optimum (int nr, const std::vector< double > &d)

Friends

class model_iddata


Detailed Description

Models are grouped into sets, which can be directly combined with each other, like models and model deltas. In this class global references to nodes, variables, constants, and back references from constraint numbers to constraints are managed. Furthermore, the reference model, the main model to which all the deltas belong, is stored.

Definition at line 750 of file model.h.


Constructor & Destructor Documentation

coco::model_gid::model_gid ( model __m,
model_iddata __i = NULL 
) [inline]

Constructor, which also builds a new model_iddata structure, unless __i is non-NULL. The parameter __m sets the reference model.

Definition at line 304 of file model.hpp.

coco::model_gid::model_gid ( model __m,
unsigned int  n,
model_iddata __i = NULL 
) [inline]

Constructor, which also builds a new model_iddata structure, unless __i is non-NULL. The parameter __m sets the reference model, while n presets the number of variables.

Definition at line 314 of file model.hpp.

coco::model_gid::model_gid ( model __mr,
const model_gid __m 
) [inline]

Copy Constructor, which copies the model_gid __m but changes the reference model to __mr.

Definition at line 324 of file model.hpp.

coco::model_gid::~model_gid (  )  [inline]

Standard Destructor

Definition at line 835 of file model.h.


Member Function Documentation

void coco::model_gid::add_optimum ( int  nr,
const std::vector< double > &  d 
) [inline]

A call to this method adds the known optimum nr with coordinates d to the list of known optima.

Definition at line 1033 of file model.h.

void coco::model_gid::add_trace_point ( int  nr,
const std::vector< double > &  d 
) [inline]

A call to this method adds the trace point nr with coordinates d to the list of trace points.

Definition at line 1029 of file model.h.

void coco::model_gid::compress_numbers ( bool  renumber_vars = false,
bool  renumber_const = false 
) [inline]

If this method is called, the nodes, variables, and constraints are renumbered to fill gaps (unused numbers). To keep the model hierarchy consistent, all numbers in all models in the same model_iddata are changed. The parameters renumber_vars and renumber_const determine whether the variable and constraint numbers, respectively, are renumbered in addition to the node numbers.

Definition at line 902 of file model.h.

void coco::model_gid::const_name ( unsigned int  n,
const char *  vn 
) [inline]

A call to this method sets the name of the constraint n to cn.

Definition at line 965 of file model.h.

void coco::model_gid::const_name ( unsigned int  n,
const std::string &  vn 
) [inline]

A call to this method sets the name of the constraint n to cn.

Definition at line 962 of file model.h.

const std::string coco::model_gid::const_name ( unsigned int  n  )  const [inline]

This method returns the name of the constraint n.

Definition at line 959 of file model.h.

const model::walker& coco::model_gid::constraint ( unsigned int  i  )  const [inline]

A call to this method returns a walker to constraint i.

Definition at line 910 of file model.h.

bool coco::model_gid::empty ( const model::walker __x  )  const [inline]

This method checks whether the walker __x points to an empty reference, i.e. to a deleted node.

Definition at line 915 of file model.h.

model::walker coco::model_gid::empty_reference (  )  const [inline]

This method returns an empty reference. This is, e.g., stored in global reference arrays whenever a node is deleted.

Definition at line 922 of file model.h.

void coco::model_gid::fixed_var ( const char *  vn,
double  val 
) [inline]

This method stores the fixed variable with name vn and value val.

Definition at line 998 of file model.h.

void coco::model_gid::fixed_var ( const std::string &  vn,
double  val 
) [inline]

This method stores the fixed variable with name vn and value val.

Definition at line 996 of file model.h.

std::pair<const std::string, double> coco::model_gid::fixed_var ( unsigned int  n  )  const [inline]

This method returns the name and value of the fixed variable n.

Definition at line 993 of file model.h.

unsigned int coco::model_gid::get_const_id (  )  [inline]

This method returns a free constraint number a removes it from the list of free constraint numbers.

Definition at line 891 of file model.h.

bool coco::model_gid::get_const_num ( unsigned int  node_num,
unsigned int &  const_num 
) [inline]

The get_const_num method assigns to const_num the constraint number associated with the constraint, whose result node has node number node_num. The return value is true, if there is a constraint associated with node node_num.

Definition at line 481 of file model.hpp.

unsigned int coco::model_gid::get_node_id (  )  [inline]

This method returns a free node number a removes it from the list of free node numbers.

Definition at line 879 of file model.h.

unsigned int coco::model_gid::get_var_id (  )  [inline]

This method returns a free variable number a removes it from the list of free variable numbers.

Definition at line 885 of file model.h.

bool coco::model_gid::have_gconst_ref ( unsigned int  _cnum  )  const [inline]

This method checks whether a global constraint reference exists for constraint number _nnum.

Definition at line 934 of file model.h.

bool coco::model_gid::have_glob_ref ( unsigned int  _nnum  )  const [inline]

This method checks whether a global node reference exists for node number _nnum.

Definition at line 926 of file model.h.

bool coco::model_gid::have_gvar_ref ( unsigned int  _vnum  )  const [inline]

This method checks whether a global variable reference exists for variable number _nnum.

Definition at line 930 of file model.h.

bool coco::model_gid::its_me ( const model __m  )  const [inline]

The its_me method tests if the model __m is the reference model for this model group.

Definition at line 919 of file model.h.

void coco::model_gid::make_const_back_ref ( unsigned int  node,
unsigned int  cnum 
) [inline]

This method constructs a constraint back reference from node number node to constraint number cnum.

Definition at line 492 of file model.hpp.

void coco::model_gid::mk_gconstref ( unsigned int  n,
const model::walker __w 
) [inline]

This method constructs a global constraint reference to __w with number n.

Definition at line 441 of file model.hpp.

void coco::model_gid::mk_globref ( unsigned int  n,
const model::walker __w 
) [inline]

This method constructs a global node reference to __w with number n.

Definition at line 415 of file model.hpp.

void coco::model_gid::mk_gvarref ( unsigned int  n,
const model::walker __w 
) [inline]

This method constructs a global variable reference to __w with number n.

Definition at line 428 of file model.hpp.

void coco::model_gid::model_name ( const char *  n  )  [inline]

This method sets the name of the model to n.

Definition at line 948 of file model.h.

void coco::model_gid::model_name ( const std::string &  n  )  [inline]

This method sets the name of the model to n.

Definition at line 946 of file model.h.

const std::string coco::model_gid::model_name (  )  const [inline]

This method returns the name of the model.

Definition at line 944 of file model.h.

size_t coco::model_gid::n_fixed_vars (  )  const [inline]

This method returns the number of variables fixed by the presolve.

Definition at line 991 of file model.h.

size_t coco::model_gid::n_unused_constrs (  )  const [inline]

This method returns the number of unused constraints.

Definition at line 1012 of file model.h.

size_t coco::model_gid::n_unused_vars (  )  const [inline]

This method returns the number of unused variables.

Definition at line 1002 of file model.h.

const model::walker& coco::model_gid::node ( unsigned int  i  )  const [inline]

A call to this method returns a walker to node i.

Definition at line 906 of file model.h.

void coco::model_gid::number_of_constraints ( unsigned int  _n  )  [inline]

This method sets the number of constraints across all model groups in the same model_iddata.

Definition at line 861 of file model.h.

unsigned int coco::model_gid::number_of_constraints (  )  const [inline]

The number_of_constraints method returns the number of constraints across all models governed by the same model_iddata.

Definition at line 851 of file model.h.

void coco::model_gid::number_of_nodes ( unsigned int  _n  )  [inline]

This method sets the number of nodes across all model groups in the same model_iddata.

Definition at line 855 of file model.h.

unsigned int coco::model_gid::number_of_nodes (  )  const [inline]

The number_of_nodes method returns the number of nodes across all models governed by the same model_iddata.

Definition at line 844 of file model.h.

void coco::model_gid::number_of_variables ( unsigned int  _n  )  [inline]

This method sets the number of variables across all model groups in the same model_iddata.

Definition at line 858 of file model.h.

unsigned int coco::model_gid::number_of_variables (  )  const [inline]

The number_of_variables method returns the number of variables across all models governed by the same model_iddata.

Definition at line 847 of file model.h.

void coco::model_gid::obj_adj ( double  adj  )  [inline]

With this method the additive constant in the objective function is set to adj.

Definition at line 983 of file model.h.

double coco::model_gid::obj_adj (  )  const [inline]

This method returns the additive constant in the objective function.

Definition at line 980 of file model.h.

void coco::model_gid::obj_mult ( double  mult  )  [inline]

With this method the scalar multiplier of the objective function is set to mult.

Definition at line 988 of file model.h.

double coco::model_gid::obj_mult (  )  const [inline]

This method returns the scalar multiplier of the objective function.

Definition at line 985 of file model.h.

void coco::model_gid::obj_name ( const char *  vn  )  [inline]

A call to this method sets the name of the objective function to vn.

Definition at line 978 of file model.h.

void coco::model_gid::obj_name ( const std::string &  vn  )  [inline]

A call to this method sets the name of the objective function to vn.

Definition at line 976 of file model.h.

const std::string coco::model_gid::obj_name (  )  const [inline]

This method returns the name of the objective function.

Definition at line 974 of file model.h.

const std::map< int, std::vector< double > > & coco::model_gid::optima (  )  const [inline]

This method returns the known optima defined. The return value is a map of known optima numbers to coordinate vectors.

Definition at line 504 of file model.hpp.

void coco::model_gid::remove_const_id ( unsigned int  n  )  [inline]

This method inserts the constraint number n in the list of free constraint numbers.

Definition at line 894 of file model.h.

void coco::model_gid::remove_const_ref ( unsigned int  _n  )  [inline]

This method removes the global constraint reference of node _n.

Definition at line 459 of file model.hpp.

void coco::model_gid::remove_node_id ( unsigned int  n  )  [inline]

This method inserts the node number n in the list of free node numbers.

Definition at line 882 of file model.h.

void coco::model_gid::remove_node_ref ( unsigned int  _n  )  [inline]

This method removes the global node reference of node _n.

Definition at line 812 of file model.h.

void coco::model_gid::remove_var_id ( unsigned int  n  )  [inline]

This method inserts the variable number n in the list of free variable numbers.

Definition at line 888 of file model.h.

void coco::model_gid::remove_var_ref ( unsigned int  _n  )  [inline]

This method removes the global variable reference of node _n.

Definition at line 816 of file model.h.

const std::map< int, std::vector< double > > & coco::model_gid::trace_points (  )  const [inline]

This method returns the trace points defined. The return value is a map of trace point numbers to coordinate vectors.

Definition at line 501 of file model.hpp.

void coco::model_gid::unused_constr ( const char *  vn  )  [inline]

This method stores the unused constraint with name vn.

Definition at line 1019 of file model.h.

void coco::model_gid::unused_constr ( const std::string &  vn  )  [inline]

This method stores the unused constraint with name vn.

Definition at line 1017 of file model.h.

const std::string& coco::model_gid::unused_constr ( unsigned int  n  )  const [inline]

This method returns the name of the unused constraint n.

Definition at line 1014 of file model.h.

void coco::model_gid::unused_var ( const char *  vn  )  [inline]

This method stores the unused variable with name vn.

Definition at line 1009 of file model.h.

void coco::model_gid::unused_var ( const std::string &  vn  )  [inline]

This method stores the unused variable with name vn.

Definition at line 1007 of file model.h.

const std::string& coco::model_gid::unused_var ( unsigned int  n  )  const [inline]

This method returns the name of the unused variable n.

Definition at line 1004 of file model.h.

void coco::model_gid::var_name ( unsigned int  n,
const char *  vn 
) [inline]

A call to this method sets the name of the variable n to vn.

Definition at line 955 of file model.h.

void coco::model_gid::var_name ( unsigned int  n,
const std::string &  vn 
) [inline]

A call to this method sets the name of the variable n to vn.

Definition at line 953 of file model.h.

const std::string coco::model_gid::var_name ( unsigned int  n  )  const [inline]

This method returns the name of the variable n.

Definition at line 951 of file model.h.

const model::walker& coco::model_gid::variable ( unsigned int  i  )  const [inline]

A call to this method returns a walker to variable i.

Definition at line 908 of file model.h.


Friends And Related Function Documentation

friend class model_iddata [friend]

Definition at line 1037 of file model.h.


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

Generated on Tue Feb 9 14:49:46 2010 for COCONUT API by  doxygen 1.5.8