Classes | Enumerations | Functions | Variables
flopc Namespace Reference

All flopc++ code is contained within the flopc namespace. More...

Classes

class  Boolean_base
 Base class for all "boolean" types of data. More...
 
class  MP_boolean
 Reference counted class for all "boolean" types of data. More...
 
class  Constant_base
 Base class for all "constant" types of data. More...
 
class  Constant
 Reference counted class for all "constant" types of data. More...
 
class  Constraint
 Semantic representation of a constraint in a Math Program. More...
 
class  MP_constraint
 Semantic representation of a linear constraint. More...
 
class  DataRef
 Reference to a set of data. More...
 
class  MP_data
 Input data set. More...
 
class  MP_stochastic_data
 
class  MP_subset
 Internal representation of a "set". More...
 
class  MP_domain_base
 Reference to a set of index values. More...
 
class  MP_domain
 Range over which some other constuct is defined. More...
 
class  MP_domain_set
 Range over which some other constuct is defined. More...
 
class  MP_domain_subset
 Range over which some other constuct is defined. More...
 
class  insertFunctor
 Inserter for construction of a subset. More...
 
struct  Coef
 Internal representation of a Coefficient in a matrix. More...
 
class  GenerateFunctor
 Functor to facilitate generation of coefficients. More...
 
class  ObjectiveGenerateFunctor
 Functor to facilitate generation of the objective function. More...
 
class  MP_expression_base
 The base class for all expressions. More...
 
class  MP_expression
 Symbolic representation of a linear expression. More...
 
class  TerminalExpression
 The base class for all expressions. More...
 
class  Expression_operator
 The base class for all expressions. More...
 
class  MP_index_base
 Internal representation of a index. More...
 
class  MP_index
 Representation of an index. More...
 
class  MP_index_exp
 Representation of an expression involving an index. More...
 
class  MP_index_mult
 Internal representation of an index expression. More...
 
class  MP_index_sum
 Internal representation of an index expression. More...
 
class  MP_index_dif
 Internal representation of an index expression. More...
 
class  Messenger
 Inteface for hooking up to internal flopc++ message handling. More...
 
class  NormalMessenger
 Internal use: used when Normal output is selected. More...
 
class  VerboseMessenger
 Internal use: used when Verbose output is selected. More...
 
class  MP_model
 This is the anchor point for all constructs in a FlopC++ model. More...
 
class  MP_set_base
 Internal representation of a "set". More...
 
class  MP_set
 Representation of a set for indexing into some other construct. More...
 
class  MP_stage
 
class  InsertFunctor
 Internal representation of a "set". More...
 
class  SubsetRef
 Internal representation of a "set". More...
 
class  SUBSETREF
 Internal representation of a "set". More...
 
class  Functor
 Function object. More...
 
class  RowMajor
 Utility class to flatten multidimensional information into single dimentional offset information. More...
 
class  Named
 Utility interface class for adding a string name onto a structure. More...
 
class  Handle
 Utility for doing reference counted pointers. More...
 
class  VariableRef
 Semantic representation of a variable in a Math Program. More...
 
class  MP_variable
 Symantic representation of a variable. More...
 
class  MP_binary_variable
 Specialized subclass of MP_variable where the variable is pre-specified to be binary. More...
 

Enumerations

enum  Sense_enum { LE, GE, EQ }
 Enumeration for indicating direction of a constraint. More...
 
enum  variableType { continuous, discrete }
 Enumeration for indicating variable type. More...
 

Functions

void forall (const MP_domain &d, const Functor &f)
 Global function for performing a Functor on each member of a MP_domain. More...
 
void forall (const Functor &f)
 Global function for performing a Functor without having a set to operate on. More...
 
void operator<<= (const MP_domain &s, const MP_domain &d)
 Global function which copies members of MP_domain d into another (possibly non-empty) MP_domain. More...
 
void minimize (const MP_expression &obj)
 This is one of the main entry points for executionThis calls the OsiSolverInterface to execute the solver with the objective of MINIMIZING the argment MP_expression. More...
 
void minimize_max (MP_set &d, const MP_expression &obj)
 This is one of the main entry points for executionThis calls the OsiSolverInterface to execute the solver with the objective of MINIMIZING THE MAXIMUM of the MP_expression evaluation of the MP_set. More...
 
void maximize (const MP_expression &obj)
 This is one of the main entry points for executionThis calls the OsiSolverInterface to execute the solver with the objective of MAXIMIZING of the MP_expression. More...
 
MP_boolean operator! (const MP_boolean &b)
 For computing the logical negation of a booleanThis is used in the normal formation of an expression. More...
 
MP_boolean operator&& (const MP_boolean &e1, const MP_boolean &e2)
 For computing the logical AND of two booleansThis is used in the normal formation of an expression. More...
 
MP_boolean operator|| (const MP_boolean &e1, const MP_boolean &e2)
 For computing the logical OR of two booleansThis is used in the normal formation of an expression. More...
 
MP_boolean alltrue (const MP_domain &d, const MP_boolean &b)
 boolean which returns true if all in domain evaluate to true. More...
 
MP_boolean operator<= (const MP_index_exp &e1, const MP_index_exp &e2)
 constructs a boolean evaluator using operator overloadingThis is used in the normal formation of an expression. More...
 
MP_boolean operator<= (const Constant &e1, const Constant &e2)
 constructs a boolean evaluator by comparing two constants. More...
 
MP_boolean operator< (const MP_index_exp &e1, const MP_index_exp &e2)
 constructs a boolean evaluator using operator overloadingThis is used in the normal formation of an expression. More...
 
MP_boolean operator< (const Constant &e1, const Constant &e2)
 constructs a boolean evaluator by comparing two constants. More...
 
MP_boolean operator>= (const MP_index_exp &e1, const MP_index_exp &e2)
 constructs a boolean evaluator using operator overloadingThis is used in the normal formation of an expression. More...
 
MP_boolean operator>= (const Constant &e1, const Constant &e2)
 constructs a boolean evaluator by comparing two constants. More...
 
MP_boolean operator> (const MP_index_exp &e1, const MP_index_exp &e2)
 constructs a boolean evaluator using operator overloadingThis is used in the normal formation of an expression. More...
 
MP_boolean operator> (const Constant &e1, const Constant &e2)
 constructs a boolean evaluator by comparing two constants. More...
 
MP_boolean operator== (const MP_index_exp &e1, const MP_index_exp &e2)
 constructs a boolean evaluator using operator overloadingThis is used in the normal formation of an expression. More...
 
MP_boolean operator== (const Constant &e1, const Constant &e2)
 constructs a boolean evaluator by comparing two constants. More...
 
MP_boolean operator!= (const MP_index_exp &e1, const MP_index_exp &e2)
 constructs a boolean evaluator using operator overloadingThis is used in the normal formation of an expression. More...
 
MP_boolean operator!= (const Constant &e1, const Constant &e2)
 constructs a boolean evaluator by comparing two constants. More...
 
Constant abs (const Constant &c)
 for computing the absolute value of a constant value. More...
 
Constant pos (const Constant &c)
 for returning non-negative value of the constant. More...
 
Constant ceil (const Constant &c)
 The ceiling integral value of the input constant. More...
 
Constant floor (const Constant &c)
 The floor integral value of the input constant. More...
 
Constant minimum (const Constant &a, const Constant &b)
 Returns the smaller of two constants. More...
 
Constant maximum (const Constant &a, const Constant &b)
 Returns the larger of two constants. More...
 
Constant operator+ (const Constant &a, const Constant &b)
 Returns the sum of two constants. More...
 
Constant operator- (const Constant &a, const Constant &b)
 Returns the difference of two constants. More...
 
Constant operator* (const Constant &a, const Constant &b)
 Returns the product of two constants. More...
 
Constant operator/ (const Constant &a, const Constant &b)
 Returns the quotient of two constants. More...
 
Constant maximum (const MP_domain &i, const Constant &e)
 Returns the maximum over the domain of the constant. More...
 
Constant minimum (const MP_domain &i, const Constant &e)
 Returns the sum of two constants. More...
 
Constant sum (const MP_domain &i, const Constant &e)
 Returns the sum of two constants. More...
 
Constant product (const MP_domain &i, const Constant &e)
 Returns the sum of two constants. More...
 
Constraint operator<= (const MP_expression &l, const MP_expression &r)
 Uses operator overloading to construct an ConstraintConstucts a Constraint using operator overloading. More...
 
Constraint operator<= (const Constant &l, const MP_expression &r)
 Uses operator overloading to construct an ConstraintConstucts a Constraint using operator overloading. More...
 
Constraint operator<= (const MP_expression &l, const Constant &r)
 Uses operator overloading to construct an ConstraintConstucts a Constraint using operator overloading. More...
 
Constraint operator<= (const VariableRef &l, const VariableRef &r)
 Uses operator overloading to construct an ConstraintConstucts a Constraint using operator overloading. More...
 
Constraint operator>= (const MP_expression &l, const MP_expression &r)
 Uses operator overloading to construct an ConstraintConstucts a Constraint using operator overloading. More...
 
Constraint operator>= (const Constant &l, const MP_expression &r)
 Uses operator overloading to construct an ConstraintConstucts a Constraint using operator overloading. More...
 
Constraint operator>= (const MP_expression &l, const Constant &r)
 Uses operator overloading to construct an ConstraintConstucts a Constraint using operator overloading. More...
 
Constraint operator>= (const VariableRef &l, const VariableRef &r)
 Uses operator overloading to construct an ConstraintConstucts a Constraint using operator overloading. More...
 
Constraint operator== (const MP_expression &l, const MP_expression &r)
 Uses operator overloading to construct an ConstraintConstucts a Constraint using operator overloading. More...
 
Constraint operator== (const Constant &l, const MP_expression &r)
 Uses operator overloading to construct an ConstraintConstucts a Constraint using operator overloading. More...
 
Constraint operator== (const MP_expression &l, const Constant &r)
 Uses operator overloading to construct an ConstraintConstucts a Constraint using operator overloading. More...
 
Constraint operator== (const VariableRef &l, const VariableRef &r)
 Uses operator overloading to construct an ConstraintConstucts a Constraint using operator overloading. More...
 
MP_domain operator* (const MP_domain &a, const MP_domain &b)
 operator which creates a new domain as the pairwise combinations of two input domains. More...
 
MP_expression operator+ (const MP_expression &e1, const MP_expression &e2)
 Operator which sums two MP_expressions, forms a new MP_expression. More...
 
MP_expression operator+ (const MP_expression &e1, const Constant &e2)
 Operator which sums an MP_expression and a constant, and forms a new MP_expression. More...
 
MP_expression operator+ (const Constant &e1, const MP_expression &e2)
 Operator which sums a constant and an MP_expression , and forms a new MP_expression. More...
 
MP_expression operator- (const MP_expression &e1, const MP_expression &e2)
 Operator which subtracts an MP_expression from an MP_expression, and forms a new MP_expression. More...
 
MP_expression operator- (const MP_expression &e1, const Constant &e2)
 Operator which subtracts a Constant from an MP_expression, and forms a new MP_expression. More...
 
MP_expression operator- (const Constant &e1, const MP_expression &e2)
 Operator which subtracts an MP_expression from a Constant, and forms a new MP_expression. More...
 
MP_expression operator* (const Constant &e1, const MP_expression &e2)
 Operator which multiplies a Constant by an MP_expression, and forms a new MP_expression. More...
 
MP_expression operator* (const MP_expression &e1, const Constant &e2)
 Operator which multiplies an MP_expression by a Constant, and forms a new MP_expression. More...
 
MP_expression sum (const MP_domain &d, const MP_expression &e)
 forms an expression by summing an expression over a domain. More...
 
Constant operator+ (MP_index &a, MP_index &b)
 returns a Constant as a result of addition of two MP_index values. More...
 
Constant operator- (MP_index &a, MP_index &b)
 returns a Constant as a result of a difference of two MP_index values. More...
 
MP_index_exp operator- (MP_index &i, const int &j)
 returns an index expression from a difference between an MP_index and an integer. More...
 
MP_index_exp operator+ (MP_index &i, const int &j)
 returns an index expression from a sum between an MP_index and an integer. More...
 
MP_index_exp operator+ (MP_index &i, const Constant &j)
 returns an index expression from a sum between an MP_index and a Constant. More...
 
MP_index_exp operator* (MP_index &i, const Constant &j)
 returns an index expression from a product between an MP_index and a Constant. More...
 
std::ostream & operator<< (std::ostream &os, const MP_model::MP_status &condition)
 allows print of result from call to solve(); More...
 
std::ostream & operator<< (std::ostream &os, const MP_model::MP_direction &direction)
 allows print of direction used when calling solve. (MIN/MAX) More...
 
template<int nbr, class T >
std::vector< T > makeVector (T i1, T i2=0, T i3=0, T i4=0, T i5=0)
 This template makes a vector of appropriate size out of the variable number of arguments. More...
 
int mod (int a, int b)
 return the strictly positive modulus of two integers More...
 

Variables

const int outOfBound = -2
 Distinct return value on conditions where an index goes out of bounds. More...
 

Detailed Description

All flopc++ code is contained within the flopc namespace.

Flopc++ is an open source algebraic modelling language implemented as a C++ class library. It uses the common COIN-OR OsiSolverInterface abstract interface to allow for easy integration with many of today's top Math Programming solvers.

main 3 components are listed below. Much of the rest of the code is to facilitate the operator overloading makes this such a powerful modeling environment.

Function Documentation

MP_domain flopc::operator* ( const MP_domain &  a,
const MP_domain &  b 
)

operator which creates a new domain as the pairwise combinations of two input domains.

MP_expression flopc::operator+ ( const MP_expression &  e1,
const MP_expression &  e2 
)

Operator which sums two MP_expressions, forms a new MP_expression.

MP_expression flopc::operator+ ( const MP_expression &  e1,
const Constant &  e2 
)

Operator which sums an MP_expression and a constant, and forms a new MP_expression.

MP_expression flopc::operator+ ( const Constant &  e1,
const MP_expression &  e2 
)

Operator which sums a constant and an MP_expression , and forms a new MP_expression.

MP_expression flopc::operator- ( const MP_expression &  e1,
const MP_expression &  e2 
)

Operator which subtracts an MP_expression from an MP_expression, and forms a new MP_expression.

MP_expression flopc::operator- ( const MP_expression &  e1,
const Constant &  e2 
)

Operator which subtracts a Constant from an MP_expression, and forms a new MP_expression.

MP_expression flopc::operator- ( const Constant &  e1,
const MP_expression &  e2 
)

Operator which subtracts an MP_expression from a Constant, and forms a new MP_expression.

MP_expression flopc::operator* ( const Constant &  e1,
const MP_expression &  e2 
)

Operator which multiplies a Constant by an MP_expression, and forms a new MP_expression.

MP_expression flopc::operator* ( const MP_expression &  e1,
const Constant &  e2 
)

Operator which multiplies an MP_expression by a Constant, and forms a new MP_expression.

MP_expression flopc::sum ( const MP_domain &  d,
const MP_expression &  e 
)

forms an expression by summing an expression over a domain.

Note
it's expected that the expression is defined over that domain.
Constant flopc::operator+ ( MP_index &  a,
MP_index &  b 
)

returns a Constant as a result of addition of two MP_index values.

Constant flopc::operator- ( MP_index &  a,
MP_index &  b 
)

returns a Constant as a result of a difference of two MP_index values.

MP_index_exp flopc::operator- ( MP_index &  i,
const int &  j 
)

returns an index expression from a difference between an MP_index and an integer.

(i-5)

MP_index_exp flopc::operator+ ( MP_index &  i,
const int &  j 
)

returns an index expression from a sum between an MP_index and an integer.

(i+5)

MP_index_exp flopc::operator+ ( MP_index &  i,
const Constant &  j 
)

returns an index expression from a sum between an MP_index and a Constant.

MP_index_exp flopc::operator* ( MP_index &  i,
const Constant &  j 
)

returns an index expression from a product between an MP_index and a Constant.

std::ostream& flopc::operator<< ( std::ostream &  os,
const MP_model::MP_status &  condition 
)

allows print of result from call to solve();

std::ostream& flopc::operator<< ( std::ostream &  os,
const MP_model::MP_direction &  direction 
)

allows print of direction used when calling solve. (MIN/MAX)

int flopc::mod ( int  a,
int  b 
)
inline

return the strictly positive modulus of two integers

Definition at line 57 of file MP_utilities.hpp.

Variable Documentation

const int flopc::outOfBound = -2

Distinct return value on conditions where an index goes out of bounds.

Definition at line 63 of file MP_utilities.hpp.