coco::model_iddata Class Reference
[Models]

The model id-data class (the topmost in the model class hierarchy). More...

#include <model.h>

List of all members.

Public Member Functions

 model_iddata (unsigned int n=0)
 ~model_iddata ()
void new_ref (model_gid &__m)
bool delete_ref (model_gid &__m)
void compress_numbers (bool renum_vars, bool renum_consts=false)
Methods for handling the global model data
These methods can be used for handling important information of a model about 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)
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)
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)
const std::string var_name (unsigned int n) const
void var_name (unsigned int n, const std::string &vn)
const std::string const_name (unsigned int n) const
void const_name (unsigned int n, const std::string &cn)
const std::string obj_name () const
void obj_name (const std::string &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)
size_t n_unused_vars () const
const std::string & unused_var (unsigned int n) const
void unused_var (const std::string &vn)
size_t n_unused_constrs () const
const std::string & unused_constr (unsigned int n) const
void unused_constr (const std::string &vn)

Friends

class model_gid


Detailed Description

  The model_iddata class is the topmost in a hierarchy of model classes. It represents the important global information, manages the free and used numbers for nodes, variables, and constraints. There is usually no need to directly access members or methods of this class. The class is managed automatically by the various methods of the model_gid and model classes. All model groups (model_gid) in one model_iddata have the same variable, node, and constraint numbering, and share the same global information (free and used numbers, names, ...).

Definition at line 552 of file model.h.


Constructor & Destructor Documentation

coco::model_iddata::model_iddata ( unsigned int  n = 0  )  [inline]

Standard Constructor, which prepares for n variables.

Definition at line 612 of file model.h.

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

Standard Destructor

Definition at line 623 of file model.h.


Member Function Documentation

void coco::model_iddata::compress_numbers ( bool  renum_vars,
bool  renum_consts = false 
)

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.

Definition at line 77 of file model.cc.

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

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

Definition at line 235 of file model.hpp.

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

This method returns the name of the constraint n.

Definition at line 223 of file model.hpp.

bool coco::model_iddata::delete_ref ( model_gid __m  )  [inline]

This method deletes the back reference to the model_gid __m.

Definition at line 42 of file model.hpp.

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

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

Definition at line 271 of file model.hpp.

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

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

Definition at line 261 of file model.hpp.

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

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

Definition at line 124 of file model.hpp.

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

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

Definition at line 56 of file model.hpp.

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

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

Definition at line 89 of file model.hpp.

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

This method sets the name of the model to n.

Definition at line 194 of file model.hpp.

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

This method returns the name of the model.

Definition at line 186 of file model.hpp.

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

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

Definition at line 717 of file model.h.

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

This method returns the number of unused constraints.

Definition at line 731 of file model.h.

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

This method returns the number of unused variables.

Definition at line 724 of file model.h.

void coco::model_iddata::new_ref ( model_gid __m  )  [inline]

This method adds a new back reference to the model_gid __m.

Definition at line 626 of file model.h.

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

This method sets the number of constraints to _n.

Definition at line 177 of file model.hpp.

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

A call to this method retrieves the start of the contiguous part of the free constraints. This is the allocated size of the constraint access vectors.

Definition at line 646 of file model.h.

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

This method sets the number of nodes to _n.

Definition at line 160 of file model.hpp.

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

A call to this method retrieves the start of the contiguous part of the free nodes. This is the allocated size of the node access vectors.

Definition at line 638 of file model.h.

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

This method sets the number of variables to _n.

Definition at line 168 of file model.hpp.

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

A call to this method retrieves the start of the contiguous part of the free variables. This is the allocated size of the variable access vectors.

Definition at line 642 of file model.h.

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

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

Definition at line 257 of file model.hpp.

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

This method returns the additive constant in the objective function.

Definition at line 256 of file model.hpp.

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

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

Definition at line 259 of file model.hpp.

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

This method returns the scalar multiplier of the objective function.

Definition at line 258 of file model.hpp.

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

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

Definition at line 255 of file model.hpp.

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

This method returns the name of the objective function.

Definition at line 247 of file model.hpp.

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

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

Definition at line 137 of file model.hpp.

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

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

Definition at line 69 of file model.hpp.

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

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

Definition at line 102 of file model.hpp.

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

This method stores the unused constraint with name vn.

Definition at line 299 of file model.hpp.

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

This method returns the name of the unused constraint n.

Definition at line 290 of file model.hpp.

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

This method stores the unused variable with name vn.

Definition at line 285 of file model.hpp.

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

This method returns the name of the unused variable n.

Definition at line 276 of file model.hpp.

void coco::model_iddata::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 211 of file model.hpp.

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

This method returns the name of the variable n.

Definition at line 199 of file model.hpp.


Friends And Related Function Documentation

friend class model_gid [friend]

Definition at line 738 of file model.h.


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

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